├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── main.py ├── modules ├── discord.py └── tempmail.py ├── requirements.txt ├── setup.bat └── start.bat /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ['https://github.com/TheTorren/discord-token-generator/'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 TheTorren 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discord Token Generator 2 | 3 | Advanced Discord Browser Generator. 4 | 5 | It is capable of generating Unlocked Tokens for free by Using AI. 6 | Currently undetected by Discord because its Human Emulation. 7 | 8 | You will have to use HQ Proxies/IPs to get unlocked tokens. 9 | 10 | ## Features 11 | 12 | - TokenGenerator on discord.com [Almost always Unlocked] 13 | - TokenGenerator on discord.com/register [Mostly Unlocked] 14 | - Captcha Tester on hcaptcha.com 15 | 16 | ## Proxies 17 | 18 | You will have to use HQ Proxies/IPs to get Unlocked Tokens. 19 | If you really want to generate proxies, you maight have to spend fairly big amounts of money, to get undetected/unflagged IPs. 20 | If you just want to test the Generator, you can also just restart your InternetRouter (if you have a rotating IP) and Discord wont notice. 21 | 22 | (Btw your Proxy AD can stand here, DM me for offers ;d ;:D) 23 | 24 | ## Installation 25 | 26 | ### Installing with Python 27 | 28 | ```bash 29 | git clone https://github.com/TheTorren/discord-token-generator Generator 30 | cd Generator 31 | pip install -r requirements.txt 32 | playwright install 33 | python main.py 34 | ``` 35 | 36 | ### Further Requirements 37 | 38 | - Windows 39 | 40 | - [Git](https://git-scm.com/downloads) 41 | - [Pip](https://pip.pypa.io/en/stable/installation/) 42 | 43 | ## Using 44 | 45 | Type | Recommended Usage | 46 | :------- | :------------------------- | 47 | | `Token Generator` | Generating HQ token (sometimes) locked the classic way | 48 | | `Unclaimed Generator` | Generating Unclaimed, HQ (mostly) unlocked tokens | 49 | | `Captcha Tester` | Testing the CaptchaAI on hCaptcha.com | 50 | 51 | ##### Usages will be updated when Discord fixxes Modes -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import os 2 | from sys import executable 3 | 4 | try: 5 | import asyncio 6 | import logging 7 | import random 8 | import traceback 9 | import botright 10 | import httpx 11 | from pyfadecolor import Fore 12 | import validators 13 | os.system('cls') 14 | except: 15 | os.system(f"{executable} -m pip install -U logging") 16 | os.system(f"{executable} -m pip install -U asyncio") 17 | os.system(f"{executable} -m pip install -U botright") 18 | os.system(f"{executable} -m pip install -U pyfadecolor") 19 | os.system(f"{executable} -m pip install -U httpx") 20 | os.system(f"{executable} -m pip install -U validators") 21 | import asyncio 22 | import logging 23 | import random 24 | import traceback 25 | import botright 26 | from pyfadecolor import Fore 27 | import httpx 28 | import validators 29 | os.system('cls') 30 | from modules.discord import Discord 31 | from modules.tempmail import TempMail 32 | 33 | 34 | class Generator: 35 | async def initialize( 36 | self, 37 | botright_client, 38 | proxy, 39 | mode=None, 40 | output_file="output.txt", 41 | email=True, 42 | humanize=True, 43 | output_format="token:email:pass", 44 | invite_link="", 45 | ): 46 | self.output_file, self.output_format = output_file, output_format 47 | self.email_verification, self.humanize, self.invite_link = ( 48 | email, 49 | humanize, 50 | invite_link, 51 | ) 52 | self.token, self.email, self.output = "", "", "" 53 | logging.basicConfig( 54 | format="\x1b[34m[%(levelname)s] - \x1b[94mLine %(lineno)s - \x1b[36m%(funcName)s() - \x1b[96m%(message)s\x1b[0m" 55 | ) 56 | self.logger = logging.getLogger("logger") 57 | self.logger.setLevel(logging.DEBUG) 58 | self.browser = await botright_client.new_browser(proxy) 59 | self.logger.info("Spawned Browser successfully") 60 | self.page = await self.browser.new_page() 61 | if mode == 1: 62 | await self.generate_unclaimed() 63 | elif mode == 2: 64 | await self.generate_token() 65 | elif mode == 3: 66 | await self.check_captcha() 67 | return 68 | 69 | async def log_token(self): 70 | async def check_json(route, request): 71 | await route.continue_() 72 | try: 73 | response = await request.response() 74 | await response.finished() 75 | json = await response.json() 76 | if json.get("token"): 77 | self.token = json.get("token") 78 | except Exception: 79 | pass 80 | 81 | await self.page.route("https://discord.com/api/**", check_json) 82 | 83 | def log_output(self): 84 | output = "" 85 | for item in self.output_format.split(":"): 86 | if "token" in item and self.token: 87 | output += self.token + ":" 88 | if "email" in item and self.email: 89 | output += self.email + ":" 90 | if "pass" in item: 91 | output += self.browser.faker.password + ":" 92 | if "proxy" in item and self.browser.proxy: 93 | output += self.browser.proxy + ":" 94 | output = output[:-1] 95 | self.output = output 96 | 97 | async def close(self): 98 | try: 99 | await self.page.close() 100 | except: 101 | pass 102 | try: 103 | await self.browser.close() 104 | except: 105 | pass 106 | 107 | async def generate_unclaimed(self): 108 | try: 109 | try: 110 | await self.page.goto("https://discord.com/") 111 | except: 112 | self.logger.error("Site didn´t load") 113 | await self.close() 114 | return False 115 | await self.log_token() 116 | await self.page.click('[class *= "gtm-click-class-open-button"]') 117 | await self.page.type('[class *= "username"]', self.browser.faker.username) 118 | try: 119 | await self.page.click("[class *= 'checkbox']", timeout=10000) 120 | except Exception as e: 121 | self.logger.debug("No TOS Checkbox was detected") 122 | pass 123 | await self.page.click('[class *= "gtm-click-class-register-button"]') 124 | await self.page.solve_hcaptcha() 125 | while not self.token: 126 | await self.page.wait_for_timeout(2000) 127 | self.logger.info(f"Generated Token: {self.token}") 128 | await self.page.wait_for_timeout(2000) 129 | is_locked = await Discord.is_locked(self) 130 | if is_locked: 131 | self.logger.error(f"Token {self.token} is locked!") 132 | await self.close() 133 | return 134 | else: 135 | self.logger.info( 136 | f"Token: {self.token} is unlocked! Flags: {self.flags}" 137 | ) 138 | self.log_output() 139 | await self.page.wait_for_timeout(3000) 140 | try: 141 | await self.page.type( 142 | '[id="react-select-2-input"]', self.browser.faker.birth_day 143 | ) 144 | await self.page.keyboard.press("Enter") 145 | await self.page.type( 146 | '[id="react-select-3-input"]', self.browser.faker.birth_month 147 | ) 148 | await self.page.keyboard.press("Enter") 149 | await self.page.type( 150 | '[id="react-select-4-input"]', self.browser.faker.birth_year 151 | ) 152 | await self.page.keyboard.press("Enter") 153 | await self.page.wait_for_timeout(1000) 154 | await self.page.keyboard.press("Enter") 155 | except: 156 | pass 157 | for _ in range(2): 158 | try: 159 | await self.page.click("[class *= 'closeButton']", timeout=5000) 160 | except: 161 | pass 162 | if self.email_verification: 163 | self.inbox = TempMail.generateInbox() 164 | self.logger.info("Claiming Account...") 165 | await Discord.set_email(self, self.inbox.address) 166 | await self.page.wait_for_timeout(2000) 167 | self.logger.info("Verifying email...") 168 | await Discord.confirm_email(self) 169 | self.log_output() 170 | await self.page.wait_for_timeout(2000) 171 | if self.humanize: 172 | await Discord.humanize_token(self) 173 | await self.page.wait_for_timeout(2000) 174 | if self.invite_link: 175 | await Discord.join_server(self) 176 | self.log_output() 177 | with open(self.output_file, "a") as file: 178 | file.write(f"{self.output}\n") 179 | self.logger.info("Successfully Generated Account! Closing Browser...") 180 | await self.close() 181 | except: 182 | self.logger.error( 183 | f"Catched Exception, trying to save Token anyways... \n Error: \n {traceback.format_exc()}" 184 | ) 185 | if self.output: 186 | with open(self.output_file, "a") as file: 187 | file.write(f"{self.output}\n") 188 | 189 | async def generate_token(self): 190 | try: 191 | try: 192 | await self.page.goto("https://discord.com/register") 193 | except: 194 | self.logger.error("Site didn´t load") 195 | await self.close() 196 | return False 197 | await self.log_token() 198 | self.email = ( 199 | f"{self.browser.faker.username}{random.randint(10,99)}@gmail.com" 200 | ) 201 | if self.email_verification: 202 | self.inbox = TempMail.generateInbox() 203 | self.email = self.inbox.address 204 | await self.page.type('[name="email"]', self.email) 205 | await self.page.type('[name="username"]', self.browser.faker.username) 206 | await self.page.type('[name="password"]', self.browser.faker.password) 207 | await self.page.type( 208 | '[id="react-select-2-input"]', self.browser.faker.birth_day 209 | ) 210 | await self.page.keyboard.press("Enter") 211 | await self.page.type( 212 | '[id="react-select-3-input"]', self.browser.faker.birth_month 213 | ) 214 | await self.page.keyboard.press("Enter") 215 | await self.page.type( 216 | '[id="react-select-4-input"]', self.browser.faker.birth_year 217 | ) 218 | try: 219 | tos_box = self.page.locator("[type='checkbox']").first 220 | await tos_box.click() 221 | except Exception as e: 222 | self.logger.debug("No TOS Checkbox was detected") 223 | pass 224 | await self.page.click('[type="submit"]') 225 | await self.page.solve_hcaptcha() 226 | while not self.token: 227 | await self.page.wait_for_timeout(2000) 228 | self.logger.info(f"Generated Token: {self.token}") 229 | await self.page.wait_for_timeout(2000) 230 | is_locked = await Discord.is_locked(self) 231 | if is_locked: 232 | self.logger.error(f"Token {self.token} is locked!") 233 | await self.close() 234 | return 235 | else: 236 | self.logger.info( 237 | f"Token: {self.token} is unlocked! Flags: {self.flags}" 238 | ) 239 | self.log_output() 240 | await self.page.wait_for_timeout(2000) 241 | for _ in range(2): 242 | try: 243 | await self.page.click("[class *= 'closeButton']", timeout=5000) 244 | except: 245 | pass 246 | if self.email_verification: 247 | self.logger.info("Verifying email...") 248 | await Discord.confirm_email(self) 249 | self.log_output() 250 | await self.page.wait_for_timeout(2000) 251 | if self.humanize: 252 | await Discord.humanize_token(self) 253 | await self.page.wait_for_timeout(2000) 254 | if self.invite_link: 255 | await Discord.join_server(self) 256 | self.log_output() 257 | with open(self.output_file, "a") as file: 258 | file.write(f"{self.output}\n") 259 | self.logger.info("Successfully Generated Account! Closing Browser...") 260 | await self.close() 261 | except: 262 | self.logger.error( 263 | f"Catched Exception, trying to save Token anyways... \n Error: \n{traceback.format_exc()}" 264 | ) 265 | if self.output: 266 | with open(self.output_file, "a") as file: 267 | file.write(f"{self.output}\n") 268 | 269 | async def login_token(self): 270 | try: 271 | await self.page.goto("https://discord.com/register") 272 | except: 273 | self.logger.error("Site didn´t load") 274 | return False 275 | await self.page.evaluate( 276 | str( 277 | 'setInterval(() => {document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"' 278 | + self.token 279 | + '"`}, 2500); setTimeout(() => {location.reload();}, 2500);' 280 | ) 281 | ) 282 | await self.page.wait_for_timeout(5000) 283 | if self.email_verification: 284 | self.inbox = TempMail.generateInbox() 285 | self.logger.info("Claiming Account...") 286 | await Discord.set_email(self, self.inbox.address) 287 | await self.page.wait_for_timeout(2000) 288 | self.logger.info("Verifying email...") 289 | await Discord.confirm_email(self) 290 | if self.invite_link: 291 | await Discord.join_server(self) 292 | self.log_output() 293 | with open(self.output_file, "a") as file: 294 | file.write(f"{self.output}\n") 295 | self.logger.info("Successfully Generated Account! Closing Browser...") 296 | await self.close() 297 | 298 | 299 | async def main(): 300 | botright_client = await botright.Botright(headless=False) 301 | print( 302 | ' _____ __ ______ __ ______ ______ __ __\n/\\ __-. /\\ \\ /\\ ___\\ /\\ \\ /\\ __ \\ /\\ ___\\ /\\ \\/ /\n\\ \\ \\/\\ \\ \\ \\ \\ \\ \\___ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ _"-.\n \\ \\____- \\ \\_\\ \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\ \\_\\\n \\/____/ \\/_/ \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/\\/_/ | Made by TheTorren\n | https://github.com/TheTorren/discord-token-generator' 303 | ) 304 | mode = input( 305 | "[Select] - [Generation Mode]\n" 306 | + "<1> Generate Unclaimed Token\n" 307 | + "<2> Generate Token\n" 308 | + "<3> Test Captcha\n" 309 | + " " 310 | ) 311 | if mode not in ("1", "2", "3"): 312 | raise ValueError("Invalid Mode provided") 313 | else: 314 | mode = int(mode) 315 | if mode in (1, 2): 316 | email = input( 317 | "[Select] - [Email Verification]\n" 318 | + "<1> Verification Enabled\n" 319 | + "<2> No Verification\n" 320 | + " " 321 | ) 322 | if email not in ("1", "2"): 323 | raise ValueError("Invalid Mode provided") 324 | else: 325 | email = True if email == "1" else False 326 | else: 327 | email = False 328 | if mode in (1, 2): 329 | humanize = input( 330 | "[Select] - [Token Humanization]\n" 331 | + "<1> Humanization Enabled\n" 332 | + "<2> No Humanization\n" 333 | + " " 334 | ) 335 | if humanize not in ("1", "2"): 336 | raise ValueError("Invalid Mode provided") 337 | else: 338 | humanize = True if humanize == "1" else False 339 | else: 340 | humanize = False 341 | threads = input("[Input] - [Threads Amount]\n" + " ") 342 | try: 343 | threads = int(threads) 344 | except: 345 | raise ValueError("Invalid ThreadAmount provided") 346 | proxy_file = input( 347 | "[Drag&Drop] - [Proxy File]\n" 348 | + " Or Leave empty for Proxyless Mode\n" 349 | + " " 350 | ).replace('"', "") 351 | if proxy_file: 352 | if not os.path.isfile(proxy_file): 353 | raise ValueError("Provided ProxyPath isnt a file!") 354 | proxies = open(proxy_file, "r").readlines() 355 | else: 356 | proxies = None 357 | output_file = input( 358 | "[Drag&Drop] - [Output File]\n" 359 | + " Or Leave empty to use output.txt\n" 360 | + " " 361 | ).replace('"', "") 362 | if output_file: 363 | if not os.path.isfile(output_file): 364 | raise ValueError("Provided OutputPath isnt a file!") 365 | else: 366 | output_file = "output.txt" 367 | invite = input( 368 | "[Input] - [Invite Link]\n" 369 | + " Either parse a InviteLink, or an InviteCode\n" 370 | + " " 371 | ) 372 | if not validators.url(invite) and invite: 373 | invite_link = f"https://discord.gg/{invite}" 374 | if ( 375 | not validators.url(invite_link) 376 | or not httpx.get( 377 | f"https://discordapp.com/api/v8/invites/{invite}" 378 | ).is_success 379 | ): 380 | raise ValueError(f"Invalid InviteLink: {invite}") 381 | else: 382 | invite_code = invite.split("/")[-1] 383 | if ( 384 | invite 385 | and not httpx.get( 386 | f"https://discordapp.com/api/v8/invites/{invite_code}" 387 | ).is_success 388 | ): 389 | raise ValueError(f"Invalid InviteLink: {invite}") 390 | invite_link = invite 391 | output_format = input( 392 | "[Input] - [Output Format]\n" 393 | + " Token: token, Email: email, Password: pass, Proxy: proxy\n" 394 | + " Leave empty for standart output: token:email:pass\n" 395 | + " " 396 | ) 397 | if not output_format: 398 | output_format = "token:email:pass" 399 | for item in output_format.split(":"): 400 | if item not in ["token", "email", "pass", "proxy"]: 401 | raise ValueError(f"Invalid OutputItem: {item}") 402 | os.system("cls" if os.name == "nt" else "clear") 403 | try: 404 | while True: 405 | threadz = [] 406 | for _ in range(threads): 407 | proxy = random.choice(proxies) if proxies else None 408 | threadz.append( 409 | Generator().initialize( 410 | botright_client, 411 | proxy, 412 | mode, 413 | output_file, 414 | email, 415 | humanize, 416 | output_format, 417 | invite_link, 418 | ) 419 | ) 420 | await asyncio.gather(*threadz) 421 | except KeyboardInterrupt: 422 | await botright_client.close() 423 | except Exception: 424 | print(traceback.format_exc()) 425 | await botright_client.close() 426 | 427 | 428 | if __name__ == "__main__": 429 | asyncio.run(main()) 430 | -------------------------------------------------------------------------------- /modules/discord.py: -------------------------------------------------------------------------------- 1 | import random 2 | import base64 3 | import platform 4 | import re 5 | import tempfile 6 | import os 7 | import httpx 8 | from modules import tempmail 9 | 10 | res = httpx.get("https://discord.com/login").text 11 | file_with_build_num = ( 12 | "https://discord.com/assets/" 13 | + re.compile("assets/+([a-z0-9]+)\\.js").findall(res)[-2] 14 | + ".js" 15 | ) 16 | req_file_build = httpx.get(file_with_build_num).text 17 | index_of_build_num = req_file_build.find("buildNumber") + 24 18 | DISCORD_BUILD_NUM = int(req_file_build[index_of_build_num : index_of_build_num + 6]) 19 | 20 | 21 | class Discord: 22 | async def get_headers(self, payload): 23 | cookies = await self.browser.cookies() 24 | __dcfduid = [item for item in cookies if item["name"] == "__dcfduid"][0][ 25 | "value" 26 | ] 27 | __sdcfduid = [item for item in cookies if item["name"] == "__sdcfduid"][0][ 28 | "value" 29 | ] 30 | cookies = f"__dcfduid={__dcfduid}; __sdcfduid={__sdcfduid}" 31 | super_props = { 32 | "os": platform.system(), 33 | "browser": "Firefox", 34 | "release_channel": "stable", 35 | "client_version": self.browser.browser.version, 36 | "os_version": str(platform.version()), 37 | "os_arch": "x64" if platform.machine().endswith("64") else "x86", 38 | "system_locale": self.browser.faker.locale, 39 | "client_build_number": DISCORD_BUILD_NUM, 40 | "client_event_source": None, 41 | } 42 | super_props = base64.b64encode(str(super_props).encode()).decode() 43 | headers = { 44 | "accept": "*/*", 45 | "accept-encoding": "gzip, deflate, br", 46 | "accept-language": "de,de-DE;q=0.9", 47 | "authorization": self.token, 48 | "content-length": str(len(str(payload))), 49 | "content-type": "application/json", 50 | "cookie": cookies, 51 | "origin": "https://discord.com", 52 | "referer": "https://discord.com/channels/@me", 53 | "sec-fetch-dest": "empty", 54 | "sec-fetch-mode": "cors", 55 | "sec-fetch-site": "same-origin", 56 | "user-agent": self.browser.faker.useragent, 57 | "x-discord-locale": "en", 58 | "x-super-properties": super_props, 59 | } 60 | return headers 61 | 62 | async def humanize_token(self): 63 | await self.page.goto("https://discord.com/channels/@me") 64 | await self.page.wait_for_timeout(1000) 65 | settings_button = self.page.locator('[class *= "button-12Fmur"]').last 66 | await settings_button.click() 67 | await self.page.wait_for_timeout(500) 68 | profile_button = self.page.locator('[class *= "item-3XjbnG"]').nth(6) 69 | await profile_button.click() 70 | await self.page.wait_for_timeout(random.randint(2000, 3000)) 71 | pics = httpx.get( 72 | "https://api.github.com/repos/itschasa/Discord-Scraped/git/trees/cbd70ab66ea1099d31d333ab75e3682fd2a80cff" 73 | ) 74 | random_pic = random.choice(pics.json().get("tree")).get("path") 75 | pic_url = f"https://raw.githubusercontent.com/itschasa/Discord-Scraped/main/avatars/{random_pic}" 76 | pic = httpx.get(pic_url).content 77 | temp_file = tempfile.NamedTemporaryFile(suffix=".jpg", delete=False) 78 | temp_file.write(pic) 79 | temp_file.file.seek(0) 80 | self.page.on( 81 | "filechooser", lambda file_chooser: file_chooser.set_files(temp_file.name) 82 | ) 83 | upload_avatar_button = self.page.locator( 84 | '[class *= "buttonsContainer-12kYno"]' 85 | ).locator('[class *= "lookFilled-yCfaCM "]') 86 | await upload_avatar_button.click() 87 | await self.page.wait_for_timeout(random.randint(500, 1000)) 88 | upload_own = self.page.locator('[class *= "file-input"]') 89 | await upload_own.click() 90 | await self.page.wait_for_timeout(random.randint(500, 1000)) 91 | confirm_button = self.page.locator('[class *= "button-f2h6uQ"]').last 92 | await confirm_button.click() 93 | temp_file.close() 94 | os.unlink(temp_file.name) 95 | await self.page.wait_for_timeout(random.randint(2000, 3000)) 96 | try: 97 | quote = httpx.get("https://free-quotes-api.herokuapp.com") 98 | quote = quote.json().get("quote") 99 | except: 100 | self.logger.warning( 101 | 'Couldnt Get a Random Quote, Setting "Dislock" as AboutMe' 102 | ) 103 | quote = "Dislock" 104 | profile_button = self.page.locator('[role="textbox"]') 105 | await profile_button.click() 106 | await self.page.keyboard.type(quote) 107 | await self.page.wait_for_timeout(random.randint(500, 1000)) 108 | confirm_button = self.page.locator('[class *= "colorGreen-3y-Z79"]').last 109 | await confirm_button.click() 110 | hypesquad_button = self.page.locator('[aria-controls="hypesquad-online-tab"]') 111 | await hypesquad_button.click() 112 | await self.page.wait_for_timeout(random.randint(5000, 6000)) 113 | is_locked = await Discord.is_locked(self) 114 | if is_locked: 115 | self.logger.error(f"Token {self.token} got locked whilst humanizing!") 116 | await self.close() 117 | return 118 | self.log_output() 119 | self.logger.info(f"Set Bio and ProfilePic!") 120 | 121 | async def join_server(self): 122 | await self.page.goto("https://discord.com/channels/@me") 123 | await self.page.wait_for_timeout(1000) 124 | create_join_button = self.page.locator( 125 | '[data-list-item-id *= "create-join-button"]' 126 | ) 127 | await create_join_button.click() 128 | await self.page.wait_for_timeout(500) 129 | another_server_button = self.page.locator('[class *= "footerButton-24QPis"]') 130 | await another_server_button.click() 131 | await self.page.wait_for_timeout(1000) 132 | await self.page.type("[placeholder='https://discord.gg/dev']", self.invite_link) 133 | join_server_button = self.page.locator('[class *= "lookFilled-yCfaCM"]').last 134 | await join_server_button.click() 135 | try: 136 | await self.page.solve_hcaptcha() 137 | except: 138 | self.logger.info("No JoinServer Captcha detected.") 139 | is_locked = await Discord.is_locked(self) 140 | if is_locked: 141 | self.logger.error(f"Token {self.token} got locked whilst joining a Server!") 142 | await self.close() 143 | return 144 | self.log_output() 145 | self.logger.info("Joined Server successfully.") 146 | 147 | async def is_locked(self): 148 | token_check = await self.page.request.get( 149 | "https://discord.com/api/v9/users/@me/library", 150 | headers={"Authorization": self.token}, 151 | ) 152 | token_check = token_check.status == 200 153 | if token_check: 154 | r = await self.page.request.get( 155 | "https://discord.com/api/v9/users/@me", 156 | headers={"Authorization": self.token}, 157 | ) 158 | response = await r.json() 159 | self.id = response.get("id") 160 | self.email = response.get("email") 161 | self.username = response.get("username") 162 | self.discriminator = response.get("discriminator") 163 | self.tag = f"{self.username}#{self.discriminator}" 164 | self.flags = response.get("public_flags") 165 | return not token_check 166 | 167 | async def set_email(self, email): 168 | try: 169 | await self.page.goto("https://discord.com/channels/@me") 170 | await self.page.wait_for_timeout(1000) 171 | settings_button = self.page.locator('[class *= "button-12Fmur"]').last 172 | await settings_button.click() 173 | await self.page.wait_for_timeout(500) 174 | settings_button = self.page.locator('[class *= "fieldButton-14lHvK"]').nth( 175 | 1 176 | ) 177 | await settings_button.click() 178 | mail_input = self.page.locator('[type="text"]').last 179 | await mail_input.type(email) 180 | password_input = self.page.locator('[type="password"]').last 181 | await password_input.type(self.browser.faker.password) 182 | claim_button = self.page.locator('[type="submit"]').last 183 | await claim_button.click() 184 | except Exception as e: 185 | print(e) 186 | 187 | async def confirm_email(self): 188 | before_token = self.token 189 | self.logger.info("Confirming Email...") 190 | self.scrape_emails = True 191 | while self.scrape_emails: 192 | emails = tempmail.TempMail.getEmails(self.inbox) 193 | for mail in emails: 194 | if "mail.discord.com" in str(mail.sender): 195 | for word in mail.body.split(): 196 | if "https://click.discord.com" in word: 197 | self.email_link = word 198 | self.scrape_emails = False 199 | break 200 | self.email_link = self.email_link.replace("[", "").replace("]", "") 201 | self.logger.info("Waiting 10 seconds for a more realistic email-verify") 202 | await self.page.wait_for_timeout(random.randint(10000, 12000)) 203 | await self.page.goto(self.email_link) 204 | try: 205 | await self.page.solve_hcaptcha() 206 | except: 207 | self.logger.info("No EmailCaptcha detected") 208 | while self.token == before_token: 209 | await self.page.wait_for_timeout(1000) 210 | is_locked = await Discord.is_locked(self) 211 | if is_locked: 212 | self.logger.error( 213 | f"Token {self.token} got locked whilst verifying the Email!" 214 | ) 215 | await self.close() 216 | return 217 | self.log_output() 218 | return True 219 | -------------------------------------------------------------------------------- /modules/tempmail.py: -------------------------------------------------------------------------------- 1 | import json 2 | import random 3 | import httpx 4 | 5 | DOMAINS = ["gmailb.tk", "gmailb.ml", "gmailb.ga"] 6 | 7 | 8 | class TempMail: 9 | global BASE_URL 10 | BASE_URL = "https://api.tempmail.lol" 11 | 12 | def makeHTTPRequest(endpoint): 13 | headers = {"User-Agent": "TempMailPythonAPI/1.0", "Accept": "application/json"} 14 | try: 15 | connection = httpx.get(BASE_URL + endpoint, headers=headers) 16 | if connection.status_code >= 400: 17 | raise Exception("HTTP Error: " + str(connection.status_code)) 18 | except Exception as e: 19 | print(e) 20 | return None 21 | response = connection.text 22 | return response 23 | 24 | def generateInbox(rush=False): 25 | try: 26 | random_domain = random.choice(DOMAINS) 27 | s = TempMail.makeHTTPRequest(f"/generate/{random_domain}") 28 | except: 29 | print("Website responded with: " + s) 30 | data = json.loads(s) 31 | return Inbox(data["address"], data["token"]) 32 | 33 | def getEmails(inbox): 34 | s = TempMail.makeHTTPRequest("/auth/" + inbox.token) 35 | data = json.loads(s) 36 | if "token" in s: 37 | if data["token"] == "invalid": 38 | raise Exception("Invalid Token") 39 | if data["email"] == None: 40 | return ["None"] 41 | else: 42 | emails = [] 43 | for email in data["email"]: 44 | emails.append( 45 | Email( 46 | email["from"], 47 | email["to"], 48 | email["subject"], 49 | email["body"], 50 | email["html"], 51 | email["date"], 52 | ) 53 | ) 54 | return emails 55 | 56 | 57 | class Email: 58 | def __init__(self, sender, recipient, subject, body, html, date): 59 | self._sender = sender 60 | self._recipient = recipient 61 | self._subject = subject 62 | self._body = body 63 | self._html = html 64 | self._date = date 65 | 66 | @property 67 | def sender(self): 68 | return self._sender 69 | 70 | @property 71 | def recipient(self): 72 | return self._recipient 73 | 74 | @property 75 | def subject(self): 76 | return self._subject 77 | 78 | @property 79 | def body(self): 80 | return self._body 81 | 82 | @property 83 | def html(self): 84 | return self._html 85 | 86 | @property 87 | def date(self): 88 | return self._date 89 | 90 | def __repr__(self): 91 | return "Email (sender={}, recipient={}, subject={}, body={}, html={}, date={} )".format( 92 | self.sender, self.recipient, self.subject, self.body, self.html, self.date 93 | ) 94 | 95 | 96 | class Inbox: 97 | def __init__(self, address, token): 98 | self._address = address 99 | self._token = token 100 | 101 | @property 102 | def address(self): 103 | return self._address 104 | 105 | @property 106 | def token(self): 107 | return self._token 108 | 109 | def __repr__(self): 110 | return "Inbox (address={}, token={} )".format(self.address, self.token) 111 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | botright 2 | httpx~=0.23.0 3 | validators~=0.20.0 4 | pyfadecolor -------------------------------------------------------------------------------- /setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | pip install -U -r requirements.txt 3 | cls 4 | pause -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | cls 2 | python main.py 3 | pause --------------------------------------------------------------------------------