aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-03-14 21:53:54 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-03-14 21:56:04 +0530
commitca87974543e3409a8a2bcd720305a0094ab4cf9a (patch)
tree058e0fe28d7728a972e49537496bd1ba6d978b38
parente92caff5d50e60bfd33563d631f0c49ce176dc70 (diff)
downloadhypervideo-pre-ca87974543e3409a8a2bcd720305a0094ab4cf9a.tar.lz
hypervideo-pre-ca87974543e3409a8a2bcd720305a0094ab4cf9a.tar.xz
hypervideo-pre-ca87974543e3409a8a2bcd720305a0094ab4cf9a.zip
[embedthumbnail] Set mtime correctly
Related: https://github.com/yt-dlp/yt-dlp/issues/67
-rw-r--r--yt_dlp/postprocessor/embedthumbnail.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/yt_dlp/postprocessor/embedthumbnail.py b/yt_dlp/postprocessor/embedthumbnail.py
index 3c68e0298..82e7e2004 100644
--- a/yt_dlp/postprocessor/embedthumbnail.py
+++ b/yt_dlp/postprocessor/embedthumbnail.py
@@ -85,6 +85,8 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
thumbnail_filename = thumbnail_jpg_filename
thumbnail_ext = 'jpg'
+ mtime = os.stat(encodeFilename(filename)).st_mtime
+
success = True
if info['ext'] == 'mp3':
options = [
@@ -187,6 +189,8 @@ class EmbedThumbnailPP(FFmpegPostProcessor):
os.remove(encodeFilename(filename))
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
+ self.try_utime(filename, mtime, mtime)
+
files_to_delete = [thumbnail_filename]
if self._already_have_thumbnail:
info['__files_to_move'][original_thumbnail] = replace_extension(