mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
youtube: ignore formats with missing content length
This commit is contained in:
parent
840bdf35b7
commit
d7a3a7cac4
@ -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' };
|
||||
|
Loading…
x
Reference in New Issue
Block a user