From: Sergey M․ Date: Thu, 3 Nov 2016 22:02:31 +0000 (+0700) Subject: [extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes... X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=c4c9b8440cd19838a1ef283cc54ebf0630905698;p=youtube-dl.git [extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes #11113) --- 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\d+)[xX](?P\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'])