diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index a6de6edad6512..fe8fe0ff8f3ec 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -596,7 +596,14 @@ export default defineComponent({ /** @type {import('youtubei.js').Misc.Format[][]} */ const sourceLists = [] - audioFormats.forEach(format => { + for (const format of audioFormats) { + // Some videos with multiple audio tracks, have a broken one, that doesn't have any audio track information + // It seems to be the same as default audio track but broken + // At the time of writing, this video has a broken audio track: https://youtu.be/UJeSWbR6W04 + if (!format.audio_track) { + continue + } + const index = ids.indexOf(format.audio_track.id) if (index === -1) { ids.push(format.audio_track.id) @@ -628,7 +635,7 @@ export default defineComponent({ } else { sourceLists[index].push(format) } - }) + } for (let i = 0; i < audioTracks.length; i++) { audioTracks[i].sourceList = this.createLocalAudioSourceList(sourceLists[i])