commit: 583174284065a41a70220ecc8de0d31d3aea5070
parent a277dd33ebc7b3a3d4a7cf603ccdbe2d9ec5d73b
Author: Remita Amine <remitamine@gmail.com>
Date: Wed, 15 May 2019 10:38:33 +0100
[vrv] extract captions(closes #19238)
Diffstat:
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/youtube_dl/extractor/vrv.py b/youtube_dl/extractor/vrv.py
@@ -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', []):