├── .gitignore ├── AutoReg4MSChatGPT.iml ├── AutoRegOutlook.py ├── ChatGPTSmsVerify.py ├── GetApiKey.py ├── HelloChatGPT.py ├── LICENSE ├── README.md ├── api.csv ├── chatgpt.csv ├── ok.csv ├── outlook.csv └── requirements.txt /.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 | 131 | # idea 132 | .idea/ 133 | *.iml -------------------------------------------------------------------------------- /AutoReg4MSChatGPT.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AutoRegOutlook.py: -------------------------------------------------------------------------------- 1 | """ 2 | 基于selenium的Outlook自动注册脚本,每个IP只能注册3个邮箱,没有实现代理IP池,所以需要手动更换IP。 3 | 未实现通过验证码注册,需要手动进行验证码识别。 4 | 5 | Author: Eli Lee 6 | Version: 1.0 7 | Reference: https://github.com/EricProgrammerBLM/Outlook-Email-Sign-Up 8 | Export: outlook.csv 9 | 10 | """ 11 | 12 | import csv 13 | 14 | from selenium import webdriver 15 | from selenium.webdriver.common.by import By 16 | from selenium.webdriver.edge.options import Options 17 | from selenium.webdriver.edge.service import Service 18 | from selenium.webdriver.support.ui import Select 19 | import random 20 | 21 | from webdriver_manager.microsoft import EdgeChromiumDriverManager 22 | 23 | 24 | def shuffle(arr): 25 | random.shuffle(arr) 26 | return arr 27 | 28 | 29 | def register(prefix, password, first_name, last_name, year, month, day): 30 | options = Options() 31 | options.add_argument("--inprivate") # 启用Edge浏览器无痕模式 32 | 33 | service = Service(executable_path=EdgeChromiumDriverManager().install()) 34 | driver = webdriver.Edge(service=service, options=options) 35 | 36 | driver.get( 37 | 'https://signup.live.com/newuser.aspx?contextid=A34663E86ABA02E6&uiflavor=web&lic=1&mkt=EN-US&lc=1033&uaid' 38 | '=412e188e23334594ad53f1a33880cf67') 39 | driver.implicitly_wait(20) 40 | driver.find_element(By.ID, 'liveSwitch').click() 41 | driver.find_element(By.NAME, 'MemberName').send_keys(prefix) # Email 42 | driver.find_element(By.ID, 'iSignupAction').click() 43 | driver.implicitly_wait(20) 44 | driver.find_element(By.ID, 'PasswordInput').send_keys(password) # Password 45 | driver.find_element(By.ID, 'iSignupAction').click() 46 | driver.implicitly_wait(20) 47 | driver.find_element(By.NAME, 'FirstName').send_keys(first_name) 48 | driver.find_element(By.NAME, 'LastName').send_keys(last_name) 49 | driver.find_element(By.ID, 'iSignupAction').click() 50 | driver.implicitly_wait(20) 51 | 52 | # Choosing Birth Month 53 | opt = driver.find_element(By.XPATH, '//*[@id="BirthMonth"]') 54 | dropdown = Select(opt) 55 | dropdown.select_by_index(month) 56 | # Choosing Birth Day 57 | opt = driver.find_element(By.XPATH, '//*[@id="BirthDay"]') 58 | dropdown = Select(opt) 59 | dropdown.select_by_index(day) 60 | # Typing in Birth Year 61 | driver.find_element(By.XPATH, '//*[@id="BirthYear"]').send_keys(year) 62 | driver.find_element(By.ID, 'iSignupAction').click() 63 | return driver 64 | 65 | 66 | # 随机生成生日年份 67 | def random_brith_year(): 68 | return random.randint(1980, 2003) 69 | 70 | 71 | # 随机生成生日月份 72 | def random_brith_month(): 73 | months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] 74 | return shuffle(months)[0] 75 | 76 | 77 | # 随机生成生日日期 78 | def random_brith_day(): 79 | days = [1, 3, 6, 12, 16, 20, 25, 26, 2] 80 | return shuffle(days)[0] 81 | 82 | 83 | # 随机生成FirstName 84 | def random_firstname(): 85 | first_name = ['John', 'James', 'Robert', 'Michael', 'William', 'David', 'Richard', 'Charles', 'Joseph', 'Thomas', 86 | 'Christopher', 'Daniel', 'Paul', 'Mark', 'Donald', 'George', 'Kenneth', 'Steven', 'Edward', 'Brian', 87 | 'Ronald', 'Anthony', 'Kevin', 'Jason', 'Matthew', 'Gary', 'Timothy', 'Jose', 'Larry', 'Jeffrey', 88 | 'Frank', 'Scott', 'Eric'] 89 | return shuffle(first_name)[0] 90 | 91 | 92 | # 随机生成LastName 93 | def random_lastname(): 94 | last_name = ['Smith', 'Johnson', 'Williams', 'Jones', 'Brown', 'Davis', 'Miller', 'Wilson', 'Moore', 'Taylor', 95 | 'Anderson', 'Thomas', 'Jackson', 'White', 'Harris', 'Martin', 'Thompson', 'Garcia', 'Martinez', 96 | 'Robinson', 'Clark', 'Rodriguez', 'Lewis', 'Lee', 'Walker', 'Hall', 'Allen', 'Young', 'Hernandez', 97 | 'King', 'Wright', 'Lopez', 'Hill', 'Scott', 'Green', 'Adams', 'Baker', 'Gonzalez', 'Nelson', 'Carter', 98 | 'Mitchell', 'Perez', 'Roberts', 'Turner', 'Phillips', 'Campbell', 'Parker', 'Evans', 'Edwards', 99 | 'Collins'] 100 | return shuffle(last_name)[0] 101 | 102 | 103 | # 随机生成16位密码 104 | def random_password(): 105 | password = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(16)) 106 | return password 107 | 108 | 109 | # 随机生成 16位邮箱前缀 110 | def random_email_prefix(): 111 | char = random.choice('abcdefghijklmnopqrstuvwxyz') 112 | # 邮箱前缀必须以字母开头 113 | prefix = char + ''.join(random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for _ in range(15)) 114 | return prefix 115 | 116 | 117 | def main(): 118 | while True: 119 | prefix = random_email_prefix() 120 | password = random_password() 121 | first_name = random_firstname() 122 | last_name = random_lastname() 123 | year = random_brith_year() 124 | month = random_brith_month() 125 | day = random_brith_day() 126 | 127 | driver = None 128 | try: 129 | driver = register(prefix, password, first_name, last_name, year, month, day) 130 | # ask customer to confirm if operation was successful 131 | while True: 132 | confirm = input("Was operation successful? (y/n): ") 133 | if confirm.lower() == 'y': 134 | # write registration details to a csv file 135 | with open('outlook.csv', 'a', newline='') as csv_file: 136 | writer = csv.writer(csv_file) 137 | writer.writerow([prefix + '@outlook.com', password]) 138 | break 139 | elif confirm.lower() == 'n': 140 | break 141 | else: 142 | print("Invalid input. Please enter 'y' or 'n'.") 143 | except Exception as e: 144 | print(f"Error: {e}") 145 | continue 146 | finally: 147 | if driver is not None: 148 | try: 149 | driver.quit() 150 | except Exception as ex: 151 | print("Error occurred while quitting: ", ex) 152 | 153 | 154 | if __name__ == '__main__': 155 | main() 156 | -------------------------------------------------------------------------------- /ChatGPTSmsVerify.py: -------------------------------------------------------------------------------- 1 | """ 2 | 基于undetected_edgedriver的ChatGPT自动手机号验证脚本。 3 | selenium不能通过cf盾,使用undetected_edgedriver可以绕过cf盾。 4 | 偶尔会弹出cf盾验证,需要手动验证。 5 | 6 | Author: Eli Lee 7 | Version: 1.0 8 | Import: ok.csv 9 | Export: chatgpt.csv 10 | 11 | """ 12 | 13 | import csv 14 | 15 | from selenium.webdriver.common.by import By 16 | from selenium.webdriver.support import expected_conditions as ec 17 | from selenium.webdriver.support.ui import WebDriverWait 18 | from smsactivate.api import SMSActivateAPI 19 | from undetected_edgedriver import Edge, EdgeOptions 20 | from webdriver_manager.microsoft import EdgeChromiumDriverManager 21 | 22 | 23 | def register(mail, password, sa, number): 24 | options = EdgeOptions() 25 | options.add_argument("--inprivate") # 启用Edge浏览器无痕模式 26 | driver = Edge(driver_executable_path=EdgeChromiumDriverManager().install(), options=options) 27 | wait = WebDriverWait(driver, 60) # 最长等待时间为60秒 28 | driver.get('https://chat.openai.com/auth/login') 29 | wait.until(ec.title_contains('ChatGPT | OpenAI')) # 等待标题包含“Log In - OpenAI Chat” 30 | driver.find_element(By.XPATH, 31 | '//div[@class="flex w-full items-center justify-center gap-2" and text()="Sign up"]').click() 32 | wait.until(ec.element_to_be_clickable( 33 | (By.XPATH, '//span[@class="c47d81fe7" and text()="Continue with Microsoft Account"]'))) 34 | driver.find_element(By.XPATH, '//span[@class="c47d81fe7" and text()="Continue with Microsoft Account"]').click() 35 | wait.until(ec.element_to_be_clickable((By.ID, 'idSIButton9'))) 36 | driver.find_element(By.ID, 'i0116').send_keys(mail) 37 | driver.find_element(By.ID, 'idSIButton9').click() 38 | wait.until(ec.element_to_be_clickable((By.ID, 'idA_PWD_ForgotPassword'))) 39 | driver.find_element(By.ID, 'i0118').send_keys(password) 40 | driver.implicitly_wait(20) 41 | driver.find_element(By.ID, 'idSIButton9').click() 42 | 43 | wait.until(ec.element_to_be_clickable((By.ID, 'KmsiCheckboxField'))) 44 | driver.find_element(By.ID, 'idSIButton9').click() 45 | 46 | element = wait.until(ec.element_to_be_clickable((By.XPATH, 47 | '//button[@class="btn btn-full btn-lg btn-filled btn-primary ' 48 | 'onb-uinfo-continue" and @type="submit"]'))) 49 | element.click() 50 | wait.until(ec.element_to_be_clickable((By.XPATH, 51 | '//button[@class="btn btn-full btn-lg btn-filled btn-primary ' 52 | 'onb-send-code-primary" and @type="submit"]'))) 53 | driver.find_element(By.XPATH, '//div[@class=" css-12wvehw-control"]').click() 54 | element = wait.until(ec.element_to_be_clickable((By.ID, 'react-select-2-option-103'))) 55 | element.click() 56 | driver.find_element(By.XPATH, 57 | '//input[@class="text-input text-input-lg text-input-full" and @type="text"]').send_keys( 58 | str(number['phone'])[2:]) 59 | whatsapp_no_element = wait.until( 60 | ec.element_to_be_clickable((By.CSS_SELECTOR, "label[for='whatsapp-opt-in-radio-no']"))) 61 | whatsapp_no_element.click() 62 | send_sms_element = wait.until(ec.element_to_be_clickable((By.XPATH, 63 | '//button[@class="btn btn-full btn-lg btn-filled ' 64 | 'btn-primary onb-send-code-primary" and ' 65 | '@type="submit"]'))) 66 | send_sms_element.click() 67 | wait.until(ec.element_to_be_clickable((By.XPATH, '//div[@class="link-style onb-back-btn"]'))) 68 | while sa.getStatus(id=number['activation_id'])[7:9] != 'OK': 69 | print('Waiting for code...') 70 | driver.find_element(By.XPATH, 71 | '//input[@class="text-input text-input-lg text-input-full" and @type="text"]').send_keys( 72 | sa.getStatus(number['activation_id'])[10:]) 73 | wait.until(ec.title_contains('New chat')) # 等待标题包含“New chat” 74 | sa.setStatus(id=number['activation_id'], status=3) # 3: 接收下一个号码 75 | driver.close() 76 | 77 | 78 | def main(): 79 | sa = SMSActivateAPI('') # 需要更改为自己的API key 80 | # Get number 81 | number = sa.getNumber(service='dr', country=6) # dr: openai 6: 印度尼西亚 82 | success_count = 0 83 | 84 | with open('ok.csv', newline='') as csvfile: 85 | reader = csv.reader(csvfile, delimiter=',', quotechar='"') 86 | rows = [row for row in reader] 87 | rows_to_delete = [] 88 | flag = True # 循环标志 89 | for index, row in enumerate(rows): 90 | # 提取邮箱和密码信息 91 | mail = row[0] 92 | password = row[1] 93 | print('正在注册邮箱:{},密码:{}'.format(mail, password)) 94 | try: 95 | register(mail, password, sa, number) 96 | except Exception as e: 97 | print('注册失败:{}'.format(e)) 98 | while True: 99 | confirm = input("Was registration successful? (y/n/e/r): ") 100 | if confirm.lower() == 'y': 101 | success_count += 1 102 | if success_count >= 2: 103 | sa.setStatus(id=number['activation_id'], status=6) # 6: 释放号码 104 | number = sa.getNumber(service='dr', country=6) # dr: openai 6: 印度尼西亚 105 | success_count = 0 106 | # write registration details to a csv file 107 | with open('chatgpt.csv', 'a', newline='') as csv_file: 108 | writer = csv.writer(csv_file) 109 | writer.writerow([mail, password]) 110 | rows_to_delete.append(index) 111 | break 112 | elif confirm.lower() == 'n': 113 | break 114 | elif confirm.lower() == 'e': 115 | flag = False 116 | break 117 | elif confirm.lower() == 'r': 118 | number = sa.getNumber(service='dr', country=6) # dr: openai 6: 印度尼西亚 119 | break 120 | else: 121 | print("Invalid input. Please enter 'y' or 'n' or 'e' or 'r'.") 122 | if not flag: 123 | break 124 | # 删除需要删除的行 125 | for index in reversed(rows_to_delete): 126 | rows.pop(index) 127 | # 将修改后的数据写回到CSV文件中 128 | with open('ok.csv', 'w', newline='') as okcsvfile: 129 | writer = csv.writer(okcsvfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) 130 | for row in rows: 131 | writer.writerow(row) 132 | 133 | 134 | if __name__ == '__main__': 135 | main() 136 | -------------------------------------------------------------------------------- /GetApiKey.py: -------------------------------------------------------------------------------- 1 | """ 2 | 基于undetected_edgedriver的ChatGPT ApiKey 提取脚本 3 | 4 | Author: Eli Lee 5 | Version: 1.0 6 | Import: chatgpt.csv 7 | Export: api.csv 8 | 9 | """ 10 | 11 | import csv 12 | 13 | from selenium.webdriver.common.by import By 14 | from selenium.webdriver.support import expected_conditions as ec 15 | from selenium.webdriver.support.ui import WebDriverWait 16 | from undetected_edgedriver import Edge, EdgeOptions 17 | from webdriver_manager.microsoft import EdgeChromiumDriverManager 18 | 19 | 20 | def register(mail, password): 21 | options = EdgeOptions() 22 | options.add_argument("--inprivate") # 启用Edge浏览器无痕模式 23 | driver = Edge(driver_executable_path=EdgeChromiumDriverManager().install(), options=options) 24 | wait = WebDriverWait(driver, 60) # 最长等待时间为60秒 25 | driver.get('https://platform.openai.com/account/api-keys') 26 | wait.until(ec.title_contains('OpenAI API')) # 等待标题包含“OpenAI API” 27 | driver.find_element(By.XPATH, "//span[@class='btn-label-inner' and contains(text(), 'Log in')]").click() 28 | wait.until(ec.element_to_be_clickable( 29 | (By.XPATH, '//span[@class="c47d81fe7" and text()="Continue with Microsoft Account"]'))) 30 | driver.find_element(By.XPATH, '//span[@class="c47d81fe7" and text()="Continue with Microsoft Account"]').click() 31 | wait.until(ec.element_to_be_clickable((By.ID, 'idSIButton9'))) 32 | driver.find_element(By.ID, 'i0116').send_keys(mail) 33 | driver.find_element(By.ID, 'idSIButton9').click() 34 | wait.until(ec.element_to_be_clickable((By.ID, 'idA_PWD_ForgotPassword'))) 35 | driver.find_element(By.ID, 'i0118').send_keys(password) 36 | driver.implicitly_wait(20) 37 | driver.find_element(By.ID, 'idSIButton9').click() 38 | wait.until(ec.element_to_be_clickable((By.ID, 'KmsiCheckboxField'))) 39 | driver.find_element(By.ID, 'idSIButton9').click() 40 | create_button = wait.until(ec.element_to_be_clickable((By.XPATH, "//button[contains(., 'Create new secret key')]"))) 41 | create_button.click() 42 | key_input = wait.until(ec.presence_of_element_located( 43 | (By.XPATH, "//input[@class='text-input text-input-sm text-input-full' and @type='text']"))) 44 | value = key_input.get_attribute('value') 45 | driver.close() 46 | return value 47 | 48 | 49 | def main(): 50 | with open('chatgpt.csv', newline='') as csvfile: 51 | reader = csv.reader(csvfile, delimiter=',', quotechar='"') 52 | rows = [row for row in reader] 53 | rows_to_delete = [] 54 | flag = True # 循环标志 55 | for index, row in enumerate(rows): 56 | # 提取邮箱和密码信息 57 | mail = row[0] 58 | password = row[1] 59 | print('正在获取邮箱:{},密码:{}'.format(mail, password)) 60 | try: 61 | value = register(mail, password) 62 | except Exception as e: 63 | print('获取失败:{}'.format(e)) 64 | while True: 65 | confirm = input("Was registration successful? (y/n/e): ") 66 | if confirm.lower() == 'y': 67 | with open('api.csv', 'a', newline='') as csv_file: 68 | writer = csv.writer(csv_file) 69 | writer.writerow([mail, password, value]) 70 | rows_to_delete.append(index) 71 | break 72 | elif confirm.lower() == 'n': 73 | break 74 | elif confirm.lower() == 'e': 75 | flag = False 76 | break 77 | else: 78 | print("Invalid input. Please enter 'y' or 'n' or 'e'.") 79 | if not flag: 80 | break 81 | # 删除需要删除的行 82 | for index in reversed(rows_to_delete): 83 | rows.pop(index) 84 | # 将修改后的数据写回到CSV文件中 85 | with open('chatgpt.csv', 'w', newline='') as chatcsvfile: 86 | writer = csv.writer(chatcsvfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) 87 | for row in rows: 88 | writer.writerow(row) 89 | 90 | 91 | if __name__ == '__main__': 92 | main() 93 | -------------------------------------------------------------------------------- /HelloChatGPT.py: -------------------------------------------------------------------------------- 1 | """ 2 | 基于undetected_edgedriver的ChatGPT自动登录脚本,ChatGPT使用微软账号首次登录,无法正常重定向,本脚本的目的是预处理注册好的微软账号,使其可以正常登录ChatGPT。 3 | selenium不能通过cf盾,使用undetected_edgedriver可以绕过cf盾。 4 | 偶尔会弹出cf盾验证,需要手动验证。 5 | 6 | Author: Eli Lee 7 | Version: 1.0 8 | Import: outlook.csv 9 | Export: ok.csv 10 | 11 | """ 12 | 13 | from selenium.webdriver.common.by import By 14 | from undetected_edgedriver import Edge, EdgeOptions 15 | from selenium.webdriver.support.ui import WebDriverWait 16 | from selenium.webdriver.support import expected_conditions as ec 17 | import csv 18 | 19 | from webdriver_manager.microsoft import EdgeChromiumDriverManager 20 | 21 | 22 | def register(mail, password): 23 | options = EdgeOptions() 24 | options.add_argument("--inprivate") # 启用Edge浏览器无痕模式 25 | driver = Edge(driver_executable_path=EdgeChromiumDriverManager().install(), options=options) 26 | wait = WebDriverWait(driver, 60) # 最长等待时间为60秒 27 | driver.get('https://chat.openai.com/auth/login') 28 | wait.until(ec.title_contains('ChatGPT | OpenAI')) # 等待标题包含“Log In - OpenAI Chat” 29 | driver.find_element(By.XPATH, 30 | '//div[@class="flex w-full items-center justify-center gap-2" and text()="Sign up"]').click() 31 | wait.until(ec.element_to_be_clickable( 32 | (By.XPATH, '//span[@class="c47d81fe7" and text()="Continue with Microsoft Account"]'))) 33 | driver.find_element(By.XPATH, '//span[@class="c47d81fe7" and text()="Continue with Microsoft Account"]').click() 34 | wait.until(ec.element_to_be_clickable((By.ID, 'idSIButton9'))) 35 | driver.find_element(By.ID, 'i0116').send_keys(mail) 36 | driver.find_element(By.ID, 'idSIButton9').click() 37 | wait.until(ec.element_to_be_clickable((By.ID, 'idA_PWD_ForgotPassword'))) 38 | driver.find_element(By.ID, 'i0118').send_keys(password) 39 | driver.implicitly_wait(20) 40 | driver.find_element(By.ID, 'idSIButton9').click() 41 | 42 | wait.until(ec.element_to_be_clickable((By.ID, 'KmsiCheckboxField'))) 43 | driver.find_element(By.ID, 'idSIButton9').click() 44 | wait.until(ec.element_to_be_clickable((By.ID, 'idBtn_Accept'))) 45 | driver.find_element(By.ID, 'idBtn_Accept').click() 46 | driver.close() 47 | 48 | 49 | def main(): 50 | with open('outlook.csv', newline='') as csvfile: 51 | reader = csv.reader(csvfile, delimiter=',', quotechar='"') 52 | rows = [row for row in reader] 53 | rows_to_delete = [] 54 | flag = True 55 | for index, row in enumerate(rows): 56 | mail = row[0] 57 | password = row[1] 58 | print('正在注册邮箱:{},密码:{}'.format(mail, password)) 59 | try: 60 | register(mail, password) 61 | except Exception as e: 62 | print('注册失败:{}'.format(e)) 63 | while True: 64 | confirm = input("Was operation successful? (y/n/e): ") 65 | if confirm.lower() == 'y': 66 | # write registration details to a csv file 67 | with open('ok.csv', 'a', newline='') as csv_file: 68 | writer = csv.writer(csv_file) 69 | writer.writerow([mail, password]) 70 | rows_to_delete.append(index) 71 | break 72 | elif confirm.lower() == 'n': 73 | break 74 | elif confirm.lower() == 'e': 75 | flag = False 76 | break 77 | else: 78 | print("Invalid input. Please enter 'y' or 'n' or 'e'.") 79 | if not flag: 80 | break 81 | # 删除需要删除的行 82 | for index in reversed(rows_to_delete): 83 | rows.pop(index) 84 | # 将修改后的数据写回到CSV文件中 85 | with open('outlook.csv', 'w', newline='') as okcsvfile: 86 | writer = csv.writer(okcsvfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL) 87 | for row in rows: 88 | writer.writerow(row) 89 | 90 | 91 | if __name__ == '__main__': 92 | main() 93 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ELi Lee 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoReg4MSChatGPT 2 | 3 | ![GitHub](https://img.shields.io/github/license/imlee2021/AutoReg4MSChatGPT?style=flat-square) 4 | ![GitHub last commit](https://img.shields.io/github/last-commit/imlee2021/AutoReg4MSChatGPT?style=flat-square) 5 | 6 | 微软账号与ChatGPT账号自动注册脚本。 7 | 8 | 交流群:628041048 9 | 10 | 成品号:1.5r一个(价格可能变化以网页下单为准) 11 | 12 | 下单:https://shop.imlee.top 13 | 14 | ## 目录 15 | 16 | - [安装](#安装) 17 | - [使用](#使用) 18 | - [许可证](#许可证) 19 | 20 | ## 安装 21 | 22 | ``` 23 | pip install -r requirements.txt 24 | ``` 25 | 26 | ## 使用 27 | 28 | 1. > AutoRegOutlook.py 29 | 30 | 注册微软账号,注册成功账号将放在outlook.csv中。 31 | 32 | 每个IP只能注册3个邮箱,没有实现代理IP池,所以需要手动更换IP。 33 | 34 | 验证码需手动进行验证。 35 | 2. > HelloChatGPT.py 36 | 37 | 新注册的微软账号,登录chatgpt无法正常重定向,需要预处理ChatGPT账号,成功后将账号放在ok.csv中。 38 | 39 | 可能产生cf盾验证,需手动点击验证。 40 | 3. > ChatGPTSmsVerify.py 41 | 42 | 先更改 sa = SMSActivateAPI('') 中的API key,实现自动对ChatGPT账号进行短信验证,将短信验证码放在chatgpt.csv中。 43 | 44 | 可能产生cf盾验证,需手动点击验证。 45 | 4. > GetApiKey.py 46 | 47 | 获取ChatGPT账号的API key,将API key放在api.csv中。 48 | 49 | 可能产生cf盾验证,需手动点击验证。 50 | 51 | ## 许可证 52 | 53 | 该 Python 脚本小程序的许可证信息。本项目采用 [MIT 许可证](LICENSE)。 54 | -------------------------------------------------------------------------------- /api.csv: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chatgpt.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imlee2021/AutoReg4MSChatGPT/236707f723124cd4bac42689eff293e8a1d64365/chatgpt.csv -------------------------------------------------------------------------------- /ok.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imlee2021/AutoReg4MSChatGPT/236707f723124cd4bac42689eff293e8a1d64365/ok.csv -------------------------------------------------------------------------------- /outlook.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imlee2021/AutoReg4MSChatGPT/236707f723124cd4bac42689eff293e8a1d64365/outlook.csv -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imlee2021/AutoReg4MSChatGPT/236707f723124cd4bac42689eff293e8a1d64365/requirements.txt --------------------------------------------------------------------------------