summaryrefslogtreecommitdiffstats
path: root/poe/mail.py
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-10 01:09:29 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-10 01:09:29 +0200
commit3be905b742b040c7f497727f9e765a8d709baa44 (patch)
tree0aafc1ea98e094a7eb47343b0ed5f60c158ce52a /poe/mail.py
parentyou.com api (gpt 3.5 + internet) (diff)
downloadgpt4free-3be905b742b040c7f497727f9e765a8d709baa44.tar
gpt4free-3be905b742b040c7f497727f9e765a8d709baa44.tar.gz
gpt4free-3be905b742b040c7f497727f9e765a8d709baa44.tar.bz2
gpt4free-3be905b742b040c7f497727f9e765a8d709baa44.tar.lz
gpt4free-3be905b742b040c7f497727f9e765a8d709baa44.tar.xz
gpt4free-3be905b742b040c7f497727f9e765a8d709baa44.tar.zst
gpt4free-3be905b742b040c7f497727f9e765a8d709baa44.zip
Diffstat (limited to 'poe/mail.py')
-rw-r--r--poe/mail.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/poe/mail.py b/poe/mail.py
deleted file mode 100644
index d4aeb564..00000000
--- a/poe/mail.py
+++ /dev/null
@@ -1,62 +0,0 @@
-from requests import Session
-from string import ascii_letters
-from random import choices
-
-class Mail:
- def __init__(self, proxies: dict = None) -> None:
- 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"
- }
-
- 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")
-
- def fetch_inbox(self):
- return self.client.get(f"https://api.mail.tm/messages").json()["hydra:member"]
-
- def get_message(self, message_id: str):
- return self.client.get(f"https://api.mail.tm/messages/{message_id}").json()
-
- def get_message_content(self, message_id: str):
- return self.get_message(message_id)["text"]
-
-
-# if __name__ == "__main__":
-# client = Mail()
-# client.get_mail()
-
- \ No newline at end of file