diff options
author | Tom-Oliver Heidel <github@tom-oliver.eu> | 2020-11-30 02:30:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 02:30:20 +0100 |
commit | 6248b34ad2e4375235ef4cb94d6c56b6dd442702 (patch) | |
tree | 1796bdeecc7ff6b3f9761335981f7fd8b8200200 | |
parent | 8e423ae86a43fed87d6976294810f8e038a78a17 (diff) | |
parent | ec57f903c907bf8c48c9cd3eea75e6dadb855595 (diff) | |
download | hypervideo-pre-6248b34ad2e4375235ef4cb94d6c56b6dd442702.tar.lz hypervideo-pre-6248b34ad2e4375235ef4cb94d6c56b6dd442702.tar.xz hypervideo-pre-6248b34ad2e4375235ef4cb94d6c56b6dd442702.zip |
Merge pull request #207 from pukkandan/thumbnail-rename
[ffmpeg] Fix for os.rename error when embedding thumbnail to video in a different drive on windows
-rw-r--r-- | youtube_dlc/postprocessor/embedthumbnail.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dlc/postprocessor/embedthumbnail.py b/youtube_dlc/postprocessor/embedthumbnail.py index 7ca0ce6e5..e9f2161a0 100644 --- a/youtube_dlc/postprocessor/embedthumbnail.py +++ b/youtube_dlc/postprocessor/embedthumbnail.py @@ -89,9 +89,11 @@ class EmbedThumbnailPP(FFmpegPostProcessor): os.rename(encodeFilename(temp_filename), encodeFilename(filename)) elif info['ext'] == 'mkv': - os.rename(encodeFilename(thumbnail_filename), encodeFilename('cover.jpg')) old_thumbnail_filename = thumbnail_filename - thumbnail_filename = 'cover.jpg' + thumbnail_filename = os.path.join(os.path.dirname(old_thumbnail_filename), 'cover.jpg') + if os.path.exists(thumbnail_filename): + os.remove(encodeFilename(thumbnail_filename)) + os.rename(encodeFilename(old_thumbnail_filename), encodeFilename(thumbnail_filename)) options = [ '-c', 'copy', '-map', '0', |