Skip to content

Commit

Permalink
Try to parse newer HTTP response from Patreon
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobi823 authored Oct 28, 2023
1 parent fd36eaf commit 28ada11
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gallery_dl/extractor/patreon.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,14 @@ def _build_file_generators(self, filetypes):
return [genmap[ft] for ft in filetypes]

def _extract_bootstrap(self, page):
return util.json_loads(text.extr(
page, "window.patreon.bootstrap,", "});") + "}")
if "window.patreon.bootstrap," in page:
return util.json_loads(text.extr(
page, "window.patreon.bootstrap,", "});") + "}")
elif 'window.patreon = {"bootstrap":' in page:
return util.json_loads(text.extr(
page, 'window.patreon = {"bootstrap":', '},"apiServer"') + "}")
else:
raise Exception("unknown HTML and JS structure")


class PatreonCreatorExtractor(PatreonExtractor):
Expand Down

0 comments on commit 28ada11

Please sign in to comment.