aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-11-04 05:02:31 +0700
committerSergey M․ <dstftw@gmail.com>2016-11-04 05:02:31 +0700
commitc4c9b8440cd19838a1ef283cc54ebf0630905698 (patch)
treefbd4585b9b82f95238cdc3765b6604dc36d69523 /youtube_dl/extractor/common.py
parent32f2627aed68ed2981f438067252b9921c4a39fe (diff)
[extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes #11113)
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 50841f0cf..5f4c984a9 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1280,9 +1280,10 @@ class InfoExtractor(object):
}
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'])