aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-11-02 13:55:40 +0100
committerRemita Amine <remitamine@gmail.com>2016-11-02 13:55:40 +0100
commit4f9cd4d36fa88758cdff822f03879c6e0b6aa42d (patch)
treeabc836d74c18ca7b29d9be9657df4ae8f84917ee
parentcc99a77ac1c5fb5859d75589d49bb25361a1fb2b (diff)
[radiocanada] extract subtitle(closes #11096)
-rw-r--r--youtube_dl/extractor/radiocanada.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/youtube_dl/extractor/radiocanada.py b/youtube_dl/extractor/radiocanada.py
index 6751270ee..321917ad0 100644
--- a/youtube_dl/extractor/radiocanada.py
+++ b/youtube_dl/extractor/radiocanada.py
@@ -125,6 +125,14 @@ class RadioCanadaIE(InfoExtractor):
f4m_id='hds', fatal=False))
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 {
'id': video_id,
'title': get_meta('Title'),
@@ -135,6 +143,7 @@ class RadioCanadaIE(InfoExtractor):
'season_number': int_or_none('SrcSaison'),
'episode_number': int_or_none('SrcEpisode'),
'upload_date': unified_strdate(get_meta('Date')),
+ 'subtitles': subtitles,
'formats': formats,
}