1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-21 21:02:52 +08:00

[generic] Do not download images as videos by accident

This commit is contained in:
Philipp Hagemeister 2014-08-27 02:07:11 +02:00
parent 3f514a353e
commit 1cb6dcdbbe

View File

@ -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)))