about summary refs log tree commit diff
path: root/youtube_dl/extractor/lecturio.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-12-11 23:45:02 +0700
committerSergey M․ <dstftw@gmail.com>2018-12-11 23:45:02 +0700
commit0a05cfabb6338be750474a7286ce0d72a4d7c142 (patch)
tree3c4314e1bcfa46626310f8412217e74cabfeca72 /youtube_dl/extractor/lecturio.py
parent13e17cd28e7f9e3bd8be4fa7b073a5cb96f5959f (diff)
downloadyoutube-dl-0a05cfabb6338be750474a7286ce0d72a4d7c142.tar.gz
youtube-dl-0a05cfabb6338be750474a7286ce0d72a4d7c142.tar.xz
youtube-dl-0a05cfabb6338be750474a7286ce0d72a4d7c142.zip
[lecturio] Improve subtitles extraction (closes #18488)
Diffstat (limited to 'youtube_dl/extractor/lecturio.py')
-rw-r--r--youtube_dl/extractor/lecturio.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube_dl/extractor/lecturio.py b/youtube_dl/extractor/lecturio.py
index 62ff28e02..0f1265cdf 100644
--- a/youtube_dl/extractor/lecturio.py
+++ b/youtube_dl/extractor/lecturio.py
@@ -136,9 +136,15 @@ class LecturioIE(LecturioBaseIE):
             cc_url = url_or_none(cc_url)
             if not cc_url:
                 continue
-            sub_dict = automatic_captions if 'auto-translated' in cc_label else subtitles
             lang = self._search_regex(
-                r'/([a-z]{2})_', cc_url, 'lang', default=cc_label.split()[0])
+                r'/([a-z]{2})_', cc_url, 'lang',
+                default=cc_label.split()[0] if cc_label else 'en')
+            original_lang = self._search_regex(
+                r'/[a-z]{2}_([a-z]{2})_', cc_url, 'original lang',
+                default=None)
+            sub_dict = (automatic_captions
+                        if 'auto-translated' in cc_label or original_lang
+                        else subtitles)
             sub_dict.setdefault(self._CC_LANGS.get(lang, lang), []).append({
                 'url': cc_url,
             })