Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

Commit ecf6a92

Browse files
committed
更新 .gitignore 文件以排除更多 Python 相关的缓存和环境文件;重构 index.html 文件以实现现代化的 M3 风格,优化了样式和布局;在 launch_camoufox.py 中增强了错误处理逻辑,改进了服务器关闭信号的发送机制;更新 README.md 文件以修正格式和内容,确保信息准确性;在 server.py 中优化了关闭逻辑,增强了与 Camoufox 服务器的通信稳定性。
1 parent cc55e9c commit ecf6a92

6 files changed

Lines changed: 421 additions & 167 deletions

File tree

.gitignore

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,62 @@ public
136136
errors/
137137

138138
# Python
139-
__pycache__/\n*.py[cod]\n*$py.class\n\n# Python Libraries\n*.egg-info/\n*.egg\n
140-
# Distribution / packaging\n.Python\nbuild/\ndist/\npart/\nsdist/\n*.manifest\n*.spec\nwheels/\n
141-
# PyInstaller\n# Usually these files are written by a python script from a template\n# before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n
142-
# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n
143-
# Unit test / coverage reports\nhtmlcov/\n.tox/\n.nox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.py,cover\n.hypothesis/\n.pytest_cache/\n
144-
# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n
145-
# Jupyter Notebook\n.ipynb_checkpoints\nprofile_default/\nipython_config.py\n
139+
__pycache__/
140+
*.py[cod]
141+
*$py.class
142+
143+
# Python Libraries
144+
*.egg-info/
145+
*.egg
146+
147+
# Distribution / packaging
148+
.Python
149+
build/
150+
dist/
151+
part/
152+
sdist/
153+
*.manifest
154+
*.spec
155+
wheels/
156+
157+
# PyInstaller
158+
# Usually these files are written by a python script from a template
159+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
160+
*.manifest
161+
*.spec
162+
163+
# Installer logs
164+
pip-log.txt
165+
pip-delete-this-directory.txt
166+
167+
# Unit test / coverage reports
168+
htmlcov/
169+
.tox/
170+
.nox/
171+
.coverage
172+
.coverage.*
173+
.cache
174+
nosetests.xml
175+
coverage.xml
176+
*.cover
177+
*.py,cover
178+
.hypothesis/
179+
.pytest_cache/
180+
181+
# Environments
182+
.env
183+
.venv
184+
env/
185+
venv/
186+
ENV/
187+
env.bak/
188+
venv.bak/
189+
190+
# Jupyter Notebook
191+
.ipynb_checkpoints
192+
profile_default/
193+
ipython_config.py
194+
146195
# pyenv
147196
.python-version
148197

@@ -162,9 +211,6 @@ ENV/
162211
env.bak/
163212
venv.bak/
164213

165-
# Python cache directory
166-
__pycache__/
167-
168214
# Error snapshots directory (Python specific)
169215
errors_py/
170216

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595

9696
### 2. 安装
9797

98-
1. **克隆仓库**:
98+
1. **克隆仓库**:
9999
```bash
100100
git clone https://github.com/CJackHwang/AIstudioProxyAPI
101101
cd AIstudioProxyAPI
@@ -127,7 +127,7 @@
127127

128128
5. **安装 Playwright 浏览器依赖 (如果需要)**:
129129
虽然 Camoufox 使用自己的 Firefox,但首次运行 Playwright 相关命令(如此处的安装)可能仍需要安装一些基础依赖。
130-
```bash
130+
```bash
131131
# 确保 Playwright 库能找到必要的系统依赖
132132
playwright install-deps firefox
133133
# 或者 playwright install-deps # 安装所有浏览器的依赖
@@ -309,7 +309,7 @@
309309
## 💻 多平台指南 (Python 版本)
310310
311311
* **macOS / Linux**: 通常开箱即用。确保 Python, pip 已安装。按照安装步骤安装 Camoufox 和 Playwright 依赖。
312-
* **Windows**:
312+
* **Windows**:
313313
* WSL (Windows Subsystem for Linux) 是推荐环境,体验更接近 Linux。
314314
* 直接在 Windows 上运行也可以,确保 Python, pip 已添加到 PATH。
315315
* 防火墙可能需要允许 Python/Uvicorn 监听端口。
@@ -350,7 +350,7 @@
350350
* **499 Client Closed Request**: 客户端提前断开连接。
351351
* **AI 回复不完整/格式错误**:
352352
* AI Studio Web UI 输出不稳定。检查 `errors_py/` 快照。
353-
* **自动清空上下文失败**:
353+
* **自动清空上下文失败**:
354354
* 检查 `server.py` 日志中的警告。
355355
* 很可能是 AI Studio 页面更新导致 `server.py` 中的 CSS 选择器失效。检查 `errors_py/` 快照,对比实际页面元素更新 `server.py` 中的选择器常量。
356356
* 也可能是网络慢导致验证超时,可尝试在 `server.py` 中增加 `CLEAR_CHAT_VERIFY_TIMEOUT_MS` 的值。

__pycache__/server.cpython-313.pyc

-140 KB
Binary file not shown.

0 commit comments

Comments
 (0)