From 57051968f3f35f271929b486c2fc22eadc949da8 Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 26 Jul 2024 20:18:59 +0600 Subject: [PATCH] youtube: better audio checking --- src/modules/processing/services/youtube.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/processing/services/youtube.js b/src/modules/processing/services/youtube.js index 2a0d25c5..5aa201ce 100644 --- a/src/modules/processing/services/youtube.js +++ b/src/modules/processing/services/youtube.js @@ -176,7 +176,7 @@ export default async function(o) { if (bestQuality) bestQuality = qual(bestQuality); - if (!bestQuality && !o.isAudioOnly || !hasAudio) + if ((!bestQuality && !o.isAudioOnly) || !hasAudio) return { error: 'ErrorYTTryOtherCodec' }; if (basicInfo.duration > env.durationLimit) @@ -227,7 +227,7 @@ export default async function(o) { youtubeDubName: isDubbed ? o.dubLang : false } - if (hasAudio && o.isAudioOnly) return { + if (audio && o.isAudioOnly) return { type: "render", isAudioOnly: true, urls: audio.decipher(yt.session.player), @@ -252,7 +252,7 @@ export default async function(o) { const video = adaptive_formats.find(checkRender); - if (!match && video) { + if (!match && video && audio) { match = video; type = "render"; urls = [