]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[radiocanada] extract subtitle(closes #11096)
authorRemita Amine <remitamine@gmail.com>
Wed, 2 Nov 2016 12:55:40 +0000 (13:55 +0100)
committerRemita Amine <remitamine@gmail.com>
Wed, 2 Nov 2016 12:55:40 +0000 (13:55 +0100)
youtube_dl/extractor/radiocanada.py

index 6751270ee3cc550b74fb114febbeac6952bb91b7..321917ad0810c6ddfe1d8586ba31570251fe012e 100644 (file)
@@ -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,
         }