From ae419aa94fc16f4b55fe8b61159f66e085ae5b8b Mon Sep 17 00:00:00 2001 From: Nil Admirari <50202386+nihil-admirari@users.noreply.github.com> Date: Thu, 17 Feb 2022 17:10:34 +0000 Subject: [Sponsorblock] minor fixes (#2793) * preserve mtime - Closes #2769 * keep concat spec on failure Authored by: nihil-admirari --- yt_dlp/postprocessor/modify_chapters.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'yt_dlp/postprocessor/modify_chapters.py') diff --git a/yt_dlp/postprocessor/modify_chapters.py b/yt_dlp/postprocessor/modify_chapters.py index 435a144e2..22506bc21 100644 --- a/yt_dlp/postprocessor/modify_chapters.py +++ b/yt_dlp/postprocessor/modify_chapters.py @@ -68,9 +68,11 @@ class ModifyChaptersPP(FFmpegPostProcessor): # Renaming should only happen after all files are processed files_to_remove = [] for in_file, out_file in in_out_files: + mtime = os.stat(in_file).st_mtime uncut_file = prepend_extension(in_file, 'uncut') os.replace(in_file, uncut_file) os.replace(out_file, in_file) + self.try_utime(in_file, mtime, mtime) files_to_remove.append(uncut_file) return files_to_remove, info -- cgit v1.2.3