diff options
author | Felix S <felix.von.s@posteo.de> | 2022-03-27 09:35:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-27 02:35:14 -0700 |
commit | 47b8bf207b1206466f1aeaaf0c8ffec91be2fed0 (patch) | |
tree | c30542cb1054ce1c421d5f08bf4910ce3a6ffa9f /yt_dlp/extractor/go.py | |
parent | 4628a3aa751ac0b2161b216662f0e959eb9bd206 (diff) | |
download | hypervideo-pre-47b8bf207b1206466f1aeaaf0c8ffec91be2fed0.tar.lz hypervideo-pre-47b8bf207b1206466f1aeaaf0c8ffec91be2fed0.tar.xz hypervideo-pre-47b8bf207b1206466f1aeaaf0c8ffec91be2fed0.zip |
[go,viu] Extract subtitles from the m3u8 manifest (#3219)
Authored by: fstirlitz
Diffstat (limited to 'yt_dlp/extractor/go.py')
-rw-r--r-- | yt_dlp/extractor/go.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/yt_dlp/extractor/go.py b/yt_dlp/extractor/go.py index 2ccc6df21..f92e16600 100644 --- a/yt_dlp/extractor/go.py +++ b/yt_dlp/extractor/go.py @@ -217,6 +217,7 @@ class GoIE(AdobePassIE): title = video_data['title'] formats = [] + subtitles = {} for asset in video_data.get('assets', {}).get('asset', []): asset_url = asset.get('value') if not asset_url: @@ -256,8 +257,10 @@ class GoIE(AdobePassIE): error_message = ', '.join([error['message'] for error in errors]) raise ExtractorError('%s said: %s' % (self.IE_NAME, error_message), expected=True) asset_url += '?' + entitlement['uplynkData']['sessionKey'] - formats.extend(self._extract_m3u8_formats( - asset_url, video_id, 'mp4', m3u8_id=format_id or 'hls', fatal=False)) + fmts, subs = self._extract_m3u8_formats_and_subtitles( + asset_url, video_id, 'mp4', m3u8_id=format_id or 'hls', fatal=False) + formats.extend(fmts) + self._merge_subtitles(subs, target=subtitles) else: f = { 'format_id': format_id, @@ -281,7 +284,6 @@ class GoIE(AdobePassIE): formats.append(f) self._sort_formats(formats) - subtitles = {} for cc in video_data.get('closedcaption', {}).get('src', []): cc_url = cc.get('value') if not cc_url: |