diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2022-06-07 12:25:37 +1200 |
---|---|---|
committer | coletdjnz <coletdjnz@protonmail.com> | 2022-06-07 12:26:36 +1200 |
commit | 65141660aba62fefb1901804aeb0484992243af7 (patch) | |
tree | c3496d5fa8871be084a70b1eca07335f73e0ef9b | |
parent | dec30912a708d01b4164f35dda85319361a97a58 (diff) |
[extractor/youtube] Fix bug in b7c47b743871cdf3e0de75b17e4454d987384bf9
Closes #3997
Authored by: coletdjnz
-rw-r--r-- | yt_dlp/extractor/youtube.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index c8541c664..113b9aa07 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -475,13 +475,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor): data=json.dumps(data).encode('utf8'), headers=real_headers, query={'key': api_key or self._extract_api_key(), 'prettyPrint': 'false'}) - def extract_yt_initial_data(self, item_id, webpage): - return self._search_json(self._YT_INITIAL_DATA_RE, webpage, 'yt initial data', item_id, fatal=True) - - def _extract_yt_initial_variable(self, webpage, regex, video_id, name): - return self._parse_json(self._search_regex( - (fr'{regex}\s*{self._YT_INITIAL_BOUNDARY_RE}', - regex), webpage, name, default='{}'), video_id, fatal=False, lenient=True) + def extract_yt_initial_data(self, item_id, webpage, fatal=True): + return self._search_json(self._YT_INITIAL_DATA_RE, webpage, 'yt initial data', item_id, fatal=fatal) @staticmethod def _extract_session_index(*data): |