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:
parent
d95be2537a
commit
6cd5e6adad
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user