From 43d7f5a5d0c77556156a3f8caa6976d3908a1e38 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 1 May 2022 04:58:26 +0530 Subject: [EmbedThumbnail] Do not obey `-k` --- yt_dlp/postprocessor/embedthumbnail.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'yt_dlp/postprocessor/embedthumbnail.py') 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 -- cgit v1.2.3