From 41bb580c96ed943bbf68a47d0eb3cb7ac7c9488d Mon Sep 17 00:00:00 2001 From: yannis300307 Date: Thu, 9 Nov 2023 12:52:13 +0100 Subject: [PATCH] Fixed prelogin location --- main.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 7bdd08e..44e25d1 100644 --- a/main.py +++ b/main.py @@ -33,17 +33,30 @@ Content-Type: application/x-www-form-urlencoded Pragma: no-cache Cache-Control: no-cache""" -resp = ses.post("https://alcasar-0320002d.smile-education.fr/intercept.php", data=f"challenge={challenge}&userurl=http%3A%2F%2Fdetectportal.firefox.com%2Fcanonical.html&username={username}&password={password}&button=Authentification", +data = f"challenge={challenge}&userurl=http%3A%2F%2Fdetectportal.firefox.com%2Fcanonical.html&username={username}&password={password}&button=Authentification" +resp = ses.post("https://alcasar-0320002d.smile-education.fr/intercept.php", + data=data, allow_redirects=False, headers={"Origin": "https://alcasar-0320002d.smile-education.fr", - "Referer": connection_page.url}) + "Referer": connection_page.url, + "Accept-Encoding": "gzip, deflate, br", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", + "Sec-Fetch-Mode": "navigate", + "Connection": "keep-alive", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0", + "Content-Type": "application/x-www-form-urlencoded", + "Sec-Fetch-Site": "same-origin", + "Sec-Fetch-Dest": "document", + "Accept-Language": "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3", + "Sec-Fetch-User": "?1"}) print(resp.text) -redirect = resp.headers["Location"] +#redirect = resp.headers["Location"] -print(redirect) +#print(redirect) +print(resp.headers) -#print(ses.get(redirect).content.decode()) +#print(ses.get(redirect).text) -#print(ses.get("http://alcasar-0320002d.smile-education.fr/status.php").content.decode()) +#print(ses.get("http://alcasar-0320002d.smile-education.fr/status.php").text) #print(ses.get(redirect).content) \ No newline at end of file