From d7a3a7cac45d585f6ffc7d298e91175bdc0fc2a1 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Mon, 13 May 2024 16:54:00 +0000 Subject: [PATCH] youtube: ignore formats with missing content length --- src/modules/processing/services/youtube.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/processing/services/youtube.js b/src/modules/processing/services/youtube.js index ff4ea0ae..10b04a5c 100644 --- a/src/modules/processing/services/youtube.js +++ b/src/modules/processing/services/youtube.js @@ -66,8 +66,8 @@ export default async function(o) { adaptive_formats = filterByCodec(info.streaming_data.adaptive_formats) } - bestQuality = adaptive_formats.find(i => i.has_video); - hasAudio = adaptive_formats.find(i => i.has_audio); + bestQuality = adaptive_formats.find(i => i.has_video && i.content_length); + hasAudio = adaptive_formats.find(i => i.has_audio && i.content_length); if (bestQuality) bestQuality = qual(bestQuality); if (!bestQuality && !o.isAudioOnly || !hasAudio) return { error: 'ErrorYTTryOtherCodec' };