mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-01 10:47:30 +01:00
[discovery] extract subtitle
This commit is contained in:
parent
33a1ec950c
commit
93f7a31bf3
@ -114,6 +114,16 @@ def _real_extract(self, url):
|
|||||||
'tbr': q,
|
'tbr': q,
|
||||||
})
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
subtitles = []
|
||||||
|
caption_url = video_info.get('captionsUrl')
|
||||||
|
if caption_url:
|
||||||
|
subtitles = {
|
||||||
|
'en': [{
|
||||||
|
'url': caption_url,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
'id': compat_str(video_info['id']),
|
'id': compat_str(video_info['id']),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
@ -124,6 +134,7 @@ def _real_extract(self, url):
|
|||||||
'thumbnail': video_info.get('thumbnailURL'),
|
'thumbnail': video_info.get('thumbnailURL'),
|
||||||
'alt_title': video_info.get('secondary_title'),
|
'alt_title': video_info.get('secondary_title'),
|
||||||
'timestamp': parse_iso8601(video_info.get('publishedDate')),
|
'timestamp': parse_iso8601(video_info.get('publishedDate')),
|
||||||
|
'subtitles': subtitles,
|
||||||
})
|
})
|
||||||
|
|
||||||
return self.playlist_result(entries, display_id, video_title)
|
return self.playlist_result(entries, display_id, video_title)
|
||||||
|
Loading…
Reference in New Issue
Block a user