summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-08-27 02:07:11 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-08-27 02:07:11 +0200
commit1cb6dcdbbe357da3abab9dcc1f2d57ff73f1835d (patch)
tree20d483701caa387729bf703faf1318082a93a6d7
parent3f514a353eea34760508dea6fc8cb6c8e00ec342 (diff)
downloadyoutube-dl-1cb6dcdbbe357da3abab9dcc1f2d57ff73f1835d.tar.gz
youtube-dl-1cb6dcdbbe357da3abab9dcc1f2d57ff73f1835d.tar.xz
youtube-dl-1cb6dcdbbe357da3abab9dcc1f2d57ff73f1835d.zip
[generic] Do not download images as videos by accident
-rw-r--r--youtube_dl/extractor/generic.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index 3a908d01f..6622df81e 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -830,7 +830,8 @@ class GenericIE(InfoExtractor):
             if m_video_type is not None:
                 def check_video(vurl):
                     vpath = compat_urlparse.urlparse(vurl).path
-                    return '.' in vpath and not vpath.endswith('.swf')
+                    vext = determine_ext(vpath)
+                    return '.' in vpath and vext not in ('swf', 'png', 'jpg')
                 found = list(filter(
                     check_video,
                     re.findall(r'<meta.*?property="og:video".*?content="(.*?)"', webpage)))