Browse Source

Merge pull request #5376 from PeteHemery/ffmpeg-postproc-utime-bug

[ffmpeg] adding exception catching for call to os.utime in run_ffmpeg_multiple_files
Sergey M. 10 years ago
parent
commit
bca788ab1d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      youtube_dl/postprocessor/ffmpeg.py

+ 5 - 1
youtube_dl/postprocessor/ffmpeg.py

@@ -146,7 +146,11 @@ class FFmpegPostProcessor(PostProcessor):
             stderr = stderr.decode('utf-8', 'replace')
             msg = stderr.strip().split('\n')[-1]
             raise FFmpegPostProcessorError(msg)
-        os.utime(encodeFilename(out_path), (oldest_mtime, oldest_mtime))
+        try:
+            os.utime(encodeFilename(out_path), (oldest_mtime, oldest_mtime))
+        except Exception:
+            self._downloader.report_warning('Cannot update utime of file')
+
         if self._deletetempfiles:
             for ipath in input_paths:
                 os.remove(ipath)