FFmpegEmbedSubtitlePP: remove the subtitle files if '--keep-video' is not given ...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 18 Apr 2015 09:44:42 +0000 (11:44 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 18 Apr 2015 09:44:42 +0000 (11:44 +0200)
youtube_dl/postprocessor/ffmpeg.py

index 4cdbfce63ec04f35990c06642698809817ed863f..852dc3e4410d75494cb5c6516a785313c91a4a8a 100644 (file)
@@ -513,7 +513,8 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
 
         sub_langs = list(subtitles.keys())
         filename = information['filepath']
-        input_files = [filename] + [subtitles_filename(filename, lang, sub_info['ext']) for lang, sub_info in subtitles.items()]
+        sub_filenames = [subtitles_filename(filename, lang, sub_info['ext']) for lang, sub_info in subtitles.items()]
+        input_files = [filename] + sub_filenames
 
         opts = [
             '-map', '0',
@@ -535,7 +536,7 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
         os.remove(encodeFilename(filename))
         os.rename(encodeFilename(temp_filename), encodeFilename(filename))
 
-        return [], information
+        return sub_filenames, information
 
 
 class FFmpegMetadataPP(FFmpegPostProcessor):