diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-01 04:58:26 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-01 04:58:26 +0530 |
commit | 43d7f5a5d0c77556156a3f8caa6976d3908a1e38 (patch) | |
tree | 6d21b8cd24a50524f58a180700b7b8a805d92a36 /yt_dlp/postprocessor/embedthumbnail.py | |
parent | 94aa064497122084c68f5f366c4c0ad5ea082485 (diff) |
[EmbedThumbnail] Do not obey `-k`
Diffstat (limited to 'yt_dlp/postprocessor/embedthumbnail.py')
-rw-r--r-- | yt_dlp/postprocessor/embedthumbnail.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/yt_dlp/postprocessor/embedthumbnail.py b/yt_dlp/postprocessor/embedthumbnail.py index 207be776e..d36e0008e 100644 --- a/yt_dlp/postprocessor/embedthumbnail.py +++ b/yt_dlp/postprocessor/embedthumbnail.py @@ -220,11 +220,9 @@ class EmbedThumbnailPP(FFmpegPostProcessor): os.replace(temp_filename, filename) self.try_utime(filename, mtime, mtime) - - files_to_delete = [thumbnail_filename] - if self._already_have_thumbnail: - if original_thumbnail == thumbnail_filename: - files_to_delete = [] - elif original_thumbnail != thumbnail_filename: - files_to_delete.append(original_thumbnail) - return files_to_delete, info + converted = original_thumbnail != thumbnail_filename + self._delete_downloaded_files( + thumbnail_filename if converted or not self._already_have_thumbnail else None, + original_thumbnail if converted and not self._already_have_thumbnail else None, + info=info) + return [], info |