[extractor/echo360] use _search_json instead of _parse_json as recommended by @pukkandan

This commit is contained in:
c0d3d3v 2023-03-12 21:38:37 +01:00
parent 9e2f1ecc38
commit 32fc35d305
No known key found for this signature in database
GPG key ID: 068AF680530DFF31

View file

@ -101,9 +101,8 @@ class Echo360IE(InfoExtractor):
host, video_id = self._match_valid_url(url).group('host', 'id') host, video_id = self._match_valid_url(url).group('host', 'id')
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
player_config = self._parse_json(self._search_regex( player_config = self._search_json(r'Echo\["mediaPlayerBootstrapApp"\]\("', webpage, 'player config', video_id,
r'Echo\["mediaPlayerBootstrapApp"\]\("({[^}]*})"\);', webpage, 'player config').replace('\\"', "\""), transform_source=lambda x: x.replace(R'\"', '"'))
video_id)
urlh = self._request_webpage( urlh = self._request_webpage(
f'https://{host}/api/ui/sessions/{player_config["sessionId"]}', f'https://{host}/api/ui/sessions/{player_config["sessionId"]}',