mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-25 03:32:05 +00:00
[vimeo] extract VHX subtitles
This commit is contained in:
parent
ca01d17884
commit
d9df8f120b
1 changed files with 12 additions and 0 deletions
|
@ -1127,6 +1127,17 @@ class VHXEmbedIE(InfoExtractor):
|
||||||
video_data = self._call_api(video_id, access_token)
|
video_data = self._call_api(video_id, access_token)
|
||||||
title = video_data.get('title') or video_data['name']
|
title = video_data.get('title') or video_data['name']
|
||||||
|
|
||||||
|
subtitles = {}
|
||||||
|
for subtitle in try_get(video_data, lambda x: x['tracks']['subtitles'], list) or []:
|
||||||
|
lang = subtitle.get('srclang') or subtitle.get('label')
|
||||||
|
for _link in subtitle.get('_links', {}).values():
|
||||||
|
href = _link.get('href')
|
||||||
|
if not href:
|
||||||
|
continue
|
||||||
|
subtitles.setdefault(lang, []).append({
|
||||||
|
'url': href,
|
||||||
|
})
|
||||||
|
|
||||||
q = qualities(['small', 'medium', 'large', 'source'])
|
q = qualities(['small', 'medium', 'large', 'source'])
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
for thumbnail_id, thumbnail_url in video_data.get('thumbnail', {}).items():
|
for thumbnail_id, thumbnail_url in video_data.get('thumbnail', {}).items():
|
||||||
|
@ -1142,6 +1153,7 @@ class VHXEmbedIE(InfoExtractor):
|
||||||
'description': video_data.get('description'),
|
'description': video_data.get('description'),
|
||||||
'duration': int_or_none(try_get(video_data, lambda x: x['duration']['seconds'])),
|
'duration': int_or_none(try_get(video_data, lambda x: x['duration']['seconds'])),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
'thumbnails': thumbnails,
|
'thumbnails': thumbnails,
|
||||||
'timestamp': unified_timestamp(video_data.get('created_at')),
|
'timestamp': unified_timestamp(video_data.get('created_at')),
|
||||||
'view_count': int_or_none(video_data.get('plays_count')),
|
'view_count': int_or_none(video_data.get('plays_count')),
|
||||||
|
|
Loading…
Reference in a new issue