]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[orf] add subtitles support(closes #10939)
authorRemita Amine <remitamine@gmail.com>
Wed, 19 Oct 2016 10:34:15 +0000 (11:34 +0100)
committerRemita Amine <remitamine@gmail.com>
Wed, 19 Oct 2016 10:34:46 +0000 (11:34 +0100)
youtube_dl/extractor/orf.py

index c7b1075725222842fbdad5cc300011e440824a0a..b4cce7ea9334c7bbaf9e617932189504dcd25121 100644 (file)
@@ -115,12 +115,22 @@ class ORFTVthekIE(InfoExtractor):
             self._check_formats(formats, video_id)
             self._sort_formats(formats)
 
+            subtitles = {}
+            for sub in sd.get('subtitles', []):
+                sub_src = sub.get('src')
+                if not sub_src:
+                    continue
+                subtitles.setdefault(sub.get('lang', 'de-AT'), []).append({
+                    'url': sub_src,
+                })
+
             upload_date = unified_strdate(sd.get('created_date'))
             entries.append({
                 '_type': 'video',
                 'id': video_id,
                 'title': title,
                 'formats': formats,
+                'subtitles': subtitles,
                 'description': sd.get('description'),
                 'duration': int_or_none(sd.get('duration_in_seconds')),
                 'upload_date': upload_date,