aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-06-07 15:33:45 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-06-07 15:35:13 +0200
commitd5519808235997db2189e840bf87c89693a208cc (patch)
treeb114bc77bd9d4b4648d3adc965eb3ed2a3ad4d11 /youtube_dl/YoutubeDL.py
parent4e0fb1280a8c1b392e5ce71aff796c94a12976a0 (diff)
downloadyoutube-dl-d5519808235997db2189e840bf87c89693a208cc.tar.xz
[spiegeltv] Simplify and PEP8
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index f3666573a..455c0a7b0 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -717,6 +717,15 @@ class YoutubeDL(object):
info_dict['playlist'] = None
info_dict['playlist_index'] = None
+ thumbnails = info_dict.get('thumbnails')
+ if thumbnails:
+ for t in thumbnails:
+ if 'width' in t and 'height' in t:
+ t['resolution'] = '%dx%d' % (t['width'], t['height'])
+
+ if thumbnails and 'thumbnail' not in info_dict:
+ info_dict['thumbnail'] = thumbnails[-1]['url']
+
if 'display_id' not in info_dict and 'id' in info_dict:
info_dict['display_id'] = info_dict['id']