diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-06-07 15:33:45 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-06-07 15:35:13 +0200 |
commit | d5519808235997db2189e840bf87c89693a208cc (patch) | |
tree | b114bc77bd9d4b4648d3adc965eb3ed2a3ad4d11 /youtube_dl/YoutubeDL.py | |
parent | 4e0fb1280a8c1b392e5ce71aff796c94a12976a0 (diff) |
[spiegeltv] Simplify and PEP8
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 9 |
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'] |