mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-29 01:44:42 +01:00
[srf] Extract subtitles
This commit is contained in:
parent
355c524bfa
commit
820b064804
@ -83,6 +83,16 @@ def _real_extract(self, url):
|
||||
|
||||
self._sort_formats(formats)
|
||||
|
||||
subtitles = {}
|
||||
subtitles_data = video_data.find('Subtitles')
|
||||
if subtitles_data is not None:
|
||||
subtitles_list = [{
|
||||
'url': sub.text,
|
||||
'ext': determine_ext(sub.text),
|
||||
} for sub in subtitles_data]
|
||||
if subtitles_list:
|
||||
subtitles['de'] = subtitles_list
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'display_id': display_id,
|
||||
@ -90,4 +100,5 @@ def _real_extract(self, url):
|
||||
'title': title,
|
||||
'thumbnails': thumbnails,
|
||||
'timestamp': timestamp,
|
||||
'subtitles': subtitles,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user