0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-27 03:03:01 +00:00

[dplay] Extract subtitles (Closes #9284)

This commit is contained in:
Sergey M․ 2016-04-23 16:50:31 +06:00
parent fd0ff8bad8
commit e239413fbc
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -129,6 +129,13 @@ def extract_formats(protocol, manifest_url):
self._sort_formats(formats) self._sort_formats(formats)
subtitles = {}
for lang in ('se', 'sv', 'da', 'nl', 'no'):
for format_id in ('web_vtt', 'vtt', 'srt'):
subtitle_url = info.get('subtitles_%s_%s' % (lang, format_id))
if subtitle_url:
subtitles.setdefault(lang, []).append({'url': subtitle_url})
return { return {
'id': video_id, 'id': video_id,
'display_id': display_id, 'display_id': display_id,
@ -142,4 +149,5 @@ def extract_formats(protocol, manifest_url):
'episode_number': int_or_none(info.get('episode')), 'episode_number': int_or_none(info.get('episode')),
'age_limit': int_or_none(info.get('minimum_age')), 'age_limit': int_or_none(info.get('minimum_age')),
'formats': formats, 'formats': formats,
'subtitles': subtitles,
} }