dantynoel commited on
Commit ·
7d10a66
1
Parent(s): 3cb9e04
feat: align with main branch
Browse files- config/setting.toml +1 -1
- request.py +1 -1
- src/main.py +1 -1
- src/services/flow_client.py +3 -2
- static/manage.html +2 -1
config/setting.toml
CHANGED
|
@@ -12,7 +12,7 @@ max_poll_attempts = 200
|
|
| 12 |
|
| 13 |
[server]
|
| 14 |
host = "0.0.0.0"
|
| 15 |
-
port =
|
| 16 |
|
| 17 |
[debug]
|
| 18 |
enabled = false
|
|
|
|
| 12 |
|
| 13 |
[server]
|
| 14 |
host = "0.0.0.0"
|
| 15 |
+
port = 8000
|
| 16 |
|
| 17 |
[debug]
|
| 18 |
enabled = false
|
request.py
CHANGED
|
@@ -7,7 +7,7 @@ import asyncio
|
|
| 7 |
|
| 8 |
|
| 9 |
# --- 配置区域 ---
|
| 10 |
-
BASE_URL = os.getenv('GEMINI_FLOW2API_URL', 'http://127.0.0.1:
|
| 11 |
BACKEND_URL = BASE_URL + "/v1/chat/completions"
|
| 12 |
API_KEY = os.getenv('GEMINI_FLOW2API_APIKEY', 'Bearer han1234')
|
| 13 |
if API_KEY is None:
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
# --- 配置区域 ---
|
| 10 |
+
BASE_URL = os.getenv('GEMINI_FLOW2API_URL', 'http://127.0.0.1:8000')
|
| 11 |
BACKEND_URL = BASE_URL + "/v1/chat/completions"
|
| 12 |
API_KEY = os.getenv('GEMINI_FLOW2API_APIKEY', 'Bearer han1234')
|
| 13 |
if API_KEY is None:
|
src/main.py
CHANGED
|
@@ -74,7 +74,7 @@ async def lifespan(app: FastAPI):
|
|
| 74 |
|
| 75 |
# Initialize browser captcha service if needed
|
| 76 |
browser_service = None
|
| 77 |
-
if
|
| 78 |
from .services.browser_captcha_personal import BrowserCaptchaService
|
| 79 |
browser_service = await BrowserCaptchaService.get_instance(db)
|
| 80 |
await browser_service.open_login_window()
|
|
|
|
| 74 |
|
| 75 |
# Initialize browser captcha service if needed
|
| 76 |
browser_service = None
|
| 77 |
+
if captcha_config.captcha_method == "personal":
|
| 78 |
from .services.browser_captcha_personal import BrowserCaptchaService
|
| 79 |
browser_service = await BrowserCaptchaService.get_instance(db)
|
| 80 |
await browser_service.open_login_window()
|
src/services/flow_client.py
CHANGED
|
@@ -687,7 +687,8 @@ class FlowClient:
|
|
| 687 |
"""获取reCAPTCHA token - 支持两种方式"""
|
| 688 |
captcha_method = config.captcha_method
|
| 689 |
|
| 690 |
-
|
|
|
|
| 691 |
try:
|
| 692 |
from .browser_captcha_personal import BrowserCaptchaService
|
| 693 |
service = await BrowserCaptchaService.get_instance(self.proxy_manager)
|
|
@@ -695,7 +696,7 @@ class FlowClient:
|
|
| 695 |
except Exception as e:
|
| 696 |
debug_logger.log_error(f"[reCAPTCHA Browser] error: {str(e)}")
|
| 697 |
return None
|
| 698 |
-
# 浏览器打码
|
| 699 |
elif captcha_method == "browser":
|
| 700 |
try:
|
| 701 |
from .browser_captcha import BrowserCaptchaService
|
|
|
|
| 687 |
"""获取reCAPTCHA token - 支持两种方式"""
|
| 688 |
captcha_method = config.captcha_method
|
| 689 |
|
| 690 |
+
# 恒定浏览器打码
|
| 691 |
+
if captcha_method == "personal":
|
| 692 |
try:
|
| 693 |
from .browser_captcha_personal import BrowserCaptchaService
|
| 694 |
service = await BrowserCaptchaService.get_instance(self.proxy_manager)
|
|
|
|
| 696 |
except Exception as e:
|
| 697 |
debug_logger.log_error(f"[reCAPTCHA Browser] error: {str(e)}")
|
| 698 |
return None
|
| 699 |
+
# 无头浏览器打码
|
| 700 |
elif captcha_method == "browser":
|
| 701 |
try:
|
| 702 |
from .browser_captcha import BrowserCaptchaService
|
static/manage.html
CHANGED
|
@@ -269,7 +269,8 @@
|
|
| 269 |
<label class="text-sm font-medium mb-2 block">打码方式</label>
|
| 270 |
<select id="cfgCaptchaMethod" class="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm" onchange="toggleCaptchaOptions()">
|
| 271 |
<option value="yescaptcha">YesCaptcha打码</option>
|
| 272 |
-
<option value="browser">浏览器打码</option>
|
|
|
|
| 273 |
</select>
|
| 274 |
<p class="text-xs text-muted-foreground mt-1">选择验证码获取方式</p>
|
| 275 |
</div>
|
|
|
|
| 269 |
<label class="text-sm font-medium mb-2 block">打码方式</label>
|
| 270 |
<select id="cfgCaptchaMethod" class="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm" onchange="toggleCaptchaOptions()">
|
| 271 |
<option value="yescaptcha">YesCaptcha打码</option>
|
| 272 |
+
<option value="browser">无头浏览器打码</option>
|
| 273 |
+
<option value="personal">内置浏览器打码</option>
|
| 274 |
</select>
|
| 275 |
<p class="text-xs text-muted-foreground mt-1">选择验证码获取方式</p>
|
| 276 |
</div>
|