mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 16:32:51 +01:00
[extractor/youtube] Bypass throttling for -f17
and related cleanup Thanks @AudricV for the finding
This commit is contained in:
parent
c376b95f95
commit
2d1655493f
|
@ -3766,13 +3766,11 @@ def _extract_formats_and_subtitles(self, streaming_data, video_id, player_url, l
|
||||||
if mime_mobj:
|
if mime_mobj:
|
||||||
dct['ext'] = mimetype2ext(mime_mobj.group(1))
|
dct['ext'] = mimetype2ext(mime_mobj.group(1))
|
||||||
dct.update(parse_codecs(mime_mobj.group(2)))
|
dct.update(parse_codecs(mime_mobj.group(2)))
|
||||||
no_audio = dct.get('acodec') == 'none'
|
|
||||||
no_video = dct.get('vcodec') == 'none'
|
single_stream = 'none' in (dct.get('acodec'), dct.get('vcodec'))
|
||||||
if no_audio:
|
if single_stream and dct.get('ext'):
|
||||||
dct['vbr'] = tbr
|
dct['container'] = dct['ext'] + '_dash'
|
||||||
if no_video:
|
if single_stream or itag == '17':
|
||||||
dct['abr'] = tbr
|
|
||||||
if no_audio or no_video:
|
|
||||||
CHUNK_SIZE = 10 << 20
|
CHUNK_SIZE = 10 << 20
|
||||||
dct.update({
|
dct.update({
|
||||||
'protocol': 'http_dash_segments',
|
'protocol': 'http_dash_segments',
|
||||||
|
@ -3781,13 +3779,10 @@ def _extract_formats_and_subtitles(self, streaming_data, video_id, player_url, l
|
||||||
'range': f'{range_start}-{min(range_start + CHUNK_SIZE - 1, dct["filesize"])}'
|
'range': f'{range_start}-{min(range_start + CHUNK_SIZE - 1, dct["filesize"])}'
|
||||||
})
|
})
|
||||||
} for range_start in range(0, dct['filesize'], CHUNK_SIZE)]
|
} for range_start in range(0, dct['filesize'], CHUNK_SIZE)]
|
||||||
} if dct['filesize'] else {
|
} if itag != '17' and dct['filesize'] else {
|
||||||
'downloader_options': {'http_chunk_size': CHUNK_SIZE} # No longer useful?
|
'downloader_options': {'http_chunk_size': CHUNK_SIZE}
|
||||||
})
|
})
|
||||||
|
|
||||||
if dct.get('ext'):
|
|
||||||
dct['container'] = dct['ext'] + '_dash'
|
|
||||||
|
|
||||||
if itag:
|
if itag:
|
||||||
itags[itag].add(('https', dct.get('language')))
|
itags[itag].add(('https', dct.get('language')))
|
||||||
stream_ids.append(stream_id)
|
stream_ids.append(stream_id)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user