Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e30c226
Translate captcha worker settings page to English
kattmio Oct 24, 2026
33864ef
Translate captcha worker settings messages to English
kattmio Oct 24, 2026
450c934
Translate example configuration comments to English
kattmio Oct 24, 2026
5b41ea5
Translate admin login page to English
kattmio Oct 24, 2026
ed925fa
Translate README and API documentation to English
kattmio Oct 24, 2026
20763f7
Translate static/test.html interface text to English
kattmio Oct 24, 2026
8469329
Translate static/manage.html interface text to English
kattmio Oct 24, 2026
f30c9ec
Continue English translation of static/manage.html
kattmio Oct 24, 2026
d80f756
Continue English translation of static/test.html
kattmio Oct 24, 2026
1973dd5
Translate remaining static/manage.html interface strings
kattmio Oct 24, 2026
eb30093
Translate remaining static/test.html interface strings
kattmio Oct 24, 2026
19db428
Translate remaining admin console messages to English
kattmio Oct 24, 2026
f1e7fd5
Finish translating admin console text to English
kattmio Oct 24, 2026
f0244fc
Translate remaining admin console prompts and notifications
kattmio Oct 24, 2026
42e4718
Translate admin console UI and notifications into English
kattmio Oct 24, 2026
83897f7
Translate admin API messages and documentation strings to English
kattmio Oct 24, 2026
4756976
Translate src/core/config.py comments and messages to English
kattmio Oct 24, 2026
e5c06cb
Translate src/api/routes.py comments and messages to English
kattmio Oct 24, 2026
de9452c
Translate src/main.py comments and messages to English
kattmio Oct 24, 2026
4258028
Translate src/core/database.py comments and messages to English
kattmio Oct 24, 2026
8dc70da
Translate remaining configuration documentation to English
kattmio Oct 24, 2026
b8879fa
Finish translating admin API comments and response messages
kattmio Oct 24, 2026
8bd46a2
Translate remaining admin settings labels to English
kattmio Oct 24, 2026
38331b6
Translate remaining admin console messages to English
kattmio Oct 24, 2026
3641bc0
Polish English admin console text
kattmio Oct 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
629 changes: 119 additions & 510 deletions README.md

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions config/setting_example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,34 @@ image_timeout = 300
video_timeout = 1500

[call_logic]
call_mode = "default" # default=随机轮询策略, polling=顺序轮询策略
call_mode = "default" # default=randomized round-robin; polling=sequential round-robin

[admin]
error_ban_threshold = 3

[cache]
enabled = false
timeout = 7200 # 缓存超时时间(秒), 默认2小时; 设置为0表示不自动删除缓存
base_url = "" # 缓存文件访问的基础URL, 留空则使用服务器地址
timeout = 7200 # Cache timeout in seconds; defaults to 2 hours. Set to 0 to disable automatic cache deletion
base_url = "" # Base URL for accessing cached files; leave empty to use the server address

[captcha]
captcha_method = "yescaptcha" # 打码方式: yescaptcha/flow2api_team(内置团队打码,地址与密钥固定)/captcharun/twocaptcha/capsolver/ezcaptcha/browser/personal/remote_browser
browser_recaptcha_settle_seconds = 3.0 # 自定义站点分数测试在 reload/clr 就绪后的额外稳态等待
browser_flow_page_warmup_seconds = 6.0 # browser harvest 打开 Flow 页面后的稳定等待
browser_count = 1 # browser 模式的有头浏览器实例数量
browser_captcha_max_retries = 5 # browser 模式单次获取验证码的最大重试次数
browser_captcha_generation_retries = 6 # 生成接口遇到 reCAPTCHA evaluation failed 时的总重试次数
personal_solve_strategy = "auto" # auto=优先 trusted JS、失败切原生 harvest;direct/harvest 可强制指定
personal_project_pool_size = 4 # personal 模式下单个 Token 默认维护的项目池数量(仅影响项目轮换,不决定打码标签页数量)
personal_max_resident_tabs = 5 # personal 模式共享打码标签页上限,所有 Token/project 共用这组 tab
browser_personal_fresh_restart_every_n_solves = 10 # personal 模式成功获取多少个码后清理并重启浏览器,0 表示禁用
personal_idle_tab_ttl_seconds = 600 # personal 模式标签页空闲回收时间(秒)
yescaptcha_api_key = "" # YesCaptcha API密钥
captcha_method = "yescaptcha" # Captcha provider: yescaptcha/flow2api_team (built-in team solver with fixed URL and key)/captcharun/twocaptcha/capsolver/ezcaptcha/browser/personal/remote_browser
browser_recaptcha_settle_seconds = 3.0 # Additional stabilization delay after reload/clr is ready during custom site-score testing
browser_flow_page_warmup_seconds = 6.0 # Stabilization delay after browser harvest opens the Flow page
browser_count = 1 # Number of headed browser instances in browser mode
browser_captcha_max_retries = 5 # Maximum retries for a single captcha retrieval in browser mode
browser_captcha_generation_retries = 6 # Total retries when the generation endpoint encounters reCAPTCHA evaluation failed
personal_solve_strategy = "auto" # auto=prefer trusted JS, falling back to native harvesting on failure; direct/harvest can be selected explicitly
personal_project_pool_size = 4 # Default project-pool size maintained per token in personal mode (affects project rotation only, not the number of captcha tabs)
personal_max_resident_tabs = 5 # Maximum number of shared captcha tabs in personal mode; all tokens/projects share this set of tabs
browser_personal_fresh_restart_every_n_solves = 10 # In personal mode, clean up and restart the browser after this many successful captcha solves; 0 disables this behavior
personal_idle_tab_ttl_seconds = 600 # Idle tab cleanup timeout in seconds for personal mode
yescaptcha_api_key = "" # YesCaptcha API key
yescaptcha_base_url = "https://api.yescaptcha.com"
yescaptcha_task_type = "RecaptchaV3TaskProxylessM1S9" # 可选: RecaptchaV3TaskProxyless/RecaptchaV3TaskProxylessM1/RecaptchaV3TaskProxylessM1S7/RecaptchaV3TaskProxylessM1S9
remote_browser_base_url = "" # 远程有头打码服务地址
remote_browser_api_key = "" # 远程有头打码服务 API Key
remote_browser_timeout = 60 # 远程有头打码请求超时(秒)
yescaptcha_task_type = "RecaptchaV3TaskProxylessM1S9" # Options: RecaptchaV3TaskProxyless/RecaptchaV3TaskProxylessM1/RecaptchaV3TaskProxylessM1S7/RecaptchaV3TaskProxylessM1S9
remote_browser_base_url = "" # Remote headed captcha service URL
remote_browser_api_key = "" # Remote headed captcha service API key
remote_browser_timeout = 60 # Remote headed captcha request timeout in seconds
capsolver_api_key = ""
capsolver_base_url = "https://api.capsolver.com"
captcharun_api_key = ""
Expand Down
97 changes: 19 additions & 78 deletions extension/options.html
Original file line number Diff line number Diff line change
@@ -1,100 +1,41 @@
<!doctype html>
<html lang="zh-CN">
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Flow2API Captcha Worker Settings</title>
<style>
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: #f7f8fa;
color: #111827;
}
.wrap {
max-width: 720px;
margin: 0 auto;
padding: 24px;
}
.panel {
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 12px;
padding: 20px;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
h1 {
font-size: 20px;
margin: 0 0 8px;
}
p {
color: #4b5563;
line-height: 1.5;
}
label {
display: block;
margin: 16px 0 8px;
font-weight: 600;
}
input {
width: 100%;
box-sizing: border-box;
padding: 10px 12px;
border: 1px solid #d1d5db;
border-radius: 10px;
font-size: 14px;
}
button {
margin-top: 18px;
border: 0;
border-radius: 10px;
background: #111827;
color: #fff;
padding: 10px 16px;
font-size: 14px;
cursor: pointer;
}
.hint {
margin-top: 12px;
font-size: 13px;
color: #6b7280;
}
.status {
margin-top: 12px;
min-height: 20px;
font-size: 13px;
color: #065f46;
}
code {
background: #f3f4f6;
border-radius: 6px;
padding: 1px 6px;
}
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f7f8fa; color: #111827; }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px; }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
h1 { font-size: 20px; margin: 0 0 8px; }
p { color: #4b5563; line-height: 1.5; }
label { display: block; margin: 16px 0 8px; font-weight: 600; }
input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; }
button { margin-top: 18px; border: 0; border-radius: 10px; background: #111827; color: #fff; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.hint { margin-top: 12px; font-size: 13px; color: #6b7280; }
.status { margin-top: 12px; min-height: 20px; font-size: 13px; color: #065f46; }
code { background: #f3f4f6; border-radius: 6px; padding: 1px 6px; }
</style>
</head>
<body>
<div class="wrap">
<div class="panel">
<h1>Flow2API Captcha Worker</h1>
<p>给当前浏览器实例设置一个独立的路由键,Flow2API 后端就能把对应账号的验证码请求固定发到这个实例。</p>

<p>Assign a dedicated routing key to this browser instance so the Flow2API backend can route captcha requests for the corresponding account to this instance.</p>
<label for="routeKey">Route Key</label>
<input id="routeKey" type="text" placeholder="例如 9223">

<input id="routeKey" type="text" placeholder="e.g. 9223">
<label for="clientLabel">Client Label</label>
<input id="clientLabel" type="text" placeholder="例如 browser-9223">

<input id="clientLabel" type="text" placeholder="e.g. browser-9223">
<label for="serverUrl">WebSocket URL</label>
<input id="serverUrl" type="text" placeholder="ws://127.0.0.1:8000/captcha_ws">

<label for="apiKey">Flow2API API Key</label>
<input id="apiKey" type="password" placeholder="管理后台里的 API Key">

<button id="saveBtn" type="button">保存</button>
<input id="apiKey" type="password" placeholder="API key from the admin console">
<button id="saveBtn" type="button">Save settings</button>
<div class="status" id="status"></div>
<div class="hint">管理台 token 里填写同样的 <code>Route Key</code>,比如 9223 对 9223。后端会使用 API Key 校验 WebSocket 连接。</div>
<div class="hint">Enter the same <code>Route Key</code> in the admin console's token settings (for example, 9223 on both sides). The backend validates WebSocket connections using the API key.</div>
</div>
</div>
<script src="options.js"></script>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions extension/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ function saveSettings() {
});

if (!isValidWsUrl(settings.serverUrl)) {
setStatus("WebSocket URL 必须以 ws:// 或 wss:// 开头。", true);
setStatus("The WebSocket URL must start with ws:// or wss://.", true);
return;
}
if (!settings.apiKey) {
setStatus("请填写 Flow2API API Key。", true);
setStatus("Please enter the Flow2API API key.", true);
return;
}

chrome.storage.local.set(settings, () => {
if (chrome.runtime.lastError) {
setStatus(`保存失败:${chrome.runtime.lastError.message}`, true);
setStatus(`Could not save settings: ${chrome.runtime.lastError.message}`, true);
return;
}
setStatus("已保存,后台连接会自动重连。");
setStatus("Settings saved. The background connection will reconnect automatically.");
});
}

document.addEventListener("DOMContentLoaded", () => {
loadSettings();
$("saveBtn").addEventListener("click", saveSettings);
});
});
Loading