'url': format_url,
})
self._sort_formats(formats)
+
+ subtitles = {}
+ for target in data['subtitleUrls']:
+ format_url, format_type = target.get('url'), target.get('type')
+ if format_type == 'CLOSED':
+ subtitles['nl'] = [{
+ 'ext': 'vtt',
+ 'url': format_url,
+ }]
return {
'id': video_id,
'formats': formats,
'duration': float_or_none(data.get('duration'), 1000),
'thumbnail': data.get('posterImageUrl'),
+ 'subtitles': subtitles,
}