diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-30 13:13:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-30 13:13:18 +0200 |
commit | f7dab640698eab4ae03c2b9b014a6b2ae7b69d38 (patch) | |
tree | 6fdf81dbc753d5211cebbb00a9cb8e574cde2bba | |
parent | Merge pull request #306 from Civitasv/feat-proxy-setting (diff) | |
parent | backup options to Emailnator (diff) | |
download | gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.tar gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.tar.gz gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.tar.bz2 gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.tar.lz gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.tar.xz gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.tar.zst gpt4free-f7dab640698eab4ae03c2b9b014a6b2ae7b69d38.zip |
-rw-r--r-- | gpt4free/quora/backup-mail.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gpt4free/quora/backup-mail.py b/gpt4free/quora/backup-mail.py new file mode 100644 index 00000000..0a2a5e94 --- /dev/null +++ b/gpt4free/quora/backup-mail.py @@ -0,0 +1,37 @@ +from requests import Session
+from time import sleep
+from json import loads
+from re import findall
+class Mail:
+ def __init__(self) -> None:
+ self.client = Session()
+ self.client.post("https://etempmail.com/")
+ self.cookies = {'acceptcookie': 'true'}
+ self.cookies["ci_session"] = self.client.cookies.get_dict()["ci_session"]
+ self.email = None
+ def get_mail(self):
+ respone=self.client.post("https://etempmail.com/getEmailAddress")
+ #cookies
+ self.cookies["lisansimo"] = eval(respone.text)["recover_key"]
+ self.email = eval(respone.text)["address"]
+ return self.email
+ def get_message(self):
+ print("Waiting for message...")
+ while True:
+ sleep(5)
+ respone=self.client.post("https://etempmail.com/getInbox")
+ mail_token=loads(respone.text)
+ print(self.client.cookies.get_dict())
+ if len(mail_token) == 1:
+ break
+
+ params = {'id': '1',}
+ self.mail_context = self.client.post("https://etempmail.com/getInbox",params=params)
+ self.mail_context = eval(self.mail_context.text)[0]["body"]
+ return self.mail_context
+ #,cookies=self.cookies
+ def get_verification_code(self):
+ message = self.mail_context
+ code = findall(r';">(\d{6,7})</div>', message)[0]
+ print(f"Verification code: {code}")
+ return code
\ No newline at end of file |