get video quality only after confiming its downloadable, duh
This commit is contained in:
parent
a5ba61e066
commit
6acf62ec26
6
index.ts
6
index.ts
|
|
@ -132,9 +132,6 @@ app.ws('/download/:id', async (ws, req) => {
|
|||
return ws.close()
|
||||
}
|
||||
|
||||
if (parseInt(info.videoDetails.lengthSeconds) >= 900) quality = '360p' // 15min
|
||||
quality = getVideoQuality(info, quality)
|
||||
|
||||
if (info.playabilityStatus?.status !== 'OK') {
|
||||
ws.send(`This video is not available for download (${info.playability_status?.status} ${info.playability_status?.reason}).`);
|
||||
return ws.close()
|
||||
|
|
@ -146,6 +143,9 @@ app.ws('/download/:id', async (ws, req) => {
|
|||
return ws.close()
|
||||
}
|
||||
|
||||
if (parseInt(info.videoDetails.lengthSeconds) >= 900) quality = '360p' // 15min
|
||||
quality = getVideoQuality(info, quality)
|
||||
|
||||
let audioOutputStream: DownloadOutput | undefined;
|
||||
let videoOutputStream: DownloadOutput | undefined;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue