mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[radiocanada] extract subtitle(closes #11096)
This commit is contained in:
parent
cc99a77ac1
commit
4f9cd4d36f
1 changed files with 9 additions and 0 deletions
|
@ -125,6 +125,14 @@ def get_meta(name):
|
||||||
f4m_id='hds', fatal=False))
|
f4m_id='hds', fatal=False))
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
subtitles = {}
|
||||||
|
closed_caption_url = get_meta('closedCaption') or get_meta('closedCaptionHTML5')
|
||||||
|
if closed_caption_url:
|
||||||
|
subtitles['fr'] = [{
|
||||||
|
'url': closed_caption_url,
|
||||||
|
'ext': determine_ext(closed_caption_url, 'vtt'),
|
||||||
|
}]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': get_meta('Title'),
|
'title': get_meta('Title'),
|
||||||
|
@ -135,6 +143,7 @@ def get_meta(name):
|
||||||
'season_number': int_or_none('SrcSaison'),
|
'season_number': int_or_none('SrcSaison'),
|
||||||
'episode_number': int_or_none('SrcEpisode'),
|
'episode_number': int_or_none('SrcEpisode'),
|
||||||
'upload_date': unified_strdate(get_meta('Date')),
|
'upload_date': unified_strdate(get_meta('Date')),
|
||||||
|
'subtitles': subtitles,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue