aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/postprocessor/embedthumbnail.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2020-11-15 04:18:39 +0530
committerpukkandan <pukkandan@gmail.com>2020-11-15 04:19:22 +0530
commitec57f903c907bf8c48c9cd3eea75e6dadb855595 (patch)
tree8fe99610b0ccc42ee0af705859bec1001fd67de6 /youtube_dlc/postprocessor/embedthumbnail.py
parent55faba7ed77abad9dfe00bf850b9f8c4b04b036d (diff)
downloadhypervideo-pre-ec57f903c907bf8c48c9cd3eea75e6dadb855595.tar.lz
hypervideo-pre-ec57f903c907bf8c48c9cd3eea75e6dadb855595.tar.xz
hypervideo-pre-ec57f903c907bf8c48c9cd3eea75e6dadb855595.zip
Don't try to delete file if it doesn't exist
Diffstat (limited to 'youtube_dlc/postprocessor/embedthumbnail.py')
-rw-r--r--youtube_dlc/postprocessor/embedthumbnail.py3
1 files changed, 2 insertions, 1 deletions
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 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
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 = [