aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-08-20 00:56:17 +0600
committerSergey M․ <dstftw@gmail.com>2015-08-20 00:56:17 +0600
commitce00af87670d47f4dff6ad80e46a29e49cbdfe4f (patch)
tree01e9ed9e8c18cb96d2a3f6f290ae14964d072562 /youtube_dl/extractor/common.py
parent51047444aa6516b0062a3320625f67e3d4fe51d2 (diff)
downloadyoutube-dl-ce00af87670d47f4dff6ad80e46a29e49cbdfe4f.tar.xz
[extractor/common] Add default subtitles lang
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index ac12be933..b1af45870 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1135,7 +1135,7 @@ class InfoExtractor(object):
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 @@ class InfoExtractor(object):
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,