logo

youtube-dl

[mirror] Download/Watch videos from video hosters
commit: 75fa990dc669563b51f22eeddd2f33acc41c8599
parent f39ffc5877e4e9f112fa26ff21079f179b4aec46
Author: Remita Amine <remitamine@gmail.com>
Date:   Thu, 25 Aug 2016 08:46:54 +0100

[YoutubeDL] add fallback value for thumbnails values in thumbnails sorting

Diffstat:

Myoutube_dl/YoutubeDL.py4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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'):