aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorkennell <kevin@fileperms.org>2015-10-18 21:07:52 +0200
committerkennell <kevin@fileperms.org>2015-10-18 21:07:52 +0200
commitb243340f0ce311443a15a2dfd4356a9504e18c04 (patch)
tree68435863ea20ea6782d12aa0bcd99c10b8b327fe /youtube_dl
parent8cc83d301dd0e8029aff804e362860d36e3d7e7a (diff)
check if key attrib matches resolution pattern
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/zdf.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/extractor/zdf.py b/youtube_dl/extractor/zdf.py
index d41c4e712..ed385450c 100644
--- a/youtube_dl/extractor/zdf.py
+++ b/youtube_dl/extractor/zdf.py
@@ -75,9 +75,9 @@ def extract_from_xml_url(ie, video_id, xml_url):
for node in fnode:
thumbnail = {'url': node.text}
if 'key' in node.attrib:
- width_x_height = node.attrib['key']
- thumbnail['width'] = int_or_none(width_x_height.split('x')[0])
- thumbnail['height'] = int_or_none(width_x_height.split('x')[1])
+ if re.match("^[0-9]+x[0-9]+$", node.attrib['key']):
+ thumbnail['width'] = int_or_none(node.attrib['key'].split('x')[0])
+ thumbnail['height'] = int_or_none(node.attrib['key'].split('x')[1])
thumbnails.append(thumbnail)
return thumbnails