diff options
author | Felix S <felix.von.s@posteo.de> | 2021-04-18 08:40:39 +0200 |
---|---|---|
committer | Felix S <felix.von.s@posteo.de> | 2021-04-28 17:22:27 +0530 |
commit | 64a5cf7929f0df9220fd25f404dd19179f44623c (patch) | |
tree | 27d606441b5e2a5060aaed564ca992716f1666f6 | |
parent | 7a450a3b1c2a6f7140083aa2fae416de8b9f7f3c (diff) | |
download | hypervideo-pre-64a5cf7929f0df9220fd25f404dd19179f44623c.tar.lz hypervideo-pre-64a5cf7929f0df9220fd25f404dd19179f44623c.tar.xz hypervideo-pre-64a5cf7929f0df9220fd25f404dd19179f44623c.zip |
[byutv] Extract subtitles from streaming manifests
-rw-r--r-- | yt_dlp/extractor/byutv.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/yt_dlp/extractor/byutv.py b/yt_dlp/extractor/byutv.py index 0b11bf11f..7c6c826d7 100644 --- a/yt_dlp/extractor/byutv.py +++ b/yt_dlp/extractor/byutv.py @@ -82,6 +82,7 @@ class BYUtvIE(InfoExtractor): info = {} formats = [] + subtitles = {} for format_id, ep in video.items(): if not isinstance(ep, dict): continue @@ -90,12 +91,16 @@ class BYUtvIE(InfoExtractor): continue ext = determine_ext(video_url) if ext == 'm3u8': - formats.extend(self._extract_m3u8_formats( + m3u8_fmts, m3u8_subs = self._extract_m3u8_formats_and_subtitles( video_url, video_id, 'mp4', entry_protocol='m3u8_native', - m3u8_id='hls', fatal=False)) + m3u8_id='hls', fatal=False) + formats.extend(m3u8_fmts) + subtitles = self._merge_subtitles(subtitles, m3u8_subs) elif ext == 'mpd': - formats.extend(self._extract_mpd_formats( - video_url, video_id, mpd_id='dash', fatal=False)) + mpd_fmts, mpd_subs = self._extract_mpd_formats_and_subtitles( + video_url, video_id, mpd_id='dash', fatal=False) + formats.extend(mpd_fmts) + subtitles = self._merge_subtitles(subtitles, mpd_subs) else: formats.append({ 'url': video_url, @@ -114,4 +119,5 @@ class BYUtvIE(InfoExtractor): 'display_id': display_id, 'title': display_id, 'formats': formats, + 'subtitles': subtitles, }) |