mirror of
https://github.com/TheSmallHanCat/flow2api.git
synced 2026-06-03 05:16:03 +08:00
feat: align with main branch
This commit is contained in:
@@ -12,7 +12,7 @@ max_poll_attempts = 200
|
||||
|
||||
[server]
|
||||
host = "0.0.0.0"
|
||||
port = 8106
|
||||
port = 8000
|
||||
|
||||
[debug]
|
||||
enabled = false
|
||||
|
||||
@@ -7,7 +7,7 @@ import asyncio
|
||||
|
||||
|
||||
# --- 配置区域 ---
|
||||
BASE_URL = os.getenv('GEMINI_FLOW2API_URL', 'http://127.0.0.1:8106')
|
||||
BASE_URL = os.getenv('GEMINI_FLOW2API_URL', 'http://127.0.0.1:8000')
|
||||
BACKEND_URL = BASE_URL + "/v1/chat/completions"
|
||||
API_KEY = os.getenv('GEMINI_FLOW2API_APIKEY', 'Bearer han1234')
|
||||
if API_KEY is None:
|
||||
|
||||
@@ -74,7 +74,7 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
# Initialize browser captcha service if needed
|
||||
browser_service = None
|
||||
if True:
|
||||
if captcha_config.captcha_method == "personal":
|
||||
from .services.browser_captcha_personal import BrowserCaptchaService
|
||||
browser_service = await BrowserCaptchaService.get_instance(db)
|
||||
await browser_service.open_login_window()
|
||||
|
||||
@@ -687,7 +687,8 @@ class FlowClient:
|
||||
"""获取reCAPTCHA token - 支持两种方式"""
|
||||
captcha_method = config.captcha_method
|
||||
|
||||
if True:
|
||||
# 恒定浏览器打码
|
||||
if captcha_method == "personal":
|
||||
try:
|
||||
from .browser_captcha_personal import BrowserCaptchaService
|
||||
service = await BrowserCaptchaService.get_instance(self.proxy_manager)
|
||||
@@ -695,7 +696,7 @@ class FlowClient:
|
||||
except Exception as e:
|
||||
debug_logger.log_error(f"[reCAPTCHA Browser] error: {str(e)}")
|
||||
return None
|
||||
# 浏览器打码
|
||||
# 无头浏览器打码
|
||||
elif captcha_method == "browser":
|
||||
try:
|
||||
from .browser_captcha import BrowserCaptchaService
|
||||
|
||||
@@ -269,7 +269,8 @@
|
||||
<label class="text-sm font-medium mb-2 block">打码方式</label>
|
||||
<select id="cfgCaptchaMethod" class="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm" onchange="toggleCaptchaOptions()">
|
||||
<option value="yescaptcha">YesCaptcha打码</option>
|
||||
<option value="browser">浏览器打码</option>
|
||||
<option value="browser">无头浏览器打码</option>
|
||||
<option value="personal">内置浏览器打码</option>
|
||||
</select>
|
||||
<p class="text-xs text-muted-foreground mt-1">选择验证码获取方式</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user