|
4 | 4 | Copyright (c) 2022 DaniDuese |
5 | 5 |
|
6 | 6 | """ |
7 | | -import aiohttp |
8 | | -import asyncio |
9 | | -import os |
10 | | -os.system("pip install tasksio") |
11 | | -import sys |
12 | | -from colorama import Fore |
13 | | -import tasksio |
14 | | -import requests |
15 | | -from typing import Optional |
16 | 7 | from ab5 import hgratient |
| 8 | +from typing import Optional |
| 9 | +import colorama |
| 10 | +import sys |
| 11 | +from pystyle import Center, Colorate, Colors, Write |
| 12 | +import tls_client |
| 13 | +import os |
17 | 14 |
|
18 | | -def setTitle(title: Optional[any]=None): |
| 15 | + |
| 16 | +def setTitle(title: Optional[any] = None): |
19 | 17 | os.system("title "+title) |
20 | 18 |
|
| 19 | + |
21 | 20 | setTitle("BitBoost | Server Booster") |
22 | 21 |
|
| 22 | + |
23 | 23 | def clear(): |
24 | 24 | if sys.platform in ["linux", "linux2", "darwin"]: |
25 | 25 | os.system("clear") |
26 | 26 | else: |
27 | 27 | os.system("cls") |
28 | | -clear() |
29 | | - |
30 | | -async def join_server(token, inv): |
31 | | - headers = {"Authorization": token, "accept": "*/*", "accept-language": "en-US", "connection": "keep-alive", "cookie": f'__cfduid={os.urandom(43).hex()}; __dcfduid={os.urandom(32).hex()}; locale=en-US', "DNT": "1", "origin": "https://discord.com", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "referer": "https://discord.com/channels/@me", "TE": "Trailers", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9001 Chrome/83.0.4103.122 Electron/9.3.5 Safari/537.36", "X-Super-Properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDAxIiwib3NfdmVyc2lvbiI6IjEwLjAuMTkwNDIiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6ODMwNDAsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9"} |
32 | | - async with aiohttp.ClientSession(headers=headers) as serverjoinersession: |
33 | | - async with serverjoinersession.post(f"https://discord.com/api/v9/invites/{inv}") as response: |
34 | | - master = headers + "https://discord.com/api/v9/users/@me" |
35 | | - if response.status in (204, 200, 201): |
36 | | - print(f" Successfully Joined Server") |
37 | | - else: |
38 | | - print(f" Failed To Join Server, Status Code: {response.status}") |
39 | | - print(" Please try again") |
40 | | - |
41 | | -async def boost_server(guildid, token): |
42 | | - headers = {"Authorization": token, "accept": "*/*", "accept-language": "en-US", "connection": "keep-alive", "cookie": f'__cfduid={os.urandom(43).hex()}; __dcfduid={os.urandom(32).hex()}; locale=en-US', "DNT": "1", "origin": "https://discord.com", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "referer": "https://discord.com/channels/@me", "TE": "Trailers", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9001 Chrome/83.0.4103.122 Electron/9.3.5 Safari/537.36", "X-Super-Properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDAxIiwib3NfdmVyc2lvbiI6IjEwLjAuMTkwNDIiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6ODMwNDAsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9"} |
43 | | - async with aiohttp.ClientSession(headers=headers) as ClientSession: |
44 | | - async with ClientSession.get(f"https://discord.com/api/v9/users/@me/guilds/premium/subscription-slots") as nvmmm: |
45 | | - if nvmmm.status == 200: |
46 | | - idk_var = await nvmmm.json() |
47 | | - for varr in idk_var: |
48 | | - id__ = varr['id'] |
49 | | - payload = {"user_premium_guild_subscription_slot_ids": [id__]} |
50 | | - master = 0 + "v9/guilds" |
51 | | - async with ClientSession.put(f"https://discord.com/api/v9/guilds/{guildid}/premium/subscriptions", json=payload) as boost_req: |
52 | | - btxt = await boost_req.text() |
53 | | - if "id" in btxt: |
54 | | - print(f" Successfully Boosted Server") |
55 | | - else: |
56 | | - print(" Failed To Boost Server, Unknown Error Occurred") |
57 | | - |
58 | | - |
59 | | -banner = f"""\n{Fore.BLUE}[1]{Fore.RESET} Server Joiner\n\n{Fore.BLUE}[2]{Fore.RESET} Boost Server\n""" |
60 | | - |
61 | 28 |
|
62 | | -async def start_join(inv): |
63 | | - async with tasksio.TaskPool(10_000) as pool: |
64 | | - for token in open('tokens.txt', 'r').readlines(): |
65 | | - tk = token.strip() |
66 | | - await pool.put(join_server(tk, inv)) |
67 | | - |
68 | | -async def start_boost(id): |
69 | | - async with tasksio.TaskPool(10_000) as pool: |
70 | | - for token in open('tokens.txt', 'r').readlines(): |
71 | | - tk = token.strip() |
72 | | - await pool.put(boost_server(id, tk)) |
| 29 | +clear() |
73 | 30 |
|
| 31 | +sub_ids = [] |
74 | 32 | logo = ("""__________.__ __ __________ __ |
75 | 33 | \______ \__|/ |\______ \ ____ ____ _______/ |_ |
76 | 34 | | | _/ \ __\ | _// _ \ / _ \/ ___/\ __\ |
77 | 35 | | | \ || | | | ( <_> | <_> )___ \ | | |
78 | 36 | |______ /__||__| |______ /\____/ \____/____ > |__| |
79 | 37 | \/ \/ \/ """) |
| 38 | +banner = ("""Please make sure that all your tokens are already in the server you want to boost.\n""") |
80 | 39 |
|
81 | | -print(hgratient(logo,[0,223,50],[0,25,222])) |
| 40 | +print(hgratient(logo, [0, 223, 50], [0, 25, 222])) |
82 | 41 | print(banner) |
83 | | -ch = input("Choice: ") |
84 | | -try: |
85 | | - c = int(ch) |
86 | | -except ValueError: |
87 | | - print(" Use Number To Choose.") |
88 | | - sys.exit() |
89 | | - |
90 | | -if c == 1: |
91 | | - invv = input(" Enter Invite Code: discord.gg/") |
92 | | - asyncio.run(start_join(invv)) |
93 | | -elif c == 2: |
94 | | - g = int(input("| Enter Guild ID: ")) |
95 | | - asyncio.run(start_boost(g)) |
96 | | -else: |
97 | | - print(" Invaild Option") |
98 | | - exit(0) |
| 42 | +__guild_id__ = Write.Input("Guild ID: ", Colors.blue_to_green, interval=0.05) |
| 43 | +colorama.init(convert=True) |
| 44 | + |
| 45 | + |
| 46 | +class Nitro: |
| 47 | + def __init__(self, token: str): |
| 48 | + self.token = token |
| 49 | + self.headers = { |
| 50 | + "accept": "*/*", |
| 51 | + "accept-encoding": "gzip, deflate, br", |
| 52 | + "accept-language": "en-US", |
| 53 | + "authorization": token, |
| 54 | + "referer": "https://discord.com/channels/@me", |
| 55 | + "sec-fetch-dest": "empty", |
| 56 | + "sec-fetch-mode": "cors", |
| 57 | + "sec-fetch-site": "same-origin", |
| 58 | + "user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9007 Chrome/91.0.4472.164 Electron/13.6.6 Safari/537.36", |
| 59 | + "x-debug-options": "bugReporterEnabled", |
| 60 | + "x-discord-locale": "en-US", |
| 61 | + "x-super-properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDA3Iiwib3NfdmVyc2lvbiI6IjEwLjAuMTkwNDMiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6MTYxODQyLCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==" |
| 62 | + } |
| 63 | + self.session = tls_client.Session(client_identifier="chrome_107") |
| 64 | + self.sub_ids = [] |
| 65 | + |
| 66 | + def removeTokenFromTxt(self): |
| 67 | + with open("tokens.txt", "r") as f: |
| 68 | + lines = f.readlines() |
| 69 | + with open("tokens.txt", "w") as f: |
| 70 | + for line in lines: |
| 71 | + if line.strip("\n") != self.token: |
| 72 | + f.write(line) |
| 73 | + |
| 74 | + def hasNitro(self): |
| 75 | + sex = self.session.get( |
| 76 | + "https://discord.com/api/v9/users/@me/guilds/premium/subscription-slots", |
| 77 | + headers=self.headers, |
| 78 | + ) |
| 79 | + if sex.status_code in [403, 401]: |
| 80 | + return self._extracted_from_hasNitro_7('Token is invalid, removing.') |
| 81 | + try: |
| 82 | + for sub in sex.json(): |
| 83 | + self.sub_ids.append(sub["id"]) |
| 84 | + except Exception as e: |
| 85 | + print(e) |
| 86 | + print(sex.text) |
| 87 | + if len(self.sub_ids) == 0: |
| 88 | + return self._extracted_from_hasNitro_7('Token has no nitro, removing.') |
| 89 | + log(f"{colorama.Fore.GREEN}Token has nitro.") |
| 90 | + return True |
| 91 | + |
| 92 | + # TODO Rename this here and in `hasNitro` |
| 93 | + def _extracted_from_hasNitro_7(self, arg0): |
| 94 | + log(f"{colorama.Fore.RED}{arg0}") |
| 95 | + self.removeTokenFromTxt() |
| 96 | + return False |
| 97 | + |
| 98 | + def boostServer(self, guildID): |
| 99 | + for i in range(len(self.sub_ids)): |
| 100 | + self.headers["Content-Type"] = "application/json" |
| 101 | + r = self.session.put( |
| 102 | + url=f"https://discord.com/api/v9/guilds/{guildID}/premium/subscriptions", |
| 103 | + headers=self.headers, |
| 104 | + json={ |
| 105 | + "user_premium_guild_subscription_slot_ids": [f"{self.sub_ids[i]}"] |
| 106 | + }, |
| 107 | + ) |
| 108 | + if r.status_code == 201: |
| 109 | + log( |
| 110 | + f"{colorama.Fore.GREEN}Boosted {i + 1} of {len(sub_ids)} from {self.token[25:]}" |
| 111 | + ) |
| 112 | + elif r.status_code == 400: |
| 113 | + log( |
| 114 | + f"{colorama.Fore.YELLOW}Boost already used {i + 1} of {len(sub_ids)} from {self.token[25:]}" |
| 115 | + ) |
| 116 | + else: |
| 117 | + log(f"{colorama.Fore.RED}ERROR: {r.status_code}") |
| 118 | + |
| 119 | + |
| 120 | +def log(text): |
| 121 | + print(f"{text}{colorama.Fore.RESET}") |
| 122 | + |
| 123 | + |
| 124 | +def main(): |
| 125 | + with open("tokens.txt", "r") as f: |
| 126 | + tokens = f.read().splitlines() |
| 127 | + for token in tokens: |
| 128 | + nitro = Nitro(token) |
| 129 | + if nitro.hasNitro(): |
| 130 | + nitro.boostServer(__guild_id__) |
| 131 | + |
| 132 | + |
| 133 | +if __name__ == "__main__": |
| 134 | + main() |
| 135 | + input("Press enter to exit.") |
0 commit comments