From 96e8661dcdc915f02a056be12b01795f1c9d7243 Mon Sep 17 00:00:00 2001 From: NewUserHa <32261870+NewUserHa@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:18:14 +0800 Subject: [PATCH] Update YoutubeDL.py --- yt_dlp/YoutubeDL.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 3bf8cb42d2..492017ba74 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -3467,15 +3467,14 @@ def run_pp(self, pp, infodict): return infodict raise + if pp.PP_NAME = 'SubtitlesConvertor' and self.params.get('keepintermediate', False) == 'ConvertSubs': + files_to_delete = [] + if not files_to_delete: return infodict if self.params.get('keepvideo', False): for f in files_to_delete: infodict['__files_to_move'].setdefault(f, '') - elif self.params.get('keepsubs', False): - for f in files_to_delete: - if f.endswith('.vtt'): - infodict['__files_to_move'].setdefault(f, '') else: self._delete_downloaded_files( *files_to_delete, info=infodict, msg='Deleting original file %s (pass -k to keep)')