Add post
This commit is contained in:
parent
1d84e02940
commit
0fe966a42d
1 changed files with 20 additions and 7 deletions
|
@ -23,25 +23,38 @@ def main(args: argparse.Namespace) -> None:
|
||||||
"""Connect to ProtonMail."""
|
"""Connect to ProtonMail."""
|
||||||
|
|
||||||
with requests.Session() as session:
|
with requests.Session() as session:
|
||||||
main_url = "https://mail.protonmail.com"
|
main_url = "https://mail.protonmail.com/login"
|
||||||
|
|
||||||
req = session.get(main_url)
|
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(
|
req = session.post(
|
||||||
"https://mail.protonmail.com/api/auth",
|
"https://mail.protonmail.com/api/auth",
|
||||||
data={
|
data={
|
||||||
"Username": "tfranken@protonmail.com",
|
"ClientEphemeral": "",
|
||||||
"ClientEphemeral": "123",
|
"ClientProof": "",
|
||||||
"ClientProof": "123",
|
"SRPSession": req_json["SRPSession"],
|
||||||
"SRPSession": "123",
|
"Username": args.username,
|
||||||
},
|
},
|
||||||
headers={
|
headers={
|
||||||
|
"Referer": main_url,
|
||||||
|
"x-pm-apiversion": "3",
|
||||||
"x-pm-appversion": "Web_3.16.23",
|
"x-pm-appversion": "Web_3.16.23",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
print(req.text)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Reference in a new issue