]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[vrv] extract captions(closes #19238)
authorRemita Amine <remitamine@gmail.com>
Wed, 15 May 2019 09:38:33 +0000 (10:38 +0100)
committerRemita Amine <remitamine@gmail.com>
Wed, 15 May 2019 09:39:59 +0000 (10:39 +0100)
youtube_dl/extractor/vrv.py

index 33530fe8a2603f57adc1dfe7ad4941e87054b6ec..b698bf66cfec33c9424ccd4e261ad2326c636a5a 100644 (file)
@@ -198,14 +198,15 @@ class VRVIE(VRVBaseIE):
         self._sort_formats(formats)
 
         subtitles = {}
-        for subtitle in streams_json.get('subtitles', {}).values():
-            subtitle_url = subtitle.get('url')
-            if not subtitle_url:
-                continue
-            subtitles.setdefault(subtitle.get('locale', 'en-US'), []).append({
-                'url': subtitle_url,
-                'ext': subtitle.get('format', 'ass'),
-            })
+        for k in ('captions', 'subtitles'):
+            for subtitle in streams_json.get(k, {}).values():
+                subtitle_url = subtitle.get('url')
+                if not subtitle_url:
+                    continue
+                subtitles.setdefault(subtitle.get('locale', 'en-US'), []).append({
+                    'url': subtitle_url,
+                    'ext': subtitle.get('format', 'ass'),
+                })
 
         thumbnails = []
         for thumbnail in video_data.get('images', {}).get('thumbnails', []):