From 32fc35d305c0352e1db33ef23f7a3a72690af253 Mon Sep 17 00:00:00 2001 From: c0d3d3v Date: Sun, 12 Mar 2023 21:38:37 +0100 Subject: [PATCH] [extractor/echo360] use _search_json instead of _parse_json as recommended by @pukkandan --- yt_dlp/extractor/echo360.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/echo360.py b/yt_dlp/extractor/echo360.py index 5be6d0f86..de5c3e573 100644 --- a/yt_dlp/extractor/echo360.py +++ b/yt_dlp/extractor/echo360.py @@ -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"]}',