mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 18:17:17 -05:00
[ie/twitter] Extract bitrate for HLS audio formats (#9257)
Closes #9202 Authored by: bashonly
This commit is contained in:
parent
f591e605df
commit
28e53d60df
@ -100,9 +100,13 @@ class TwitterBaseIE(InfoExtractor):
|
|||||||
if not variant_url:
|
if not variant_url:
|
||||||
return [], {}
|
return [], {}
|
||||||
elif '.m3u8' in variant_url:
|
elif '.m3u8' in variant_url:
|
||||||
return self._extract_m3u8_formats_and_subtitles(
|
fmts, subs = self._extract_m3u8_formats_and_subtitles(
|
||||||
variant_url, video_id, 'mp4', 'm3u8_native',
|
variant_url, video_id, 'mp4', 'm3u8_native',
|
||||||
m3u8_id='hls', fatal=False)
|
m3u8_id='hls', fatal=False)
|
||||||
|
for f in traverse_obj(fmts, lambda _, v: v['vcodec'] == 'none' and v.get('tbr') is None):
|
||||||
|
if mobj := re.match(r'hls-[Aa]udio-(?P<bitrate>\d{4,})', f['format_id']):
|
||||||
|
f['tbr'] = int_or_none(mobj.group('bitrate'), 1000)
|
||||||
|
return fmts, subs
|
||||||
else:
|
else:
|
||||||
tbr = int_or_none(dict_get(variant, ('bitrate', 'bit_rate')), 1000) or None
|
tbr = int_or_none(dict_get(variant, ('bitrate', 'bit_rate')), 1000) or None
|
||||||
f = {
|
f = {
|
||||||
|
Loading…
Reference in New Issue
Block a user