瀏覽代碼

Don't try to save the thumbnail if it's None

It means the extractor couldn't find it
Jaime Marquínez Ferrándiz 12 年之前
父節點
當前提交
d8269e1dfb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/YoutubeDL.py

+ 1 - 1
youtube_dl/YoutubeDL.py

@@ -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 ...' %