mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-24 20:25:52 +01:00
[YoutubeDL] check only for None Value in thumbnails sorting
This commit is contained in:
parent
5c13c28566
commit
d37708fc86
@ -1256,8 +1256,10 @@ def process_video_result(self, info_dict, download=True):
|
||||
info_dict['thumbnails'] = thumbnails = [{'url': thumbnail}]
|
||||
if thumbnails:
|
||||
thumbnails.sort(key=lambda t: (
|
||||
t.get('preference') or -1, t.get('width') or -1, t.get('height') or -1,
|
||||
t.get('id') or '', t.get('url')))
|
||||
t.get('preference') if t.get('preference') is not None else -1,
|
||||
t.get('width') if t.get('width') is not None else -1,
|
||||
t.get('height') if t.get('height') is not None else -1,
|
||||
t.get('id') if t.get('id') is not None else '', t.get('url')))
|
||||
for i, t in enumerate(thumbnails):
|
||||
t['url'] = sanitize_url(t['url'])
|
||||
if t.get('width') and t.get('height'):
|
||||
|
Loading…
Reference in New Issue
Block a user