1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[patreon] fix bootstrap data extraction (#4904)

This commit is contained in:
Mike Fährmann 2023-12-15 18:24:52 +01:00
parent d95be2537a
commit 6cd5e6adad
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -249,6 +249,15 @@ class PatreonExtractor(Extractor):
return [genmap[ft] for ft in filetypes]
def _extract_bootstrap(self, page):
data = text.extr(
page, 'id="__NEXT_DATA__" type="application/json">', '</script')
if data:
try:
return (util.json_loads(data)["props"]["pageProps"]
["bootstrapEnvelope"]["bootstrap"])
except Exception as exc:
self.log.debug("%s: %s", exc.__class__.__name__, exc)
bootstrap = text.extr(
page, 'window.patreon = {"bootstrap":', '},"apiServer"')
if bootstrap: