This commit is contained in:
flyingscorpio@arch-desktop 2020-05-02 18:48:58 +02:00
parent 1d84e02940
commit 0fe966a42d

View file

@ -23,25 +23,38 @@ def main(args: argparse.Namespace) -> None:
"""Connect to ProtonMail."""
with requests.Session() as session:
main_url = "https://mail.protonmail.com"
main_url = "https://mail.protonmail.com/login"
req = session.get(main_url)
print(req.cookies)
req = session.post(
"https://mail.protonmail.com/api/info",
data={
"Username": args.username,
},
headers={
"Referer": main_url,
"x-pm-apiversion": "3",
"x-pm-appversion": "Web_3.16.23",
},
)
req_json = req.json()
print(req_json)
req = session.post(
"https://mail.protonmail.com/api/auth",
data={
"Username": "tfranken@protonmail.com",
"ClientEphemeral": "123",
"ClientProof": "123",
"SRPSession": "123",
"ClientEphemeral": "",
"ClientProof": "",
"SRPSession": req_json["SRPSession"],
"Username": args.username,
},
headers={
"Referer": main_url,
"x-pm-apiversion": "3",
"x-pm-appversion": "Web_3.16.23",
},
)
print(req.text)
if __name__ == "__main__":