summaryrefslogtreecommitdiffstats
path: root/quora/mail.py
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-27 14:29:39 +0200
committerGitHub <noreply@github.com>2023-04-27 14:29:39 +0200
commita5b4d8b10c49021949aa9ce950fa182b54c71bc4 (patch)
tree997609545bc922d63081a49ee356b747b4ecce68 /quora/mail.py
parentMerge pull request #197 from AymaneHrouch/update_syspath (diff)
parentMerge branch 'main' into main (diff)
downloadgpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.tar
gpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.tar.gz
gpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.tar.bz2
gpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.tar.lz
gpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.tar.xz
gpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.tar.zst
gpt4free-a5b4d8b10c49021949aa9ce950fa182b54c71bc4.zip
Diffstat (limited to 'quora/mail.py')
-rw-r--r--quora/mail.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/quora/mail.py b/quora/mail.py
index c4707860..e6ce96c2 100644
--- a/quora/mail.py
+++ b/quora/mail.py
@@ -38,7 +38,7 @@ class Emailnator:
return self.email
def get_message(self):
- print("waiting for code...")
+ print("Waiting for message...")
while True:
sleep(2)
@@ -49,6 +49,7 @@ class Emailnator:
mail_token = loads(mail_token.text)["messageData"]
if len(mail_token) == 2:
+ print("Message received!")
print(mail_token[1]["messageID"])
break
@@ -63,4 +64,19 @@ class Emailnator:
return mail_context.text
def get_verification_code(self):
- return findall(r';">(\d{6,7})</div>', self.get_message())[0]
+ message = self.get_message()
+ code = findall(r';">(\d{6,7})</div>', message)[0]
+ print(f"Verification code: {code}")
+ return code
+
+ def clear_inbox(self):
+ print("Clearing inbox...")
+ self.client.post(
+ "https://www.emailnator.com/delete-all",
+ json={"email": self.email},
+ )
+ print("Inbox cleared!")
+
+ def __del__(self):
+ if self.email:
+ self.clear_inbox()