[FFmpegSubtitlesConvertorPP] correctly update the extension (fixes #8444)
[youtube-dl] / youtube_dl / postprocessor / ffmpeg.py
index 22d7ac65ac6fe6e0aedc4c91a101fb8272b9dd97..05f2f06234d117a096d81eb01b482c85efad452e 100644 (file)
@@ -508,6 +508,7 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
 
                 with io.open(srt_file, 'wt', encoding='utf-8') as f:
                     f.write(srt_data)
+                old_file = srt_file
 
                 ext = 'srt'
                 subs[lang] = {
@@ -522,7 +523,7 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
 
             with io.open(new_file, 'rt', encoding='utf-8') as f:
                 subs[lang] = {
-                    'ext': ext,
+                    'ext': new_ext,
                     'data': f.read(),
                 }