Skip to content

Commit

Permalink
v2.2
Browse files Browse the repository at this point in the history
+ Fixxed Bug causing /register Gen not clicking Tos-Checkbox
+ Updated Email Claiming to be manual (not request)
  • Loading branch information
Vinyzu committed Sep 23, 2022
1 parent fb87926 commit 03f861b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 35 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Every new change will be logged

## v2.2
```
+ Fixxed Bug causing /register Gen not clicking Tos-Checkbox
+ Updated Email Claiming to be manual (not request)
```

## v2.1
```
+ Changed Checkbox Locator
Expand Down
20 changes: 10 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ async def generate_token(self):
# Setting Up TokenLog
await self.log_token()
# Typing Email, Username, Password
self.email = f"{self.browser.faker.username}{random.randint(10, 99)}@gmail.com"

if self.email_verification:
self.inbox = TempMail.generateInbox()
self.email = self.inbox.address
else:
self.email = f"{self.browser.faker.username}{random.randint(10, 99)}@gmail.com"
await self.page.type('[name="email"]', self.email)
await self.page.type('[name="username"]', self.browser.faker.username)
await self.page.type('[name="password"]', self.browser.faker.password)
Expand All @@ -202,7 +202,7 @@ async def generate_token(self):
await self.page.type('[id="react-select-4-input"]', self.browser.faker.birth_year)
# Clicking Tos and Submit Button
try:
tos_box = self.page.locator("[type='checkbox']").first()
tos_box = self.page.locator("[type='checkbox']").first
await tos_box.click()
except Exception as e:
self.logger.debug("No TOS Checkbox was detected")
Expand Down Expand Up @@ -273,13 +273,13 @@ async def login_token(self):
await self.page.evaluate(str('setInterval(() => {document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"' + self.token + '"`}, 2500); setTimeout(() => {location.reload();}, 2500);'))
await self.page.wait_for_timeout(5000)

# if self.email_verification:
# self.inbox = TempMail.generateInbox()
# self.logger.info("Claiming Account...")
# await Discord.set_email(self, self.inbox.address)
# await self.page.wait_for_timeout(2000)
# self.logger.info("Verifying email...")
# await Discord.confirm_email(self)
if self.email_verification:
self.inbox = TempMail.generateInbox()
self.logger.info("Claiming Account...")
await Discord.set_email(self, self.inbox.address)
await self.page.wait_for_timeout(2000)
self.logger.info("Verifying email...")
await Discord.confirm_email(self)
# self.log_output()
# await self.page.wait_for_timeout(2000)
# if self.humanize:
Expand Down
49 changes: 27 additions & 22 deletions modules/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ async def get_headers(self, payload):
async def humanize_token(self):
await self.page.goto("https://discord.com/channels/@me")
await self.page.wait_for_timeout(1000)
# Clicking Join Server Button
# Clicking Settings Button
settings_button = self.page.locator('[class *= "button-12Fmur"]').last
await settings_button.click()
# Click Join another Server Button
# Click Profile Button
await self.page.wait_for_timeout(500)
profile_button = self.page.locator('[class *= "item-3XjbnG"]').nth(6)
await profile_button.click()
Expand Down Expand Up @@ -171,26 +171,31 @@ async def is_locked(self):
return not token_check

async def set_email(self, email):
# Setting Email
payload = {"email": email, "password": self.browser.faker.password}
headers = await Discord.get_headers(self, payload)
response = await self.page.request.patch("https://discord.com/api/v9/users/@me", data=payload, headers=headers)

if not response.status == 200:
try:
json = await response.json()
self.logger.error(f"Couldnt set email! Response: {json}")
except:
self.logger.error(f"Couldnt set email!")
return False
else:
self.logger.info("Successfully set email! Verifying...")
try:
json = await response.json()
if json.get("token"):
self.token = json.get("token")
except:
pass
try:
# Setting Email
await self.page.goto("https://discord.com/channels/@me")
await self.page.wait_for_timeout(1000)
# Clicking Settings Button
settings_button = self.page.locator('[class *= "button-12Fmur"]').last
await settings_button.click()
# Click Email Button
await self.page.wait_for_timeout(500)
settings_button = self.page.locator('[class *= "fieldButton-14lHvK"]').nth(1)
await settings_button.click()

# Typing Mail
mail_input = self.page.locator('[type="text"]').last
await mail_input.type(email)

# Typing Password
password_input = self.page.locator('[type="password"]').last
await password_input.type(self.browser.faker.password)

# Click Claim Button
claim_button = self.page.locator('[type="submit"]').last
await claim_button.click()
except Exception as e:
print(e)

async def confirm_email(self):
before_token = self.token
Expand Down
3 changes: 0 additions & 3 deletions output.txt

This file was deleted.

0 comments on commit 03f861b

Please sign in to comment.