Files
weval-l99/v95_fix.py
2026-04-24 04:38:58 +02:00

39 lines
1.2 KiB
Python

# Replace the session acquisition part
import re
path = "/opt/weval-l99/v95_full_authed_e2e.py"
with open(path) as f:
code = f.read()
old = """ # Fresh session - get new PHPSESSID
cookie_jar = http.cookiejar.CookieJar()
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookie_jar))
req = urllib.request.Request(
"http://127.0.0.1/api/opus-test-session-v94.php?k=WEVADS2026",
headers={"Host": "weval-consulting.com"}
)
opener.open(req).read()
session_id = None
for c in cookie_jar:
if c.name == "PHPSESSID":
session_id = c.value
print(f"Fresh session: {session_id}")"""
new = """ # Fresh session - get PHPSESSID from response JSON
req = urllib.request.Request(
"http://127.0.0.1/api/opus-test-session-v94.php?k=WEVADS2026",
headers={"Host": "weval-consulting.com"}
)
resp_data = urllib.request.urlopen(req).read().decode()
try:
resp_json = json.loads(resp_data)
session_id = resp_json.get("session_id")
except Exception as e:
session_id = None
print(f"Fresh session: {session_id}")"""
code = code.replace(old, new)
with open(path, "w") as f:
f.write(code)
print("PATCHED")