nacho commited on
Commit
2c5b708
·
1 Parent(s): f6a18fc

docs: update README to recommend CloakBrowser only

Browse files
Files changed (1) hide show
  1. README.md +44 -23
README.md CHANGED
@@ -1,25 +1,37 @@
1
  # DS2API Browser
2
 
3
- 基于 CloakBrowser/Playwright 的 DeepSeek API 代理服务。
 
 
 
 
 
 
 
 
4
 
5
  ## 特性
6
 
7
- - **浏览器自动化** - 使用真实浏览器访问 DeepSeek,无法被检测
8
  - **OpenAI 兼容 API** - 支持 `/v1/chat/completions` 接口
 
9
  - **流式响应** - 支持 SSE 流式输出
10
  - **账号池管理** - 支持多账号轮询
11
- - **人类行为模拟** - 模拟真实用户操作
12
 
13
  ## 安装
14
 
15
  ```bash
16
- cd /home/huanx/code/ds2api-browser
 
 
 
 
17
  python -m venv venv
18
  source venv/bin/activate
19
- pip install -r requirements.txt
20
 
21
- # 安装 Playwright 浏览器(如果不用 CloakBrowser)
22
- playwright install chromium
23
  ```
24
 
25
  ## 使用
@@ -32,7 +44,6 @@ export DS2API_KEYS="sk-key1,sk-key2"
32
  export DS2API_ADMIN_KEY="your-admin-key"
33
  export DS2API_PORT="5001"
34
  export DS2API_HEADLESS="true"
35
- export DS2API_HUMANIZE="true"
36
 
37
  python main.py
38
  ```
@@ -49,6 +60,14 @@ python start.py
49
  nohup python main.py > /tmp/ds2api-browser.log 2>&1 &
50
  ```
51
 
 
 
 
 
 
 
 
 
52
  ## API 使用
53
 
54
  ### 聊天补全
@@ -58,7 +77,7 @@ curl http://localhost:5001/v1/chat/completions \
58
  -H "Authorization: Bearer sk-test123456" \
59
  -H "Content-Type: application/json" \
60
  -d '{
61
- "model": "deepseek-chat",
62
  "messages": [{"role": "user", "content": "Hello!"}]
63
  }'
64
  ```
@@ -70,7 +89,7 @@ curl http://localhost:5001/v1/chat/completions \
70
  -H "Authorization: Bearer sk-test123456" \
71
  -H "Content-Type: application/json" \
72
  -d '{
73
- "model": "deepseek-chat",
74
  "messages": [{"role": "user", "content": "Hello!"}],
75
  "stream": true
76
  }'
@@ -87,12 +106,23 @@ client = OpenAI(
87
  )
88
 
89
  response = client.chat.completions.create(
90
- model="deepseek-chat",
91
  messages=[{"role": "user", "content": "Hello!"}]
92
  )
93
  print(response.choices[0].message.content)
94
  ```
95
 
 
 
 
 
 
 
 
 
 
 
 
96
  ## 健康检查
97
 
98
  ```bash
@@ -106,19 +136,9 @@ curl http://localhost:5001/readyz
106
  curl http://localhost:5001/admin/stats -H "admin-key: admin"
107
  ```
108
 
109
- ## 与原版 DS2API 的区别
110
-
111
- | 特性 | 原版 DS2API | DS2API Browser |
112
- |------|-------------|----------------|
113
- | 实现方式 | HTTP 客户端 | 浏览器自动化 |
114
- | 指纹检测 | 容易被检测 | 无法被检测 |
115
- | 账号封禁 | 高风险 | 低风险 |
116
- | 性能 | 快 | 较慢 |
117
- | 资源占用 | 低 | 高 |
118
-
119
  ## 注意事项
120
 
121
- 1. **首次运行** - Playwright/CloakBrowser 会下载浏览器二进制文件~200MB
122
  2. **资源占用** - 每个浏览器实例占用约 200-500MB 内存
123
  3. **性能** - 浏览器自动化比直接 HTTP 慢,但更安全
124
  4. **账号安全** - 建议使用小号测试,不要用主账号
@@ -128,11 +148,12 @@ curl http://localhost:5001/admin/stats -H "admin-key: admin"
128
  ```
129
  ds2api-browser/
130
  ├── main.py # FastAPI 服务器
131
- ├── deepseek_browser.py # 浏览器自动化核心
132
  ├── account_manager.py # 账号池管理
133
  ├── config.py # 配置管理
134
  ├── start.py # 快速启动脚本
135
  ├── run.py # 运行入口
 
136
  ├── requirements.txt # 依赖列表
137
  └── README.md # 本文档
138
  ```
 
1
  # DS2API Browser
2
 
3
+ 基于 CloakBrowser 的 DeepSeek API 代理服务。
4
+
5
+ ## 为什么选择 CloakBrowser?
6
+
7
+ CloakBrowser 是专为反检测设计的浏览器,通过 30/30 机器人检测测试。使用 CloakBrowser 可以:
8
+
9
+ - **完全隐藏自动化痕迹** - 无法被 DeepSeek 检测
10
+ - **避免账号封禁** - 模拟真实用户行为
11
+ - **通过 AWS WAF 验证** - 自动处理 CloudFront Token
12
 
13
  ## 特性
14
 
15
+ - **浏览器自动化** - 使用 CloakBrowser 访问 DeepSeek,无法被检测
16
  - **OpenAI 兼容 API** - 支持 `/v1/chat/completions` 接口
17
+ - **Claude/Gemini/Ollama 兼容** - 多协议支持
18
  - **流式响应** - 支持 SSE 流式输出
19
  - **账号池管理** - 支持多账号轮询
20
+ - **Web 管理界面** - 在线导入账号
21
 
22
  ## 安装
23
 
24
  ```bash
25
+ # 克隆仓库
26
+ git clone https://github.com/huanxherta/ds2api-browser.git
27
+ cd ds2api-browser
28
+
29
+ # 创建虚拟环境
30
  python -m venv venv
31
  source venv/bin/activate
 
32
 
33
+ # 安装依赖
34
+ pip install -r requirements.txt
35
  ```
36
 
37
  ## 使用
 
44
  export DS2API_ADMIN_KEY="your-admin-key"
45
  export DS2API_PORT="5001"
46
  export DS2API_HEADLESS="true"
 
47
 
48
  python main.py
49
  ```
 
60
  nohup python main.py > /tmp/ds2api-browser.log 2>&1 &
61
  ```
62
 
63
+ ## Web 管理界面
64
+
65
+ 访问 `http://localhost:5001/test.html` 可以:
66
+
67
+ - 测试 API 请求
68
+ - 导入账号(支持批量)
69
+ - 查看账号状态
70
+
71
  ## API 使用
72
 
73
  ### 聊天补全
 
77
  -H "Authorization: Bearer sk-test123456" \
78
  -H "Content-Type: application/json" \
79
  -d '{
80
+ "model": "deepseek-v4-flash",
81
  "messages": [{"role": "user", "content": "Hello!"}]
82
  }'
83
  ```
 
89
  -H "Authorization: Bearer sk-test123456" \
90
  -H "Content-Type: application/json" \
91
  -d '{
92
+ "model": "deepseek-v4-flash",
93
  "messages": [{"role": "user", "content": "Hello!"}],
94
  "stream": true
95
  }'
 
106
  )
107
 
108
  response = client.chat.completions.create(
109
+ model="deepseek-v4-flash",
110
  messages=[{"role": "user", "content": "Hello!"}]
111
  )
112
  print(response.choices[0].message.content)
113
  ```
114
 
115
+ ## 支持的模型
116
+
117
+ | 模型 ID | 说明 |
118
+ |---------|------|
119
+ | deepseek-v4-flash | 快速模式(默认) |
120
+ | deepseek-v4-pro | 专家模式 |
121
+ | deepseek-v4-flash-search | 快速 + 搜索 |
122
+ | deepseek-v4-pro-search | 专家 + 搜索 |
123
+ | deepseek-chat | 兼容原版 DS2API |
124
+ | deepseek-reasoner | 推理模式 |
125
+
126
  ## 健康检查
127
 
128
  ```bash
 
136
  curl http://localhost:5001/admin/stats -H "admin-key: admin"
137
  ```
138
 
 
 
 
 
 
 
 
 
 
 
139
  ## 注意事项
140
 
141
+ 1. **必须使用 CloakBrowser** - 其他浏览器(如原生 Playwright会被检测
142
  2. **资源占用** - 每个浏览器实例占用约 200-500MB 内存
143
  3. **性能** - 浏览器自动化比直接 HTTP 慢,但更安全
144
  4. **账号安全** - 建议使用小号测试,不要用主账号
 
148
  ```
149
  ds2api-browser/
150
  ├── main.py # FastAPI 服务器
151
+ ├── deepseek_browser.py # CloakBrowser 自动化核心
152
  ├── account_manager.py # 账号池管理
153
  ├── config.py # 配置管理
154
  ├── start.py # 快速启动脚本
155
  ├── run.py # 运行入口
156
+ ├── test.html # Web 管理界面
157
  ├── requirements.txt # 依赖列表
158
  └── README.md # 本文档
159
  ```