aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-02-10 00:04:08 +0700
committerSergey M․ <dstftw@gmail.com>2018-02-10 00:04:08 +0700
commitff873b577721f04e5b5d5bacb23ea94f9103bd46 (patch)
treef33fb22db95f6ea315a38398e82d74fded25051c
parent042968ff319d28f020edcf704b5ab3f21faa6434 (diff)
[6play] Extract subtitles (closes #15541)
-rw-r--r--youtube_dl/extractor/sixplay.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/sixplay.py b/youtube_dl/extractor/sixplay.py
index d435f7157..69951e387 100644
--- a/youtube_dl/extractor/sixplay.py
+++ b/youtube_dl/extractor/sixplay.py
@@ -52,6 +52,7 @@ class SixPlayIE(InfoExtractor):
urls = []
quality_key = qualities(['lq', 'sd', 'hq', 'hd'])
formats = []
+ subtitles = {}
for asset in clip_data['assets']:
asset_url = asset.get('full_physical_path')
protocol = asset.get('protocol')
@@ -60,6 +61,9 @@ class SixPlayIE(InfoExtractor):
urls.append(asset_url)
container = asset.get('video_container')
ext = determine_ext(asset_url)
+ if protocol == 'http_subtitle' or ext == 'vtt':
+ subtitles.setdefault('fr', []).append({'url': asset_url})
+ continue
if container == 'm3u8' or ext == 'm3u8':
if protocol == 'usp' and not compat_parse_qs(compat_urllib_parse_urlparse(asset_url).query).get('token', [None])[0]:
asset_url = re.sub(r'/([^/]+)\.ism/[^/]*\.m3u8', r'/\1.ism/\1.m3u8', asset_url)
@@ -102,4 +106,5 @@ class SixPlayIE(InfoExtractor):
'duration': int_or_none(clip_data.get('duration')),
'series': get(lambda x: x['program']['title']),
'formats': formats,
+ 'subtitles': subtitles,
}