Skip to content

Commit

Permalink
Update ajax-module-connector request.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Jan 13, 2024
1 parent 686140e commit e1f6221
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions yellowstone/wikidot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,13 @@ def ajax_module_connector(self, site_slug: str, data: dict) -> dict:
# Set token7
token7 = self.generate_token7()
data["wikidot_token7"] = token7
cookies = requests.cookies.RequestsCookieJar()
cookies.set(
"wikidot_token7",
token7,
domain=f"{site_slug}.wikidot.com",
path="/",
)

# Make HTTP request
r = requests.post(
f"https://{site_slug}.wikidot.com/ajax_module_connector",
f"https://{site_slug}.wikidot.com/ajax-module-connector.php",
cookies={"wikidot_token7": token7},
headers={"Content-Type": "application/x-www-form-urlencoded"},
data=data,
cookies=cookies,
)
r.raise_for_status()
response = r.json()
Expand Down

0 comments on commit e1f6221

Please sign in to comment.