Browse Source
[extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes #11113)
master
Sergey M․
8 years ago
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with
4 additions and
3 deletions
-
youtube_dl/extractor/common.py
|
@ -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') |
|
|
|
|
|
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 |
|
|
# 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']) |
|
|