mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-14 21:49:39 +00:00
[ie/vimeo] Fix HLS audio format sorting (#11082)
Closes #10854 Authored by: fireattack
This commit is contained in:
parent
c08e0b20b5
commit
a1b4ac2b8e
@ -21,6 +21,7 @@ from ..utils import (
|
|||||||
parse_filesize,
|
parse_filesize,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
parse_qs,
|
parse_qs,
|
||||||
|
qualities,
|
||||||
smuggle_url,
|
smuggle_url,
|
||||||
str_or_none,
|
str_or_none,
|
||||||
traverse_obj,
|
traverse_obj,
|
||||||
@ -146,6 +147,8 @@ class VimeoBaseInfoExtractor(InfoExtractor):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# TODO: fix handling of 308 status code returned for live archive manifest requests
|
# TODO: fix handling of 308 status code returned for live archive manifest requests
|
||||||
|
QUALITIES = ('low', 'medium', 'high')
|
||||||
|
quality = qualities(QUALITIES)
|
||||||
sep_pattern = r'/sep/video/'
|
sep_pattern = r'/sep/video/'
|
||||||
for files_type in ('hls', 'dash'):
|
for files_type in ('hls', 'dash'):
|
||||||
for cdn_name, cdn_data in (try_get(config_files, lambda x: x[files_type]['cdns']) or {}).items():
|
for cdn_name, cdn_data in (try_get(config_files, lambda x: x[files_type]['cdns']) or {}).items():
|
||||||
@ -166,6 +169,11 @@ class VimeoBaseInfoExtractor(InfoExtractor):
|
|||||||
m_url, video_id, 'mp4', live=is_live, m3u8_id=f_id,
|
m_url, video_id, 'mp4', live=is_live, m3u8_id=f_id,
|
||||||
note=f'Downloading {cdn_name} m3u8 information',
|
note=f'Downloading {cdn_name} m3u8 information',
|
||||||
fatal=False)
|
fatal=False)
|
||||||
|
# m3u8 doesn't give audio bitrates; need to prioritize based on GROUP-ID
|
||||||
|
# See: https://github.com/yt-dlp/yt-dlp/issues/10854
|
||||||
|
for f in fmts:
|
||||||
|
if mobj := re.search(rf'audio-({"|".join(QUALITIES)})', f['format_id']):
|
||||||
|
f['quality'] = quality(mobj.group(1))
|
||||||
formats.extend(fmts)
|
formats.extend(fmts)
|
||||||
self._merge_subtitles(subs, target=subtitles)
|
self._merge_subtitles(subs, target=subtitles)
|
||||||
elif files_type == 'dash':
|
elif files_type == 'dash':
|
||||||
|
Loading…
Reference in New Issue
Block a user