From 05d962328be1f6c3e2b5ba716b01ba45e1080295 Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Mon, 18 May 2020 19:32:00 -0400 Subject: [PATCH] Fixed bug that prevented non-youtube videos from downloading --- backend/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app.js b/backend/app.js index b8f13ea..071e7dc 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1472,11 +1472,11 @@ async function generateArgs(url, type, options) { let downloadConfig = null; let qualityPath = (is_audio && !options.skip_audio_args) ? '-f bestaudio' :'-f best[ext=mp4]'; - - if (!is_audio && (url.includes('tiktok') || url.includes('pscp.tv'))) { + const is_youtube = !url.includes('youtu'); + if (!is_audio && !is_youtube) { // tiktok videos fail when using the default format qualityPath = '-f best'; - } else if (!is_audio && url.includes('reddit')) { + } else if (!is_audio && !is_youtube && url.includes('reddit')) { qualityPath = '-f bestvideo+bestaudio' } @@ -1894,7 +1894,7 @@ app.post('/api/tomp4', optionalJwt, async function(req, res) { const is_playlist = url.includes('playlist'); let result_obj = null; - if (is_playlist || options.customQualityConfiguration || options.customArgs || options.selectedHeight || url.includes('twitch') || url.includes('reddit')) + if (is_playlist || options.customQualityConfiguration || options.customArgs || options.selectedHeight || !url.includes('youtu')) result_obj = await downloadFileByURL_exec(url, 'video', options, req.query.sessionID); else result_obj = await downloadFileByURL_normal(url, 'video', options, req.query.sessionID);