fix for youtube dubs rare error

This commit is contained in:
wukko 2023-10-15 22:13:01 +06:00
parent 3a4f8ef31b
commit 73d84c09d3

View file

@ -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