mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
Remove known invalid thumbnails from info_dict
Related: https://github.com/yt-dlp/yt-dlp/issues/980#issuecomment-997396821
This commit is contained in:
parent
37e57a9fd4
commit
dd0228ce1f
1 changed files with 2 additions and 1 deletions
|
@ -3685,7 +3685,7 @@ def _write_thumbnails(self, label, info_dict, filename, thumb_filename_base=None
|
||||||
self.write_debug(f'Skipping writing {label} thumbnail')
|
self.write_debug(f'Skipping writing {label} thumbnail')
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
for t in thumbnails[::-1]:
|
for idx, t in list(enumerate(thumbnails))[::-1]:
|
||||||
thumb_ext = (f'{t["id"]}.' if multiple else '') + determine_ext(t['url'], 'jpg')
|
thumb_ext = (f'{t["id"]}.' if multiple else '') + determine_ext(t['url'], 'jpg')
|
||||||
thumb_display_id = f'{label} thumbnail {t["id"]}'
|
thumb_display_id = f'{label} thumbnail {t["id"]}'
|
||||||
thumb_filename = replace_extension(filename, thumb_ext, info_dict.get('ext'))
|
thumb_filename = replace_extension(filename, thumb_ext, info_dict.get('ext'))
|
||||||
|
@ -3706,6 +3706,7 @@ def _write_thumbnails(self, label, info_dict, filename, thumb_filename_base=None
|
||||||
ret.append((thumb_filename, thumb_filename_final))
|
ret.append((thumb_filename, thumb_filename_final))
|
||||||
t['filepath'] = thumb_filename
|
t['filepath'] = thumb_filename
|
||||||
except network_exceptions as err:
|
except network_exceptions as err:
|
||||||
|
thumbnails.pop(idx)
|
||||||
self.report_warning(f'Unable to download {thumb_display_id}: {err}')
|
self.report_warning(f'Unable to download {thumb_display_id}: {err}')
|
||||||
if ret and not write_all:
|
if ret and not write_all:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue