1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 16:57:40 +00:00

Corrected a small error

This commit is contained in:
Andrea Lazzaretti 2021-04-13 13:36:49 +02:00
parent 437f1dc159
commit f4aa8c13b5

View file

@ -2428,17 +2428,18 @@ class YoutubeDL(object):
if self.params.get('writethumbnail', False): if self.params.get('writethumbnail', False):
thumbnails = info_dict.get('thumbnails') thumbnails = info_dict.get('thumbnails')
thumbnailformat = self.params.get('thumbnailformat', False) thumbnailformat = self.params.get('thumbnailformat', False)
if thumbnailformat: if thumbnails:
if thumbnailformat in [i.get('id') for i in thumbnails]: if thumbnailformat:
thumbnails = [i for i in thumbnails if i.get('id')==thumbnailformat] if thumbnailformat in [i.get('id') for i in thumbnails]:
thumbnails = [i for i in thumbnails if i.get('id')==thumbnailformat]
else:
self.report_warning(
'Thumbnail ID unavailable, falling back to default.'
' Check available thumbnail formats with the option --list-thumbnails'
)
thumbnails = [thumbnails[-1]]
else: else:
self.report_warning(
'Thumbnail ID unavailable, falling back to default.'
' Check available thumbnail formats with the option --list-thumbnails'
)
thumbnails = [thumbnails[-1]] thumbnails = [thumbnails[-1]]
else:
thumbnails = [thumbnails[-1]]
elif self.params.get('write_all_thumbnails', False): elif self.params.get('write_all_thumbnails', False):
thumbnails = info_dict.get('thumbnails') thumbnails = info_dict.get('thumbnails')
else: else: