Explorar o código

[generic] Do not download images as videos by accident

Philipp Hagemeister %!s(int64=11) %!d(string=hai) anos
pai
achega
1cb6dcdbbe
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      youtube_dl/extractor/generic.py

+ 2 - 1
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)))