[common] add '_extract_nextdata' method

This commit is contained in:
Mike Fährmann
2025-01-12 11:14:33 +01:00
parent 3f48e2f820
commit 1ae3ac5e39
4 changed files with 13 additions and 14 deletions

View File

@@ -591,6 +591,10 @@ class Extractor():
return util.json_loads(text.extr(
page, '<script type="application/ld+json">', "</script>"))
def _extract_nextdata(self, page):
return util.json_loads(text.extr(
page, ' id="__NEXT_DATA__" type="application/json">', "</script>"))
def _prepare_ddosguard_cookies(self):
if not self.cookies.get("__ddg2", domain=self.cookies_domain):
self.cookies.set(