Don't try to save the thumbnail if it's None
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 12 Jul 2013 20:11:59 +0000 (22:11 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 12 Jul 2013 20:11:59 +0000 (22:11 +0200)
It means the extractor couldn't find it

youtube_dl/YoutubeDL.py

index cc5f761577cf946dd6824663c76bc298bb71fe23..c76f1118ee54e66df89d52e09cc85c80914c5f75 100644 (file)
@@ -529,7 +529,7 @@ class YoutubeDL(object):
                 return
 
         if self.params.get('writethumbnail', False):
-            if 'thumbnail' in info_dict:
+            if info_dict.get('thumbnail') is not None:
                 thumb_format = determine_ext(info_dict['thumbnail'], u'jpg')
                 thumb_filename = filename.rpartition('.')[0] + u'.' + thumb_format
                 self.to_screen(u'[%s] %s: Downloading thumbnail ...' %