projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8cc83d3
)
check if key attrib matches resolution pattern
author
kennell
<kevin@fileperms.org>
Sun, 18 Oct 2015 19:07:52 +0000
(21:07 +0200)
committer
kennell
<kevin@fileperms.org>
Sun, 18 Oct 2015 19:07:52 +0000
(21:07 +0200)
youtube_dl/extractor/zdf.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/zdf.py
b/youtube_dl/extractor/zdf.py
index d41c4e712f1ae2aa7e34eb2f59b4afe8aa3fd506..ed385450cf28ad25185c0d590bca77c2a9092e0b 100644
(file)
--- 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:
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
thumbnails.append(thumbnail)
return thumbnails