projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
32f2627
)
[extractor/common] Tolerate malformed RESOLUTION attribute in m3u8 manifests (closes...
author
Sergey M․
<dstftw@gmail.com>
Thu, 3 Nov 2016 22:02:31 +0000
(
05:02
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 3 Nov 2016 22:02:31 +0000
(
05:02
+0700)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 50841f0cf936b4c00cc6e384bbe62cc204c7bf4c..5f4c984a9db08612c6bc240bd543a77e739cfcfd 100644
(file)
--- 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:
}
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'])
# Unified Streaming Platform
mobj = re.search(
r'audio.*?(?:%3D|=)(\d+)(?:-video.*?(?:%3D|=)(\d+))?', f['url'])