diff options
author | Felix S <felix.von.s@posteo.de> | 2021-09-11 10:16:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-11 15:46:03 +0530 |
commit | 1c5ce74c045530eb3d085e96c1d5f2b3ce88a57c (patch) | |
tree | a6757382104a27875a18eb3be8171c63c192cebe | |
parent | 81a136b80f3d29c73884bb116f869df44bfd6fa1 (diff) | |
download | hypervideo-pre-1c5ce74c045530eb3d085e96c1d5f2b3ce88a57c.tar.lz hypervideo-pre-1c5ce74c045530eb3d085e96c1d5f2b3ce88a57c.tar.xz hypervideo-pre-1c5ce74c045530eb3d085e96c1d5f2b3ce88a57c.zip |
[zype] Extract subtitles from the m3u8 manifest (#948)
Closes #929
Authored by: fstirlitz
-rw-r--r-- | yt_dlp/extractor/zype.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp/extractor/zype.py b/yt_dlp/extractor/zype.py index f20f953cb..7663cb36b 100644 --- a/yt_dlp/extractor/zype.py +++ b/yt_dlp/extractor/zype.py @@ -56,6 +56,8 @@ class ZypeIE(InfoExtractor): video = response['video'] title = video['title'] + subtitles = {} + if isinstance(body, dict): formats = [] for output in body.get('outputs', []): @@ -64,7 +66,7 @@ class ZypeIE(InfoExtractor): continue name = output.get('name') if name == 'm3u8': - formats = self._extract_m3u8_formats( + formats, subtitles = self._extract_m3u8_formats_and_subtitles( output_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False) else: @@ -97,7 +99,7 @@ class ZypeIE(InfoExtractor): if get_attr('integration') == 'verizon-media': m3u8_url = 'https://content.uplynk.com/%s.m3u8' % get_attr('id') - formats = self._extract_m3u8_formats( + formats, subtitles = self._extract_m3u8_formats_and_subtitles( m3u8_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls') text_tracks = self._search_regex( r'textTracks\s*:\s*(\[[^]]+\])', @@ -107,7 +109,6 @@ class ZypeIE(InfoExtractor): text_tracks, video_id, js_to_json, False) self._sort_formats(formats) - subtitles = {} if text_tracks: for text_track in text_tracks: tt_url = dict_get(text_track, ('file', 'src')) |