projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
13e17cd
)
[lecturio] Improve subtitles extraction (closes #18488)
author
Sergey M․
<dstftw@gmail.com>
Tue, 11 Dec 2018 16:45:02 +0000
(23:45 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Tue, 11 Dec 2018 16:45:02 +0000
(23:45 +0700)
youtube_dl/extractor/lecturio.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/lecturio.py
b/youtube_dl/extractor/lecturio.py
index 62ff28e028b2443fcbfe74da821daa33481844d9..0f1265cdfc93e5387fa6d7458d0fde3162880980 100644
(file)
--- 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
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(
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,
})
sub_dict.setdefault(self._CC_LANGS.get(lang, lang), []).append({
'url': cc_url,
})