mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-23 00:54:31 +01:00
FFmpegMergerPP: use the new system for specifying which files can be delete
This commit is contained in:
parent
14523ed969
commit
d47aeb2252
@ -1361,7 +1361,7 @@ class YoutubeDL(object):
|
|||||||
if info_dict.get('requested_formats') is not None:
|
if info_dict.get('requested_formats') is not None:
|
||||||
downloaded = []
|
downloaded = []
|
||||||
success = True
|
success = True
|
||||||
merger = FFmpegMergerPP(self, not self.params.get('keepvideo'))
|
merger = FFmpegMergerPP(self)
|
||||||
if not merger.available:
|
if not merger.available:
|
||||||
postprocessors = []
|
postprocessors = []
|
||||||
self.report_warning('You have requested multiple '
|
self.report_warning('You have requested multiple '
|
||||||
|
@ -28,9 +28,8 @@ class FFmpegPostProcessorError(PostProcessingError):
|
|||||||
|
|
||||||
|
|
||||||
class FFmpegPostProcessor(PostProcessor):
|
class FFmpegPostProcessor(PostProcessor):
|
||||||
def __init__(self, downloader=None, deletetempfiles=False):
|
def __init__(self, downloader=None):
|
||||||
PostProcessor.__init__(self, downloader)
|
PostProcessor.__init__(self, downloader)
|
||||||
self._deletetempfiles = deletetempfiles
|
|
||||||
self._determine_executables()
|
self._determine_executables()
|
||||||
|
|
||||||
def check_version(self):
|
def check_version(self):
|
||||||
@ -148,10 +147,6 @@ class FFmpegPostProcessor(PostProcessor):
|
|||||||
raise FFmpegPostProcessorError(msg)
|
raise FFmpegPostProcessorError(msg)
|
||||||
self.try_utime(out_path, oldest_mtime, oldest_mtime)
|
self.try_utime(out_path, oldest_mtime, oldest_mtime)
|
||||||
|
|
||||||
if self._deletetempfiles:
|
|
||||||
for ipath in input_paths:
|
|
||||||
os.remove(ipath)
|
|
||||||
|
|
||||||
def run_ffmpeg(self, path, out_path, opts):
|
def run_ffmpeg(self, path, out_path, opts):
|
||||||
self.run_ffmpeg_multiple_files([path], out_path, opts)
|
self.run_ffmpeg_multiple_files([path], out_path, opts)
|
||||||
|
|
||||||
@ -588,7 +583,7 @@ class FFmpegMergerPP(FFmpegPostProcessor):
|
|||||||
args = ['-c', 'copy', '-map', '0:v:0', '-map', '1:a:0']
|
args = ['-c', 'copy', '-map', '0:v:0', '-map', '1:a:0']
|
||||||
self._downloader.to_screen('[ffmpeg] Merging formats into "%s"' % filename)
|
self._downloader.to_screen('[ffmpeg] Merging formats into "%s"' % filename)
|
||||||
self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args)
|
self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args)
|
||||||
return [], info
|
return info['__files_to_merge'], info
|
||||||
|
|
||||||
|
|
||||||
class FFmpegAudioFixPP(FFmpegPostProcessor):
|
class FFmpegAudioFixPP(FFmpegPostProcessor):
|
||||||
|
Loading…
Reference in New Issue
Block a user