[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 @@ def _real_extract(self, url):
host, video_id = self._match_valid_url(url).group('host', 'id')
webpage = self._download_webpage(url, video_id)
player_config = self._parse_json(self._search_regex(
r'Echo\["mediaPlayerBootstrapApp"\]\("({[^}]*})"\);', webpage, 'player config').replace('\\"', "\""),
video_id)
player_config = self._search_json(r'Echo\["mediaPlayerBootstrapApp"\]\("', webpage, 'player config', video_id,
transform_source=lambda x: x.replace(R'\"', '"'))
urlh = self._request_webpage(
f'https://{host}/api/ui/sessions/{player_config["sessionId"]}',