From 80f214fdde096e788f04bfef1495d06868efbfd0 Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Wed, 27 May 2020 00:12:17 -0400 Subject: [PATCH] Fixed bug that caused non-YT videos to be downloading using the best format --- backend/app.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/app.js b/backend/app.js index 95a17e0..c234ef1 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1487,7 +1487,7 @@ async function generateArgs(url, type, options) { const is_youtube = url.includes('youtu'); if (!is_audio && !is_youtube) { // tiktok videos fail when using the default format - qualityPath = '-f best'; + qualityPath = null; } else if (!is_audio && !is_youtube && (url.includes('reddit') || url.includes('pornhub'))) { qualityPath = '-f bestvideo+bestaudio' } @@ -1504,11 +1504,13 @@ async function generateArgs(url, type, options) { } if (customOutput) { - downloadConfig = ['-o', path.join(fileFolderPath, customOutput) + ".%(ext)s", qualityPath, '--write-info-json', '--print-json']; + downloadConfig = ['-o', path.join(fileFolderPath, customOutput) + ".%(ext)s", '--write-info-json', '--print-json']; } else { - downloadConfig = ['-o', path.join(fileFolderPath, videopath + (is_audio ? '.%(ext)s' : '.mp4')), qualityPath, '--write-info-json', '--print-json']; + downloadConfig = ['-o', path.join(fileFolderPath, videopath + (is_audio ? '.%(ext)s' : '.mp4')), '--write-info-json', '--print-json']; } + if (qualityPath) downloadConfig.push(qualityPath); + if (is_audio && !options.skip_audio_args) { downloadConfig.push('-x'); downloadConfig.push('--audio-format', 'mp3');