diff options
author | Remita Amine <remitamine@gmail.com> | 2016-08-25 08:46:54 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2016-08-25 08:49:44 +0100 |
commit | 75fa990dc669563b51f22eeddd2f33acc41c8599 (patch) | |
tree | 0fceab12f3d65c63bbbb65aaa89ecf9133f1cc2b | |
parent | f39ffc5877e4e9f112fa26ff21079f179b4aec46 (diff) |
[YoutubeDL] add fallback value for thumbnails values in thumbnails sorting
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 0b3e3da82..c499c1da4 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1256,8 +1256,8 @@ class YoutubeDL(object): info_dict['thumbnails'] = thumbnails = [{'url': thumbnail}] if thumbnails: thumbnails.sort(key=lambda t: ( - t.get('preference'), t.get('width'), t.get('height'), - t.get('id'), t.get('url'))) + t.get('preference') or -1, t.get('width') or -1, t.get('height') or -1, + t.get('id') or '', t.get('url'))) for i, t in enumerate(thumbnails): t['url'] = sanitize_url(t['url']) if t.get('width') and t.get('height'): |