aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/postprocessor/ffmpeg.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-12-27 03:18:11 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-12-27 03:18:31 +0530
commit6a176775778da34d89fde17afdf380f07f6f2d16 (patch)
tree5c3dfbdb2909c8eb0e1a93c2240ad04512349cd1 /yt_dlp/postprocessor/ffmpeg.py
parentee7b9bdf5d7d5f9a4716aa193b0b1887a229d2ea (diff)
downloadhypervideo-pre-6a176775778da34d89fde17afdf380f07f6f2d16.tar.lz
hypervideo-pre-6a176775778da34d89fde17afdf380f07f6f2d16.tar.xz
hypervideo-pre-6a176775778da34d89fde17afdf380f07f6f2d16.zip
[ThumbnailsConvertor] Fix for when there are no thumbnails
Closes #2125
Diffstat (limited to 'yt_dlp/postprocessor/ffmpeg.py')
-rw-r--r--yt_dlp/postprocessor/ffmpeg.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py
index 222560a7c..96b48ded5 100644
--- a/yt_dlp/postprocessor/ffmpeg.py
+++ b/yt_dlp/postprocessor/ffmpeg.py
@@ -1092,12 +1092,12 @@ class FFmpegThumbnailsConvertorPP(FFmpegPostProcessor):
files_to_delete = []
has_thumbnail = False
- for idx, thumbnail_dict in enumerate(info['thumbnails']):
- if 'filepath' not in thumbnail_dict:
+ for idx, thumbnail_dict in enumerate(info.get('thumbnails') or []):
+ original_thumbnail = thumbnail_dict.get('filepath')
+ if not original_thumbnail:
continue
has_thumbnail = True
self.fixup_webp(info, idx)
- original_thumbnail = thumbnail_dict['filepath']
_, thumbnail_ext = os.path.splitext(original_thumbnail)
if thumbnail_ext:
thumbnail_ext = thumbnail_ext[1:].lower()