mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-10-29 09:26:20 -07:00 
			
		
		
		
	[postprocessor/common:postprocessor/ffmpeg] Generalize utime
This commit is contained in:
		| @@ -1,6 +1,11 @@ | ||||
| from __future__ import unicode_literals | ||||
|  | ||||
| from ..utils import PostProcessingError | ||||
| import os | ||||
|  | ||||
| from ..utils import ( | ||||
|     PostProcessingError, | ||||
|     encodeFilename, | ||||
| ) | ||||
|  | ||||
|  | ||||
| class PostProcessor(object): | ||||
| @@ -46,6 +51,12 @@ class PostProcessor(object): | ||||
|         """ | ||||
|         return None, information  # by default, keep file and do nothing | ||||
|  | ||||
|     def try_utime(self, path, atime, mtime, errnote='Cannot update utime of file'): | ||||
|         try: | ||||
|             os.utime(encodeFilename(path), (atime, mtime)) | ||||
|         except Exception: | ||||
|             self._downloader.report_warning(errnote) | ||||
|  | ||||
|  | ||||
| class AudioConversionError(PostProcessingError): | ||||
|     pass | ||||
|   | ||||
		Reference in New Issue
	
	Block a user