diff options
author | remitamine <remitamine@gmail.com> | 2016-04-30 20:49:09 +0100 |
---|---|---|
committer | remitamine <remitamine@gmail.com> | 2016-04-30 20:51:32 +0100 |
commit | 93f7a31bf3b572a98982a380ae3167ce954adc04 (patch) | |
tree | 996c1cd88fbe0b849a7cbc314ece826d32a36418 /youtube_dl/extractor | |
parent | 33a1ec950c97b03e742926f3d37e9aa4ce642633 (diff) |
[discovery] extract subtitle
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/discovery.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/discovery.py b/youtube_dl/extractor/discovery.py index 6d1f8e670..87fb29b02 100644 --- a/youtube_dl/extractor/discovery.py +++ b/youtube_dl/extractor/discovery.py @@ -114,6 +114,16 @@ class DiscoveryIE(InfoExtractor): 'tbr': q, }) self._sort_formats(formats) + + subtitles = [] + caption_url = video_info.get('captionsUrl') + if caption_url: + subtitles = { + 'en': [{ + 'url': caption_url, + }] + } + entries.append({ 'id': compat_str(video_info['id']), 'formats': formats, @@ -124,6 +134,7 @@ class DiscoveryIE(InfoExtractor): 'thumbnail': video_info.get('thumbnailURL'), 'alt_title': video_info.get('secondary_title'), 'timestamp': parse_iso8601(video_info.get('publishedDate')), + 'subtitles': subtitles, }) return self.playlist_result(entries, display_id, video_title) |