Files
live-hub-py/README.md
T
2026-06-22 10:10:51 +08:00

146 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 斗鱼自动登录工具 - Python版
全自动登录斗鱼账号,获取Cookie。
## 功能特性
- ✅ 自动过极验v3滑块验证
- ✅ 自动获取邮箱验证码(IMAP
- ✅ 批量账号登录
- ✅ Cookie持久化存储
- ✅ 代理支持
- ✅ GUI导入账号、自动保存配置、代理测试
## 项目结构
```
douyu_login_py/
├── main.py # 主入口
├── config.yaml # 配置文件
├── pyproject.toml # uv项目配置
├── douyu/ # 斗鱼登录模块
│ ├── config.py # 配置管理
│ ├── crypto.py # 加密工具
│ ├── email_verifier.py # 邮箱验证
│ └── login.py # 登录核心
├── geetest/ # 极验滑块破解(复用geetest-v3-silde-crack
│ ├── solver.py
│ ├── network.py
│ ├── crypto.py
│ ├── imaging.py
│ └── trajectory.py
├── utils/ # 工具模块
│ ├── logger.py
│ └── helpers.py
└── data/
├── accounts.json # 账号配置
└── cookies/ # Cookie存储
```
## 安装依赖
```bash
uv sync
```
## GUI使用
GUI不再依赖 `config.yaml` 启动,账号数据在界面里导入,代理、极验重试、日志等级和账号列表会自动保存到 `data/gui_state.json`
```bash
uv run python main.py --gui
```
支持导入格式:
```text
用户名|密码|邮箱|邮箱密码
```
也可以导入 `txt``csv``json``yaml` 文件。旧版 `config.yaml` 可直接在 GUI 中作为 YAML 文件导入,用来迁移账号数据。
代理区域支持 API 获取和静态代理,填写后可以点击“测试代理”验证出口连通性。开始批量登录时也会先进行代理预检,只有拿到可用出口后才会继续登录流程。
## 命令行配置
命令行模式仍使用 `config.yaml`
```yaml
accounts:
- username: "your_username"
password: "your_password"
email: "your_email@bdhg.xyz"
email_password: "your_email_password"
email_imap_server: "mail.bdhg.xyz"
email_imap_port: 993
```
## 使用方法
### 单账号登录
```bash
# 登录第一个账号
uv run python main.py
# 登录指定索引的账号
uv run python main.py -i 0
```
### 批量登录
```bash
uv run python main.py --batch
```
### 详细日志
```bash
uv run python main.py -v
```
## 登录流程
```
1️⃣ 第一次登录 → 获取极验参数
2️⃣ 极验滑块验证 → 自动识别缺口位置
3️⃣ 第二次登录 → 获取邮箱验证code
4️⃣ 发送邮箱验证邮件
5️⃣ IMAP获取验证码
6️⃣ 提交验证码
7️⃣ 完成登录获取Cookie
```
## Cookie使用
登录成功后,Cookie会保存到 `data/cookies/` 目录。
可以使用以下方式读取Cookie
```python
from utils.helpers import load_cookie
cookie = load_cookie("your_username")
print(cookie)
```
## 极验滑块破解
本项目复用了 `geetest-v3-silde-crack` 的滑块破解方案,包含:
- RSA/AES加密
- 轨迹生成
- 图像识别(OpenCV
- 性能数据伪造
## 注意事项
1. 请确保邮箱支持IMAP协议
2. 邮箱需要开启IMAP访问权限
3. 部分邮箱需要使用应用专用密码
4. 建议使用代理避免IP限制
## 许可证
MIT License