1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 22:17:14 +08:00

take --keep-video option into account

Unfortunately, we cannot simply return False from FFmpegConcatPP.run() because
the current post_process() function merely deletes the specified filename.
For this to work properly, the postprocessor should be able to specify the
files it wants to delete alongside the flag to delete them.
This commit is contained in:
Anthony Weems 2014-05-02 03:32:44 -05:00
parent 15818d4e21
commit 76adb9074a

View File

@ -501,8 +501,10 @@ class FFmpegConcatPP(FFmpegPostProcessor):
args = ['-f', 'concat', '-i', '-', '-c', 'copy'] args = ['-f', 'concat', '-i', '-', '-c', 'copy']
self._downloader.to_screen(u'[ffmpeg] Concatenating files into "%s"' % filename) self._downloader.to_screen(u'[ffmpeg] Concatenating files into "%s"' % filename)
self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args, via_stdin=True) self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args, via_stdin=True)
for path in info['__files_to_merge']: if self._downloader.params.get('keepvideo', False) is False:
os.remove(encodeFilename(path)) for path in info['__files_to_merge']:
self._downloader.to_screen('Deleting original file %s (pass -k to keep)' % filename)
os.remove(encodeFilename(path))
return True, info return True, info
class FFmpegAudioFixPP(FFmpegPostProcessor): class FFmpegAudioFixPP(FFmpegPostProcessor):