From 73d84c09d38fc00aff7fe672fc5ea7cdc591c250 Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 15 Oct 2023 22:13:01 +0600 Subject: [PATCH] fix for youtube dubs rare error --- src/modules/processing/services/youtube.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/processing/services/youtube.js b/src/modules/processing/services/youtube.js index 71783fa0..4e58e5eb 100644 --- a/src/modules/processing/services/youtube.js +++ b/src/modules/processing/services/youtube.js @@ -54,7 +54,9 @@ export default async function(o) { audio = adaptive_formats.find(i => checkBestAudio(i) && !i["is_dubbed"]); if (o.dubLang) { - let dubbedAudio = adaptive_formats.find(i => checkBestAudio(i) && i["language"] === o.dubLang && !i["audio_track"].audio_is_default); + let dubbedAudio = adaptive_formats.find(i => + checkBestAudio(i) && i["language"] === o.dubLang && i["audio_track"] && !i["audio_track"].audio_is_default + ); if (dubbedAudio) { audio = dubbedAudio; isDubbed = true