Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def log_output(self):
output = ""
for item in self.output_format.split(":"):
if "token" in item and self.token:
output += self.token + ":"
output += f"{self.token}:"
if "email" in item and self.email:
output += self.email + ":"
output += f"{self.email}:"
if "pass" in item:
output += self.browser.faker.password + ":"
output += f"{self.browser.faker.password}:"
if "proxy" in item and self.browser.proxy:
output += self.browser.proxy + ":"
output += f"{self.browser.proxy}:"
Comment on lines -62 to +68

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Generator.log_output refactored with the following changes:


# Remove last :
output = output[:-1]
Expand Down Expand Up @@ -102,7 +102,6 @@ async def generate_unclaimed(self):
await self.page.click("[class *= 'checkbox']", timeout=10000)
except Exception as e:
self.logger.debug("No TOS Checkbox was detected")
pass

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Generator.generate_unclaimed refactored with the following changes:

This removes the following comments ( why? ):

# Catch Exceptions and save output anyways

await self.page.click('[class *= "gtm-click-class-register-button"]')

# Solving Captcha
Expand Down Expand Up @@ -174,7 +173,6 @@ async def generate_unclaimed(self):

await self.close()

# Catch Exceptions and save output anyways
except:
self.logger.error(f"Catched Exception, trying to save Token anyways... \n Error: \n {traceback.format_exc()}")
if self.output:
Expand Down Expand Up @@ -213,7 +211,6 @@ async def generate_token(self):
await tos_box.click()
except Exception as e:
self.logger.debug("No TOS Checkbox was detected")
pass

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Generator.generate_token refactored with the following changes:

This removes the following comments ( why? ):

# Catch Exceptions and save output anyways

await self.page.click('[type="submit"]')

await self.page.solve_hcaptcha()
Expand Down Expand Up @@ -269,7 +266,6 @@ async def generate_token(self):

await self.close()

# Catch Exceptions and save output anyways
except:
self.logger.error(f"Catched Exception, trying to save Token anyways... \n Error: \n{traceback.format_exc()}")
if self.output:
Expand Down Expand Up @@ -329,7 +325,7 @@ async def main():
if email not in ("1", "2"):
raise ValueError("Invalid Mode provided")
else:
email = True if email == "1" else False
email = email == "1"
Comment on lines -332 to +328

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

else:
email = False

Expand All @@ -339,7 +335,7 @@ async def main():
if humanize not in ("1", "2"):
raise ValueError("Invalid Mode provided")
else:
humanize = True if humanize == "1" else False
humanize = humanize == "1"
else:
humanize = False

Expand All @@ -349,9 +345,11 @@ async def main():
except:
raise ValueError("Invalid ThreadAmount provided")

proxy_file = input("[Drag&Drop] - [Proxy File]\n" +
"<?> Or Leave empty for Proxyless Mode\n" + "</> ").replace('"', "")
if proxy_file:
if proxy_file := input(
"[Drag&Drop] - [Proxy File]\n"
+ "<?> Or Leave empty for Proxyless Mode\n"
+ "</> "
).replace('"', ""):
if not os.path.isfile(proxy_file):
raise ValueError("Provided ProxyPath isnt a file!")
proxies = open(proxy_file, 'r').readlines()
Expand Down
5 changes: 2 additions & 3 deletions modules/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def get_headers(self, payload):
super_props = {"os": platform.system(), "browser":"Firefox", "release_channel":"stable", "client_version": self.browser.browser.version, "os_version": str(platform.version()), "os_arch": "x64" if platform.machine().endswith('64') else "x86", "system_locale": self.browser.faker.locale, "client_build_number": DISCORD_BUILD_NUM, "client_event_source": None}
super_props = base64.b64encode(str(super_props).encode()).decode()

headers = {
return {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Discord.get_headers refactored with the following changes:

"accept": "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "de,de-DE;q=0.9",
Expand All @@ -42,7 +42,6 @@ async def get_headers(self, payload):
"x-discord-locale": "en",
"x-super-properties": super_props,
}
return headers

async def humanize_token(self):
await self.page.goto("https://discord.com/channels/@me")
Expand Down Expand Up @@ -122,7 +121,7 @@ async def humanize_token(self):
return

self.log_output()
self.logger.info(f"Set Bio and ProfilePic!")
self.logger.info("Set Bio and ProfilePic!")
Comment on lines -125 to +124

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Discord.humanize_token refactored with the following changes:


async def join_server(self):
await self.page.goto("https://discord.com/channels/@me")
Expand Down
42 changes: 22 additions & 20 deletions modules/tempmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,41 @@ class TempMail:
The content of the request is a json string and is returned as a string object
"""

def makeHTTPRequest(endpoint):
def makeHTTPRequest(self):
headers = {
"User-Agent": "TempMailPythonAPI/1.0",
"Accept": "application/json"
}
try:
connection = httpx.get(BASE_URL + endpoint, headers=headers)
connection = httpx.get(BASE_URL + self, headers=headers)
if connection.status_code >= 400:
raise Exception("HTTP Error: " + str(connection.status_code))
raise Exception(f"HTTP Error: {str(connection.status_code)}")
except Exception as e:
print(e)
return None

response = connection.text

return response
return connection.text
Comment on lines -19 to +32

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TempMail.makeHTTPRequest refactored with the following changes:


"""
GenerateInbox will generate an inbox with an address and a token
and returns an Inbox object
> rush = False will generate a normal inbox with no rush (https://tempmail.lol/news/2022/08/03/introducing-rush-mode-for-tempmail/)
"""
def generateInbox(rush=False):
def generateInbox(self):
try:
random_domain = random.choice(DOMAINS)
s = TempMail.makeHTTPRequest(f"/generate/{random_domain}")
except:
print("Website responded with: " + s)
print(f"Website responded with: {s}")
Comment on lines -41 to +44

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TempMail.generateInbox refactored with the following changes:

data = json.loads(s)
return Inbox(data["address"], data["token"])

"""
getEmail gets the emails from an inbox object
and returns a list of Email objects
"""
def getEmails(inbox):
s = TempMail.makeHTTPRequest("/auth/" + inbox.token)
def getEmails(self):
s = TempMail.makeHTTPRequest(f"/auth/{self.token}")
Comment on lines -54 to +53

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TempMail.getEmails refactored with the following changes:

data = json.loads(s)

# Raise an exception if the token is invalid
Expand All @@ -62,14 +60,20 @@ def getEmails(inbox):

# if no emails are found, return an empty list
# else return a list of email
if data["email"] == None:
if data["email"] is None:
return ["None"]
else:
emails = []
for email in data["email"]:
emails.append(Email(
email["from"], email["to"], email["subject"], email["body"], email["html"], email["date"]))
return emails
return [
Email(
email["from"],
email["to"],
email["subject"],
email["body"],
email["html"],
email["date"],
)
for email in data["email"]
]

class Email:
def __init__(self, sender, recipient, subject, body, html, date):
Expand Down Expand Up @@ -106,8 +110,7 @@ def date(self):
return self._date

def __repr__(self):
return ("Email (sender={}, recipient={}, subject={}, body={}, html={}, date={} )"
.format(self.sender, self.recipient, self.subject, self.body, self.html, self.date))
return f"Email (sender={self.sender}, recipient={self.recipient}, subject={self.subject}, body={self.body}, html={self.html}, date={self.date} )"
Comment on lines -109 to +113

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Email.__repr__ refactored with the following changes:


class Inbox:
def __init__(self, address, token):
Expand All @@ -124,5 +127,4 @@ def token(self):
return self._token

def __repr__(self):
return ("Inbox (address={}, token={} )"
.format(self.address, self.token))
return f"Inbox (address={self.address}, token={self.token} )"