Skip to content

Commit

Permalink
v1.2.7 - bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
itschasa committed Oct 22, 2023
1 parent 313289f commit b558695
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
*.pyc
*.bkup
*.bkup
dist
10 changes: 5 additions & 5 deletions backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def user_info(self):
self.backup_data["bio"] = self.user_me["bio"]
self.c.success(f"Backed up: {colours['main_colour']}User Info")

r = request_client.get(f"https://cdn.discordapp.com/avatars/{self.backup_data['id']}/{self.user_me['avatar']}")
r = request_client.get(f"https://cdn.discordapp.com/avatars/{self.backup_data['id']}/{self.user_me['avatar']}", headers=build_headers("get"))
base64_bytes = base64.b64encode(r.content)
base64_message = base64_bytes.decode('ascii')
self.backup_data["avatar-bytes"] = base64_message
self.c.success(f"Backed up: {colours['main_colour']}Avatar")

r = request_client.get(f"https://cdn.discordapp.com/banners/{self.backup_data['id']}/{self.user_me['banner']}")
r = request_client.get(f"https://cdn.discordapp.com/banners/{self.backup_data['id']}/{self.user_me['banner']}", headers=build_headers("get"))
base64_bytes = base64.b64encode(r.content)
base64_message = base64_bytes.decode('ascii')
self.backup_data["banner-bytes"] = base64_message
Expand Down Expand Up @@ -233,7 +233,7 @@ def _get_invite(self, guild):
allowed_channel_types = [0,2,3,5,13]
done, code = False, False
error = 0
retries = 3
retries = 5

for channel in channels:
if channel["type"] not in allowed_channel_types:
Expand Down Expand Up @@ -261,7 +261,7 @@ def _get_invite(self, guild):
break
else:
error += 1
self.c.fail(f"Can't Create Invite in {colours['main_colour']}#{channel['name']}{colours['white']} ({colours['main_colour']}{error}/3{colours['white']})", indent=2)
self.c.fail(f"Can't Create Invite in {colours['main_colour']}#{channel['name']}{colours['white']} ({colours['main_colour']}{error}/{retries}{colours['white']})", indent=2)
break

if done is False:
Expand Down Expand Up @@ -289,7 +289,7 @@ def _get_invite(self, guild):
break
else:
error += 1
self.c.fail(f"Can't Create Invite in {colours['main_colour']}#{channel['name']} {colours['white']}({colours['main_colour']}{error}/3{colours['white']})", indent=2)
self.c.fail(f"Can't Create Invite in {colours['main_colour']}#{channel['name']} {colours['white']}({colours['main_colour']}{error}/{retries}{colours['white']})", indent=2)
break
return code, done

Expand Down
2 changes: 1 addition & 1 deletion client_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def build_headers(
):
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Encoding": "identity",
"Accept-Language": "en-US,en;q=0.9",
"Cookie": "locale=en-GB",
"Referer": referer,
Expand Down
8 changes: 1 addition & 7 deletions fetch_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import re
import base64
import json
import brotli
from Crypto.Cipher import AES
from win32crypt import CryptUnprotectData

Expand Down Expand Up @@ -44,17 +43,12 @@ def get_decryption_key(path) -> str:

return decryption_key

def reqJSON(req) -> dict:
try: return req.json()
except: return json.loads(brotli.decompress(req.content).decode("utf-8"))

def check_token(tkn, name, ids:list, to_return_tokens:list):
r = request_client.get("https://discord.com/api/v9/users/@me", headers=build_headers("get", superprop=True, debugoptions=True, discordlocale=True, authorization=tkn, timezone=True))
if r.status_code == 200:
tknid = base64.b64decode((tkn.split('.')[0] + '===').encode('ascii')).decode('ascii')
if (tknid+name) not in ids:
req = reqJSON(r)
to_return_tokens.append([token, f"{req['username']}#{req['discriminator']}", tknid, name])
to_return_tokens.append([token, f"{r.json()['username']}#{r.json()['discriminator']}", tknid, name])
ids.append(tknid+name)

return ids, to_return_tokens
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# License v3.0. A copy of this license is available at
# https://www.gnu.org/licenses/agpl-3.0.en.html

app_version = "v1.2.6"
app_version = "v1.2.7"

import time
import sys
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pycryptodome
pypiwin32
easygui
colorama
Brotli
easyyaml
tls-client>=0.2.1
easy_gui

0 comments on commit b558695

Please sign in to comment.