mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-06 22:46:07 +02:00
[YoutubeDL] add fallback value for thumbnails values in thumbnails sorting
This commit is contained in:
parent
f39ffc5877
commit
75fa990dc6
@ -1256,8 +1256,8 @@ def process_video_result(self, info_dict, download=True):
|
|||||||
info_dict['thumbnails'] = thumbnails = [{'url': thumbnail}]
|
info_dict['thumbnails'] = thumbnails = [{'url': thumbnail}]
|
||||||
if thumbnails:
|
if thumbnails:
|
||||||
thumbnails.sort(key=lambda t: (
|
thumbnails.sort(key=lambda t: (
|
||||||
t.get('preference'), t.get('width'), t.get('height'),
|
t.get('preference') or -1, t.get('width') or -1, t.get('height') or -1,
|
||||||
t.get('id'), t.get('url')))
|
t.get('id') or '', t.get('url')))
|
||||||
for i, t in enumerate(thumbnails):
|
for i, t in enumerate(thumbnails):
|
||||||
t['url'] = sanitize_url(t['url'])
|
t['url'] = sanitize_url(t['url'])
|
||||||
if t.get('width') and t.get('height'):
|
if t.get('width') and t.get('height'):
|
||||||
|
Loading…
Reference in New Issue
Block a user