[ie/youtube] Fix `dashy` formats extraction (#14852)

Fix 6224a38988

Closes #14850
Authored by: bashonly
pull/12078/merge
bashonly 1 month ago committed by GitHub
parent cacd1630a1
commit c0c9f30695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3261,15 +3261,6 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if live_status not in ('is_live', 'post_live'):
fmt['available_at'] = available_at
if (all_formats or 'dashy' in format_types) and fmt['filesize']:
https_fmts.append({
**fmt,
'format_id': f'{fmt["format_id"]}-dashy' if all_formats else fmt['format_id'],
'protocol': 'http_dash_segments',
'fragments': build_fragments(fmt),
})
if all_formats or 'dashy' not in format_types:
fmt['downloader_options'] = {'http_chunk_size': CHUNK_SIZE}
https_fmts.append(fmt)
# Bulk process sig/n handling
@ -3346,7 +3337,17 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if fmt in https_fmts:
https_fmts.remove(fmt)
yield from https_fmts
for fmt in https_fmts:
if (all_formats or 'dashy' in format_types) and fmt['filesize']:
yield {
**fmt,
'format_id': f'{fmt["format_id"]}-dashy' if all_formats else fmt['format_id'],
'protocol': 'http_dash_segments',
'fragments': build_fragments(fmt),
}
if all_formats or 'dashy' not in format_types:
fmt['downloader_options'] = {'http_chunk_size': CHUNK_SIZE}
yield fmt
yield from process_https_formats()

Loading…
Cancel
Save