From 6d60db88cddb87d220adaff2f51ab55beff51993 Mon Sep 17 00:00:00 2001 From: kikuyan Date: Tue, 3 Aug 2021 09:16:51 +0900 Subject: [PATCH] [postprocessor/ffmpeg] embed subtitles in --sub-lang order --- youtube_dl/postprocessor/ffmpeg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index 9f76c9d4e..160f21d66 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -392,7 +392,10 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor): sub_filenames = [] webm_vtt_warn = False - for lang, sub_info in subtitles.items(): + for lang in (self._downloader.params.get('subtitleslangs') or subtitles): + sub_info = subtitles.get(lang) + if not sub_info: + continue sub_ext = sub_info['ext'] if ext != 'webm' or ext == 'webm' and sub_ext == 'vtt': sub_langs.append(lang)