From ec57f903c907bf8c48c9cd3eea75e6dadb855595 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 15 Nov 2020 04:18:39 +0530 Subject: [PATCH] Don't try to delete file if it doesn't exist --- youtube_dlc/postprocessor/embedthumbnail.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dlc/postprocessor/embedthumbnail.py b/youtube_dlc/postprocessor/embedthumbnail.py index a7d53d7f5..2ff3cff69 100644 --- a/youtube_dlc/postprocessor/embedthumbnail.py +++ b/youtube_dlc/postprocessor/embedthumbnail.py @@ -91,7 +91,8 @@ def is_webp(path): elif info['ext'] == 'mkv': old_thumbnail_filename = thumbnail_filename thumbnail_filename = os.path.join(os.path.dirname(old_thumbnail_filename), 'cover.jpg') - os.remove(encodeFilename(thumbnail_filename)) + if os.path.exists(thumbnail_filename): + os.remove(encodeFilename(thumbnail_filename)) os.rename(encodeFilename(old_thumbnail_filename), encodeFilename(thumbnail_filename)) options = [