summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-16 15:09:29 +0200
committerGitHub <noreply@github.com>2023-04-16 15:09:29 +0200
commitbcc046c090b81ddf65689a509788675529a41807 (patch)
tree69475cfd540e843da113efba6f19620fac0e1205
parenthttps://chat.chatbot.sex/chat gpt-4 / jailbreak, internet (diff)
parentUpdate mail.py (diff)
downloadgpt4free-bcc046c090b81ddf65689a509788675529a41807.tar
gpt4free-bcc046c090b81ddf65689a509788675529a41807.tar.gz
gpt4free-bcc046c090b81ddf65689a509788675529a41807.tar.bz2
gpt4free-bcc046c090b81ddf65689a509788675529a41807.tar.lz
gpt4free-bcc046c090b81ddf65689a509788675529a41807.tar.xz
gpt4free-bcc046c090b81ddf65689a509788675529a41807.tar.zst
gpt4free-bcc046c090b81ddf65689a509788675529a41807.zip
Diffstat (limited to '')
-rw-r--r--quora/mail.py56
1 files changed, 16 insertions, 40 deletions
diff --git a/quora/mail.py b/quora/mail.py
index d4aeb564..fce6d24d 100644
--- a/quora/mail.py
+++ b/quora/mail.py
@@ -7,56 +7,32 @@ class Mail:
self.client = Session()
self.client.proxies = None #proxies
self.client.headers = {
- "host": "api.mail.tm",
- "connection": "keep-alive",
- "sec-ch-ua": "\"Google Chrome\";v=\"111\", \"Not(A:Brand\";v=\"8\", \"Chromium\";v=\"111\"",
- "accept": "application/json, text/plain, */*",
- "content-type": "application/json",
- "sec-ch-ua-mobile": "?0",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
- "sec-ch-ua-platform": "\"macOS\"",
- "origin": "https://mail.tm",
- "sec-fetch-site": "same-site",
- "sec-fetch-mode": "cors",
- "sec-fetch-dest": "empty",
- "referer": "https://mail.tm/",
- "accept-encoding": "gzip, deflate, br",
- "accept-language": "en-GB,en-US;q=0.9,en;q=0.8"
+ "Accept": "application/json",
+ "Content-Type": "application/json"
}
+ self.domain = "guerrillamail.com"
+
+ self.sid_token = self.client.get("https://api.guerrillamail.com/ajax.php?f=get_email_address").json()['sid_token']
+
def get_mail(self) -> str:
token = ''.join(choices(ascii_letters, k=10)).lower()
-
- init = self.client.post("https://api.mail.tm/accounts", json={
- "address" : f"{token}@bugfoo.com",
- "password": token
- })
-
- if init.status_code == 201:
- resp = self.client.post("https://api.mail.tm/token", json = {
- **init.json(),
- "password": token
- })
-
- self.client.headers['authorization'] = 'Bearer ' + resp.json()['token']
-
- return f"{token}@bugfoo.com"
-
- else:
- raise Exception("Failed to create email")
-
+
+ email_id = f"{token}@{self.domain}"
+ self.client.get(f"https://api.guerrillamail.com/ajax.php?f=set_email_user&email_user={token}&sid_token={self.sid_token}")
+
+ return email_id
+
def fetch_inbox(self):
- return self.client.get(f"https://api.mail.tm/messages").json()["hydra:member"]
+ return self.client.get(f"https://api.guerrillamail.com/ajax.php?f=get_emails&sid_token={self.sid_token}").json()
def get_message(self, message_id: str):
- return self.client.get(f"https://api.mail.tm/messages/{message_id}").json()
+ return self.client.get(f"https://api.guerrillamail.com/ajax.php?f=fetch_email&email_id={message_id}&sid_token={self.sid_token}").json()
def get_message_content(self, message_id: str):
- return self.get_message(message_id)["text"]
-
+ return self.get_message(message_id)["mail_body"]
# if __name__ == "__main__":
# client = Mail()
-# client.get_mail()
-
- \ No newline at end of file
+# client.get_mail()