projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d862042
)
[YoutubeDL] Calculate thumbnail IDs automatically
author
Philipp Hagemeister
<phihag@phihag.de>
Tue, 3 Feb 2015 09:52:22 +0000
(10:52 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Tue, 3 Feb 2015 09:52:22 +0000
(10:52 +0100)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index c18ce9660711c7845b36e34285042d54a13f5072..1730df4cd40b174404168ed73f4438e6d02d2847 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-964,9
+964,11
@@
class YoutubeDL(object):
thumbnails.sort(key=lambda t: (
t.get('preference'), t.get('width'), t.get('height'),
t.get('id'), t.get('url')))
- for
t in thumbnails
:
+ for
i, t in enumerate(thumbnails)
:
if 'width' in t and 'height' in t:
t['resolution'] = '%dx%d' % (t['width'], t['height'])
+ if t.get('id') is None:
+ t['id'] = '%d' % i
if thumbnails and 'thumbnail' not in info_dict:
info_dict['thumbnail'] = thumbnails[-1]['url']