├── README.md └── main.py /README.md: -------------------------------------------------------------------------------- 1 | # Discord Account Creator 2 | Python script to automatically create Discord accounts. 3 | 4 | ### Features: 5 | - Use only one email address (with the [gmail dot trick](https://support.google.com/mail/answer/7436150)) 6 | - Automatically fetch account tokens 7 | - Log emails, passwords, and tokens in a file 8 | 9 | ### Requirements (`pip install`): 10 | - undetected-chromedriver 11 | - selenium 12 | 13 | ### Notes: 14 | - Use a long enough email address for the trick to work properly 15 | - You should use a VPN to avoid getting your IP marked suspicious 16 | - Using a VPN or making too many accounts may get new accounts locked out 17 | - Don't forget to press enter after completing a captcha 18 | 19 | ##### Do note that I am NOT responsible for any activities you decide to use this for, nor anything that happens to you as a result. 20 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.support import expected_conditions as EC 2 | from selenium.common.exceptions import TimeoutException 3 | from selenium.webdriver.support.ui import WebDriverWait 4 | from selenium.webdriver.common.by import By 5 | import undetected_chromedriver.v2 as uc 6 | import random 7 | import time 8 | import os 9 | 10 | termsize = os.get_terminal_size()[0] 11 | left = ' '*int(termsize/4) 12 | 13 | 14 | def write(*args, **kwargs): 15 | print(left, *args, **kwargs) 16 | 17 | 18 | def ask(prompt): 19 | write(prompt, end='') 20 | return input() 21 | 22 | 23 | def intro(text): 24 | text = text.split('\n') 25 | for t in text: 26 | print(f'{t : ^{termsize}}') 27 | 28 | 29 | os.system('cls' if os.name == 'nt' else 'clear') 30 | bars = '-'*(termsize//2) 31 | intro(bars + '\nDiscord Account Creator\n\nMade by Music_Dude#0001\nhttps://github.com/Music-Dude\n' + bars + '\n\n') 32 | 33 | driver = uc.Chrome() 34 | pwchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' 35 | 36 | 37 | def get_emails(username): 38 | if len(username) < 2: 39 | yield username 40 | else: 41 | head = username[0] 42 | tail = username[1:] 43 | 44 | for item in get_emails(tail): 45 | yield head + item 46 | yield head + '.' + item 47 | 48 | 49 | def logout(driver: uc.Chrome): 50 | """Log out of Discord to create another account""" 51 | driver.execute_script( 52 | 'setInterval(()=>{document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token=null},50),setTimeout(()=>{location.reload()},0);') 53 | time.sleep(2) 54 | driver.delete_all_cookies() 55 | 56 | 57 | email = ask('Enter your GMAIL address: ').split('@')[0].replace('.', '') 58 | write( 59 | f'That email address will be able to create {2**len(email)//2} accounts.') 60 | numaccounts = int( 61 | ask('What is the maximum number of accounts you would like to generate: ')) 62 | emails = get_emails(email) 63 | 64 | startTime = time.time()/60 65 | with driver: 66 | for i in range(1, numaccounts+1): 67 | print('\n') 68 | write(f'Creating account #{i}...') 69 | 70 | email = next(emails) + '@gmail.com' 71 | password = ''.join(random.choices(pwchars, k=8)) 72 | month = random.choice(['January', 'February', 'March', 'April', 'May', 73 | 'June', 'July', 'August', 'September', 'October', 'November', 'December']) 74 | day = str(random.randint(1, 28)) 75 | year = str(random.randint(1980, 2003)) 76 | 77 | driver.get('https://discord.com/register') 78 | write(f'Using credentials {email}:{password}') 79 | 80 | elems = driver.find_elements_by_tag_name('input') 81 | keys = (email, password, password, month+'\ue004', day, year) 82 | 83 | for text, elem in zip(keys, elems): 84 | elem.send_keys(text) 85 | time.sleep(0.05) 86 | 87 | try: 88 | driver.find_element_by_css_selector( 89 | 'input[type="checkbox"]').click() 90 | except: 91 | pass 92 | 93 | driver.find_elements_by_tag_name('button')[0].click() 94 | 95 | while driver.find_element_by_text('You are being rate limited.'): 96 | ask( 97 | 'You are being rate limited. Press enter when you\'d like to continue. . .') 98 | driver.find_elements_by_tag_name('button')[0].click() 99 | 100 | try: 101 | WebDriverWait(driver, 20).until( 102 | EC.presence_of_element_located((By.TAG_NAME, 'iframe'))) 103 | ask('Is there a captcha? Press enter once you\'ve completed it.') 104 | except TimeoutException: 105 | pass 106 | 107 | try: 108 | WebDriverWait(driver, 10).until( 109 | lambda driver: driver.current_url != 'https://discord.com/register') 110 | 111 | token = driver.execute_script( 112 | 'location.reload();var i=document.createElement("iframe");document.body.appendChild(i);return i.contentWindow.localStorage.token').strip('"') 113 | use = True 114 | 115 | try: 116 | driver.find_element_by_text('Log Out').click() 117 | keep = ask( 118 | f'The account [{token}] was locked out. Would you like to keep it? [Y/N] ') 119 | 120 | if 'y' in keep.lower(): 121 | write('Okay, writing to file. . .') 122 | else: 123 | write('Okay, this account won\'t be saved') 124 | use = False 125 | except AttributeError: 126 | pass 127 | 128 | if use: 129 | write(f'Successully created account! Token: {token}\n') 130 | with open('accounts.txt', 'a+') as file: 131 | file.write(f'{email}:{password}:{token}\n') 132 | except TimeoutException: 133 | pass 134 | finally: 135 | logout(driver) 136 | 137 | write('Results:') 138 | write( 139 | f'Created {numaccounts} accounts in {time.time()/60-startTime:0.2F} minutes.') 140 | write('Credentials are stored in the file \'accounts.txt\'.') 141 | ask('Press enter to exit.') 142 | 143 | driver.quit() 144 | --------------------------------------------------------------------------------