chore: initial commit
This commit is contained in:
95
README.md
Normal file
95
README.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# gptplus_auto
|
||||
|
||||
ChatGPT Plus 自动注册、订阅工具,以及 Codex CLI OAuth 登录工具。
|
||||
|
||||
## 功能
|
||||
|
||||
- **register** — 自动注册新 ChatGPT 账号,并可选完成 Plus 订阅(Stripe 支付)
|
||||
- **codex-login** — 对已有 ChatGPT 账号执行 Codex CLI OAuth 登录,纯 HTTP 实现,无需浏览器
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## 配置
|
||||
|
||||
复制并编辑 `.env`:
|
||||
|
||||
```env
|
||||
# 代理(推荐美国 IP)
|
||||
SOCKS5_PROXY=socks5://user:pass@host:port
|
||||
|
||||
# YesCaptcha(注册功能需要)
|
||||
YESCAPTCHA_API_KEY=your_key_here
|
||||
|
||||
# 支付信息(订阅功能需要,可留空跳过支付)
|
||||
CARD_NUMBER=4111111111111111
|
||||
CARD_EXP_MONTH=12
|
||||
CARD_EXP_YEAR=2028
|
||||
CARD_CVC=123
|
||||
BILLING_NAME=John Smith
|
||||
BILLING_EMAIL=john@example.com
|
||||
BILLING_ADDRESS_LINE1=123 Main St
|
||||
BILLING_ADDRESS_CITY=New York
|
||||
BILLING_ADDRESS_STATE=NY
|
||||
BILLING_ADDRESS_POSTAL_CODE=10001
|
||||
COUNTRY=US
|
||||
CURRENCY=usd
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
所有功能通过 `src/main.py` 统一入口调用:
|
||||
|
||||
### 注册账号(+ 可选 Plus 订阅)
|
||||
|
||||
```bash
|
||||
.venv/bin/python src/main.py register
|
||||
```
|
||||
|
||||
- 自动申请临时邮箱、注册账号、解 hCaptcha
|
||||
- 若 `.env` 中配置了信用卡信息,注册完成后自动订阅 ChatGPT Plus
|
||||
- 输出邮箱、邮箱密码、ChatGPT 密码、access token
|
||||
|
||||
### Codex CLI OAuth 登录
|
||||
|
||||
```bash
|
||||
.venv/bin/python src/main.py codex-login --email user@example.com --password yourpassword
|
||||
```
|
||||
|
||||
可选参数:
|
||||
|
||||
| 参数 | 说明 |
|
||||
|------|------|
|
||||
| `--email` | 账号邮箱(不传则交互式输入)|
|
||||
| `--password` | 账号密码(不传则交互式输入)|
|
||||
| `--otp` | 邮箱 OTP(如需要)|
|
||||
| `--workspace-id` | 指定 workspace ID |
|
||||
| `--authorize-url` | 自定义 OAuth authorize URL |
|
||||
|
||||
成功后输出 `localhost:1455/auth/callback?code=...` 回调 URL,可直接交给 Codex CLI 完成登录。
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
src/
|
||||
├── main.py # 统一入口(register / codex-login)
|
||||
├── config.py # 配置(pydantic-settings,读取 .env)
|
||||
├── http_client.py # HTTP 客户端(curl_cffi Chrome 模拟)
|
||||
├── vmail_client.py # 临时邮箱(mail.tm)
|
||||
├── captcha_solver.py # YesCaptcha hCaptcha 解决
|
||||
├── chatgpt_register_http_reverse.py # 完整注册流程
|
||||
├── chatgpt_payment.py # 完整 Stripe 支付流程
|
||||
└── codex_oauth_http_flow.py # Codex CLI OAuth 登录(纯 HTTP)
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **仅供学习研究**:请遵守 OpenAI 服务条款
|
||||
2. **代理建议**:建议使用美国 IP 代理,避免触发风控
|
||||
3. **API 可能变化**:OpenAI/Stripe 可能随时更改接口
|
||||
4. **避免频繁调用**:同 IP 短时间内多次注册可能被封
|
||||
Reference in New Issue
Block a user