mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes #11113)
This commit is contained in:
parent
32f2627aed
commit
c4c9b8440c
1 changed files with 4 additions and 3 deletions
|
@ -1280,9 +1280,10 @@ def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
|
|||
}
|
||||
resolution = last_info.get('RESOLUTION')
|
||||
if resolution:
|
||||
width_str, height_str = resolution.split('x')
|
||||
f['width'] = int(width_str)
|
||||
f['height'] = int(height_str)
|
||||
mobj = re.search(r'(?P<width>\d+)[xX](?P<height>\d+)', resolution)
|
||||
if mobj:
|
||||
f['width'] = int(mobj.group('width'))
|
||||
f['height'] = int(mobj.group('height'))
|
||||
# Unified Streaming Platform
|
||||
mobj = re.search(
|
||||
r'audio.*?(?:%3D|=)(\d+)(?:-video.*?(?:%3D|=)(\d+))?', f['url'])
|
||||
|
|
Loading…
Reference in a new issue