diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-09-11 17:47:59 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-09-12 21:40:36 +0530 |
commit | 67ad7759af135c35aa13f7c1e39bebf41f54493d (patch) | |
tree | 6dc800fe4431b5b1a6963f03bfa786485d8f7930 /yt_dlp/extractor/brightcove.py | |
parent | d5fe04f5c72d9d64c29fd7496e76d2b99f9dd5cd (diff) | |
download | hypervideo-pre-67ad7759af135c35aa13f7c1e39bebf41f54493d.tar.lz hypervideo-pre-67ad7759af135c35aa13f7c1e39bebf41f54493d.tar.xz hypervideo-pre-67ad7759af135c35aa13f7c1e39bebf41f54493d.zip |
[brightcove] Extract subtitles from manifests
Diffstat (limited to 'yt_dlp/extractor/brightcove.py')
-rw-r--r-- | yt_dlp/extractor/brightcove.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/yt_dlp/extractor/brightcove.py b/yt_dlp/extractor/brightcove.py index bb68dc481..cd1c3f01c 100644 --- a/yt_dlp/extractor/brightcove.py +++ b/yt_dlp/extractor/brightcove.py @@ -472,7 +472,7 @@ class BrightcoveNewIE(AdobePassIE): title = json_data['name'].strip() num_drm_sources = 0 - formats = [] + formats, subtitles = [], {} sources = json_data.get('sources') or [] for source in sources: container = source.get('container') @@ -488,12 +488,16 @@ class BrightcoveNewIE(AdobePassIE): elif ext == 'm3u8' or container == 'M2TS': if not src: continue - formats.extend(self._extract_m3u8_formats( - src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)) + f, subs = self._extract_m3u8_formats_and_subtitles( + src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False) + formats.extend(f) + subtitles = self._merge_subtitles(subtitles, subs) elif ext == 'mpd': if not src: continue - formats.extend(self._extract_mpd_formats(src, video_id, 'dash', fatal=False)) + f, subs = self._extract_mpd_formats_and_subtitles(src, video_id, 'dash', fatal=False) + formats.extend(f) + subtitles = self._merge_subtitles(subtitles, subs) else: streaming_src = source.get('streaming_src') stream_name, app_name = source.get('stream_name'), source.get('app_name') @@ -556,7 +560,6 @@ class BrightcoveNewIE(AdobePassIE): for f in formats: f.setdefault('http_headers', {}).update(headers) - subtitles = {} for text_track in json_data.get('text_tracks', []): if text_track.get('kind') != 'captions': continue |