From 8e25d624df003d691be922488d6ab7007f75333d Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 1 Sep 2021 08:45:56 +0530 Subject: [PATCH] [EmbedSubtitle] Continue even if some files are missing --- yt_dlp/postprocessor/ffmpeg.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index b66a0b445..7537d5db4 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -478,6 +478,9 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor): mp4_ass_warn = False for lang, sub_info in subtitles.items(): + if not os.path.exists(information.get('filepath', '')): + self.report_warning(f'Skipping embedding {lang} subtitle because the file is missing') + continue sub_ext = sub_info['ext'] if sub_ext == 'json': self.report_warning('JSON subtitles cannot be embedded')