From 583174284065a41a70220ecc8de0d31d3aea5070 Mon Sep 17 00:00:00 2001 From: Remita Amine Date: Wed, 15 May 2019 10:38:33 +0100 Subject: [PATCH] [vrv] extract captions(closes #19238) --- youtube_dl/extractor/vrv.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/vrv.py b/youtube_dl/extractor/vrv.py index 33530fe8a..b698bf66c 100644 --- 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', []): -- 2.39.5