瀏覽代碼

[vimeo] Improve thumbnail extraction

Sergey M. 11 年之前
父節點
當前提交
c0e5d85631
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      youtube_dl/extractor/vimeo.py

+ 4 - 2
youtube_dl/extractor/vimeo.py

@@ -220,8 +220,10 @@ class VimeoIE(SubtitlesInfoExtractor):
 
         # Extract video thumbnail
         video_thumbnail = config["video"].get("thumbnail")
-        if video_thumbnail is None and config["video"].get("thumbs"):
-            _, video_thumbnail = sorted((int(width), t_url) for (width, t_url) in config["video"]["thumbs"].items())[-1]
+        if video_thumbnail is None:
+            video_thumbs = config["video"].get("thumbs")
+            if video_thumbs and isinstance(video_thumbs, dict):
+                _, video_thumbnail = sorted((int(width), t_url) for (width, t_url) in video_thumbs.items())[-1]
 
         # Extract video description
         video_description = None