diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index ac12be9333..b1af458702 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1135,7 +1135,7 @@ def _parse_smil_formats(self, smil, smil_url, video_id, namespace=None, f4m_para return formats - def _parse_smil_subtitles(self, smil, namespace=None): + def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'): subtitles = {} for num, textstream in enumerate(smil.findall(self._xpath_ns('.//textstream', namespace))): src = textstream.get('src') @@ -1146,7 +1146,7 @@ def _parse_smil_subtitles(self, smil, namespace=None): type_ = textstream.get('type') if type_ == 'text/srt': ext = 'srt' - lang = textstream.get('systemLanguage') or textstream.get('systemLanguageName') + lang = textstream.get('systemLanguage') or textstream.get('systemLanguageName') or subtitles_lang subtitles.setdefault(lang, []).append({ 'url': src, 'ext': ext,