mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 03:42:14 +01:00
youtube: ignore formats with missing content length
This commit is contained in:
parent
840bdf35b7
commit
d7a3a7cac4
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue