mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-14 10:55:15 +00: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…
Reference in a new issue