From b558695701033558b92c27a8f9d84a7bdfefaa9f Mon Sep 17 00:00:00 2001 From: chasa <79016507+itschasa@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:01:35 +0100 Subject: [PATCH] v1.2.7 - bug fixes --- .gitignore | 3 ++- backup.py | 10 +++++----- client_info.py | 2 +- fetch_tokens.py | 8 +------- main.py | 2 +- requirements.txt | 1 - 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index f07b2f6..c2cd8ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build/ *.pyc -*.bkup \ No newline at end of file +*.bkup +dist \ No newline at end of file diff --git a/backup.py b/backup.py index 294ac6c..15623ee 100644 --- a/backup.py +++ b/backup.py @@ -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 @@ -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: @@ -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: @@ -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 diff --git a/client_info.py b/client_info.py index 21ac2c2..81e3d03 100644 --- a/client_info.py +++ b/client_info.py @@ -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, diff --git a/fetch_tokens.py b/fetch_tokens.py index c085b79..769ddd3 100644 --- a/fetch_tokens.py +++ b/fetch_tokens.py @@ -9,7 +9,6 @@ import re import base64 import json -import brotli from Crypto.Cipher import AES from win32crypt import CryptUnprotectData @@ -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 diff --git a/main.py b/main.py index 8861182..7f16703 100644 --- a/main.py +++ b/main.py @@ -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 diff --git a/requirements.txt b/requirements.txt index 9ffd7c3..fc85d41 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ pycryptodome pypiwin32 easygui colorama -Brotli easyyaml tls-client>=0.2.1 easy_gui