mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-26 20:22:14 +00:00
[francetv] Add subtitles support
This commit is contained in:
parent
cd08d806b1
commit
5dadae079b
1 changed files with 11 additions and 0 deletions
|
@ -83,6 +83,16 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
|
||||||
if subtitle:
|
if subtitle:
|
||||||
title += ' - %s' % 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 {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
@ -91,6 +101,7 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
|
||||||
'duration': int_or_none(info.get('real_duration')) or parse_duration(info['duree']),
|
'duration': int_or_none(info.get('real_duration')) or parse_duration(info['duree']),
|
||||||
'timestamp': int_or_none(info['diffusion']['timestamp']),
|
'timestamp': int_or_none(info['diffusion']['timestamp']),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue