A feature-rich command-line audio/video downloader
[EmbedSubtitle, SubtitlesConvertor] Fix error when subtitle file is missing Closes #1152, #1134 Bug from 8e25d624df003d691be922488d6ab7007f75333d
pukkandana1c396730705
diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.pyindex 311170920c..6bb66569ae 100644--- a/yt_dlp/postprocessor/ffmpeg.py+++ b/yt_dlp/postprocessor/ffmpeg.py@@ -555,7 +555,7 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):mp4_ass_warn = Falsefor lang, sub_info in subtitles.items():- if not os.path.exists(information.get('filepath', '')):+ if not os.path.exists(sub_info.get('filepath', '')):self.report_warning(f'Skipping embedding {lang} subtitle because the file is missing')continuesub_ext = sub_info['ext']@@ -845,6 +845,9 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):self.to_screen('Converting subtitles')sub_filenames = []for lang, sub in subs.items():+ if not os.path.exists(sub.get('filepath', '')):+ self.report_warning(f'Skipping embedding {lang} subtitle because the file is missing')+ continueext = sub['ext']if ext == new_ext:self.to_screen('Subtitle file for %s is already in the requested format' % new_ext)