diff options
author | bobzel <zzzman@gmail.com> | 2022-09-15 13:17:42 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-09-15 13:17:42 -0400 |
commit | 2ca9be67d727f52c3264156d6408df7b8624f779 (patch) | |
tree | 2dd4f1e28efe1a38da0a1842aa264f834ee0fd73 /src | |
parent | f525a98c62fd32993b0927c159ee559fc6550215 (diff) |
again...
Diffstat (limited to 'src')
-rw-r--r-- | src/server/DashUploadUtils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/DashUploadUtils.ts b/src/server/DashUploadUtils.ts index 85e197e25..c66e932dd 100644 --- a/src/server/DashUploadUtils.ts +++ b/src/server/DashUploadUtils.ts @@ -102,7 +102,7 @@ export namespace DashUploadUtils { export function uploadYoutube(videoId: string): Promise<Upload.FileResponse> { return new Promise<Upload.FileResponse<Upload.FileInformation>>((res, rej) => { console.log('Uploading YouTube video: ' + videoId); - exec('youtube-dl -o ' + (videoId.replace(/^-/, '__') + '.mp4') + " 'https://www.youtube.com/watch?v=" + videoId + "' -f 'mp4[filesize<5M]/bestvideo[filesize<5M]+bestaudio/bestvideo+bestaudio'", (error: any, stdout: any, stderr: any) => { + exec('youtube-dl -o ' + (videoId.replace(/^-/, '__') + '.mp4') + ' "https://www.youtube.com/watch?v=' + videoId + '" -f "mp4[filesize<5M]/bestvideo[filesize<5M]+bestaudio/bestvideo+bestaudio"', (error: any, stdout: any, stderr: any) => { if (error) { console.log(`error: Error: ${error.message}`); res({ @@ -116,7 +116,7 @@ export namespace DashUploadUtils { result: { name: 'failed youtube query', message: `Could not upload YouTube video (${videoId}). Error: ${error.message}` }, }); } else { - exec('youtube-dl -o ' + (videoId.replace(/^-/, '__') + '.mp4') + " 'https://www.youtube.com/watch?v=" + videoId + "' --get-duration", (error: any, stdout: any, stderr: any) => { + exec('youtube-dl -o ' + (videoId.replace(/^-/, '__') + '.mp4') + ' "https://www.youtube.com/watch?v=' + videoId + '" --get-duration', (error: any, stdout: any, stderr: any) => { const time = Array.from(stdout.trim().split(':')).reverse(); const duration = (time.length > 2 ? Number(time[2]) * 1000 * 60 : 0) + (time.length > 1 ? Number(time[1]) * 60 : 0) + (time.length > 0 ? Number(time[0]) : 0); const data = { size: 0, path: videoId.replace(/^-/, '__') + '.mp4', name: videoId, type: 'video/mp4' }; |