1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-23 00:07:49 +00:00

Merge remote-tracking branch 'ivan/muxed-mtime'

This commit is contained in:
Philipp Hagemeister 2015-01-10 06:10:18 +01:00
commit 43bc88903d

View file

@ -82,12 +82,14 @@ class FFmpegPostProcessor(PostProcessor):
def run_ffmpeg_multiple_files(self, input_paths, out_path, opts): def run_ffmpeg_multiple_files(self, input_paths, out_path, opts):
self.check_version() self.check_version()
oldest_mtime = min(os.stat(path).st_mtime for path in input_paths)
files_cmd = [] files_cmd = []
for path in input_paths: for path in input_paths:
files_cmd.extend([encodeArgument('-i'), encodeFilename(path, True)]) files_cmd.extend([encodeArgument('-i'), encodeFilename(path, True)])
cmd = ([encodeFilename(self._executable, True), encodeArgument('-y')] + cmd = ([encodeFilename(self._executable, True), encodeArgument('-y')] +
files_cmd files_cmd +
+ [encodeArgument(o) for o in opts] + [encodeArgument(o) for o in opts] +
[encodeFilename(self._ffmpeg_filename_argument(out_path), True)]) [encodeFilename(self._ffmpeg_filename_argument(out_path), True)])
if self._downloader.params.get('verbose', False): if self._downloader.params.get('verbose', False):
@ -98,6 +100,7 @@ class FFmpegPostProcessor(PostProcessor):
stderr = stderr.decode('utf-8', 'replace') stderr = stderr.decode('utf-8', 'replace')
msg = stderr.strip().split('\n')[-1] msg = stderr.strip().split('\n')[-1]
raise FFmpegPostProcessorError(msg) raise FFmpegPostProcessorError(msg)
os.utime(out_path, (oldest_mtime, oldest_mtime))
if self._deletetempfiles: if self._deletetempfiles:
for ipath in input_paths: for ipath in input_paths:
os.remove(ipath) os.remove(ipath)