mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 01:02:48 +01:00
[francetv] Add subtitles support
This commit is contained in:
parent
cd08d806b1
commit
5dadae079b
@ -83,6 +83,16 @@ def _extract_video(self, video_id, catalogue):
|
||||
if subtitle:
|
||||
title += ' - %s' % subtitle
|
||||
|
||||
subtitles = {}
|
||||
for subtitle_accessibilite in info['subtitles']:
|
||||
if subtitle_accessibilite['url'] is not '':
|
||||
if not subtitles:
|
||||
subtitles['fr'] = []
|
||||
subtitles['fr'].append({
|
||||
'ext': subtitle_accessibilite['format'],
|
||||
'url': subtitle_accessibilite['url'],
|
||||
})
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
@ -91,6 +101,7 @@ def _extract_video(self, video_id, catalogue):
|
||||
'duration': int_or_none(info.get('real_duration')) or parse_duration(info['duree']),
|
||||
'timestamp': int_or_none(info['diffusion']['timestamp']),
|
||||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user