mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 02:14:32 +01:00
[extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes #11113)
This commit is contained in:
parent
32f2627aed
commit
c4c9b8440c
@ -1280,9 +1280,10 @@ class InfoExtractor(object):
|
|||||||
}
|
}
|
||||||
resolution = last_info.get('RESOLUTION')
|
resolution = last_info.get('RESOLUTION')
|
||||||
if resolution:
|
if resolution:
|
||||||
width_str, height_str = resolution.split('x')
|
mobj = re.search(r'(?P<width>\d+)[xX](?P<height>\d+)', resolution)
|
||||||
f['width'] = int(width_str)
|
if mobj:
|
||||||
f['height'] = int(height_str)
|
f['width'] = int(mobj.group('width'))
|
||||||
|
f['height'] = int(mobj.group('height'))
|
||||||
# Unified Streaming Platform
|
# Unified Streaming Platform
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'audio.*?(?:%3D|=)(\d+)(?:-video.*?(?:%3D|=)(\d+))?', f['url'])
|
r'audio.*?(?:%3D|=)(\d+)(?:-video.*?(?:%3D|=)(\d+))?', f['url'])
|
||||||
|
Loading…
Reference in New Issue
Block a user