[vimeo] Improve thumbnail extraction
authorSergey M. <dstftw@gmail.com>
Fri, 28 Feb 2014 11:00:12 +0000 (18:00 +0700)
committerSergey M. <dstftw@gmail.com>
Fri, 28 Feb 2014 11:00:12 +0000 (18:00 +0700)
youtube_dl/extractor/vimeo.py

index ec6aad592054a9bcec0000877cb739c232a00eb9..10c3d992d5716c689fe142a99581a46629700524 100644 (file)
@@ -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