mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-03 08:19:57 +01:00
[Sponsorblock] minor fixes (#2793)
* preserve mtime - Closes #2769 * keep concat spec on failure Authored by: nihil-admirari
This commit is contained in:
parent
ac184ab742
commit
ae419aa94f
@ -384,12 +384,10 @@ def concat_files(self, in_files, out_file, concat_opts=None):
|
|||||||
|
|
||||||
out_flags = list(self.stream_copy_opts(ext=determine_ext(out_file)))
|
out_flags = list(self.stream_copy_opts(ext=determine_ext(out_file)))
|
||||||
|
|
||||||
try:
|
self.real_run_ffmpeg(
|
||||||
self.real_run_ffmpeg(
|
[(concat_file, ['-hide_banner', '-nostdin', '-f', 'concat', '-safe', '0'])],
|
||||||
[(concat_file, ['-hide_banner', '-nostdin', '-f', 'concat', '-safe', '0'])],
|
[(out_file, out_flags)])
|
||||||
[(out_file, out_flags)])
|
os.remove(concat_file)
|
||||||
finally:
|
|
||||||
os.remove(concat_file)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _concat_spec(cls, in_files, concat_opts=None):
|
def _concat_spec(cls, in_files, concat_opts=None):
|
||||||
|
@ -68,9 +68,11 @@ def remove_chapters(file, is_sub):
|
|||||||
# Renaming should only happen after all files are processed
|
# Renaming should only happen after all files are processed
|
||||||
files_to_remove = []
|
files_to_remove = []
|
||||||
for in_file, out_file in in_out_files:
|
for in_file, out_file in in_out_files:
|
||||||
|
mtime = os.stat(in_file).st_mtime
|
||||||
uncut_file = prepend_extension(in_file, 'uncut')
|
uncut_file = prepend_extension(in_file, 'uncut')
|
||||||
os.replace(in_file, uncut_file)
|
os.replace(in_file, uncut_file)
|
||||||
os.replace(out_file, in_file)
|
os.replace(out_file, in_file)
|
||||||
|
self.try_utime(in_file, mtime, mtime)
|
||||||
files_to_remove.append(uncut_file)
|
files_to_remove.append(uncut_file)
|
||||||
|
|
||||||
return files_to_remove, info
|
return files_to_remove, info
|
||||||
|
Loading…
Reference in New Issue
Block a user