Created
May 17, 2022 02:22
-
-
Save londarks/9ebde106072026f7bf739ce7384c1de0 to your computer and use it in GitHub Desktop.
Python temp-mail.org Automator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport requests | |
import time | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0', | |
'Accept': 'application/json', | |
'Accept-Language': 'pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3', | |
'Origin': 'https://temp-mail.org', | |
'Connection': 'keep-alive', | |
'Referer': 'https://temp-mail.org/', | |
'Sec-Fetch-Dest': 'empty', | |
'Sec-Fetch-Mode': 'cors', | |
'Sec-Fetch-Site': 'same-site', | |
} | |
response = requests.post('https://web2.temp-mail.org/mailbox', headers=headers).json() | |
print('Email: ',response['mailbox']) | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0', | |
'Accept': 'application/json', | |
'Accept-Language': 'pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3', | |
'Authorization': 'Bearer {}'.format(response['token']), | |
'Origin': 'https://temp-mail.org', | |
'Connection': 'keep-alive', | |
'Referer': 'https://temp-mail.org/', | |
'Sec-Fetch-Dest': 'empty', | |
'Sec-Fetch-Mode': 'cors', | |
'Sec-Fetch-Site': 'same-site', | |
} | |
print('search email....') | |
while True: | |
response = requests.get('https://web2.temp-mail.org/messages', headers=headers).json() | |
if response['messages']: | |
print(response['messages']) | |
break | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment