projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[limelight] Extract ttml subtitles (Closes #9739)
[youtube-dl]
/
youtube_dl
/
extractor
/
limelight.py
diff --git
a/youtube_dl/extractor/limelight.py
b/youtube_dl/extractor/limelight.py
index da5d198b99a1edf6eb621191cdbcd6eafaf61150..5d2c3e256740d865e1c0be2c8e2808a9ee97ee43 100644
(file)
--- a/
youtube_dl/extractor/limelight.py
+++ b/
youtube_dl/extractor/limelight.py
@@
-98,13
+98,19
@@
class LimelightBaseIE(InfoExtractor):
} for thumbnail in properties.get('thumbnails', []) if thumbnail.get('url')]
subtitles = {}
} for thumbnail in properties.get('thumbnails', []) if thumbnail.get('url')]
subtitles = {}
- for caption in properties.get('captions',
{}
):
+ for caption in properties.get('captions',
[]
):
lang = caption.get('language_code')
subtitles_url = caption.get('url')
if lang and subtitles_url:
lang = caption.get('language_code')
subtitles_url = caption.get('url')
if lang and subtitles_url:
- subtitles
[lang] = [
{
+ subtitles
.setdefault(lang, []).append(
{
'url': subtitles_url,
'url': subtitles_url,
- }]
+ })
+ closed_captions_url = properties.get('closed_captions_url')
+ if closed_captions_url:
+ subtitles.setdefault('en', []).append({
+ 'url': closed_captions_url,
+ 'ext': 'ttml',
+ })
return {
'id': video_id,
return {
'id': video_id,