aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/postprocessor/ffmpeg.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-04-08 21:40:31 +0600
committerSergey M․ <dstftw@gmail.com>2015-04-08 21:40:31 +0600
commitdd29eb7f816bae7cf7807db9f26b7f5621b8d557 (patch)
tree380122c090495d6c63caec01fa02ebb066a9c30d /youtube_dl/postprocessor/ffmpeg.py
parentbca788ab1d477abfc29edb29480075ed10cace25 (diff)
[postprocessor/common:postprocessor/ffmpeg] Generalize utime
Diffstat (limited to 'youtube_dl/postprocessor/ffmpeg.py')
-rw-r--r--youtube_dl/postprocessor/ffmpeg.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py
index 5ef5e0e54..8e99a3c2c 100644
--- a/youtube_dl/postprocessor/ffmpeg.py
+++ b/youtube_dl/postprocessor/ffmpeg.py
@@ -146,10 +146,7 @@ class FFmpegPostProcessor(PostProcessor):
stderr = stderr.decode('utf-8', 'replace')
msg = stderr.strip().split('\n')[-1]
raise FFmpegPostProcessorError(msg)
- try:
- os.utime(encodeFilename(out_path), (oldest_mtime, oldest_mtime))
- except Exception:
- self._downloader.report_warning('Cannot update utime of file')
+ self.try_utime(out_path, oldest_mtime, oldest_mtime)
if self._deletetempfiles:
for ipath in input_paths:
@@ -284,10 +281,9 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
# Try to update the date time for extracted audio file.
if information.get('filetime') is not None:
- try:
- os.utime(encodeFilename(new_path), (time.time(), information['filetime']))
- except Exception:
- self._downloader.report_warning('Cannot update utime of audio file')
+ self.try_utime(
+ new_path, time.time(), information['filetime'],
+ errnote='Cannot update utime of audio file')
information['filepath'] = new_path
return self._nopostoverwrites, information