文案(站点 / 字幕):重写站点卡、凭证、RSS、Cloudflare 与补字幕文案
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
0bf26b78c6
commit
03c5f668ac
9 files changed
+30
-30
No files matched your search
@@ -158,7 +158,7 @@ export function healthMessage(h: SiteLastHealth | null): string | null {
|
||||
|
||||
const HEALTH_REASON_TEXT: Record<string, string> = {
|
||||
logged_in: "首页有登录标志",
|
||||
user_data: "首页没找到登录标志,按用户数据解析成功判为已登录",
|
||||
user_data: "首页没有登录标志,但用户数据解析成功,按已登录处理",
|
||||
login_page: "返回登录页",
|
||||
permission_page: "返回权限提示页",
|
||||
challenge: "疑似人机验证",
|
||||
@@ -198,7 +198,7 @@ export function cloudflareLine(
|
||||
if (st.browserUntil && Date.parse(st.browserUntil) > now.getTime()) {
|
||||
const t = new Date(st.browserUntil);
|
||||
const hm = `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
||||
return { text: `Cloudflare:浏览器代理中,至 ${hm}`, tone: "neutral", takeover: false };
|
||||
return { text: `Cloudflare:浏览器代抓中,到 ${hm}`, tone: "neutral", takeover: false };
|
||||
}
|
||||
if (st.lastSolvedBy) return { text: "Cloudflare:自动通过", tone: "success", takeover: false };
|
||||
if (st.lastError) return { text: "Cloudflare:没能通过", tone: "warning", takeover: false };
|
||||
@@ -206,8 +206,8 @@ export function cloudflareLine(
|
||||
}
|
||||
|
||||
const CF_SOLVED_BY: Record<string, string> = {
|
||||
auto: "等它自动放行",
|
||||
vision: "视觉子流程点了复选框",
|
||||
auto: "自动放行",
|
||||
vision: "自动点了验证复选框",
|
||||
human: "你在原站视图里通过",
|
||||
};
|
||||
const CF_RESULT: Record<string, string> = {
|
||||
@@ -227,8 +227,8 @@ export function cloudflareTechItems(config: unknown): { label: string; value: st
|
||||
if (!st?.lastChallengeAt) return [];
|
||||
const t = (v: string | null) => (v ? new Date(v).toLocaleString("zh-CN", { hour12: false }) : "");
|
||||
return [
|
||||
{ label: "最近遇到挑战", value: t(st.lastChallengeAt) },
|
||||
{ label: "挑战规则", value: st.lastRule ?? "", mono: true },
|
||||
{ label: "最近遇到验证", value: t(st.lastChallengeAt) },
|
||||
{ label: "验证规则", value: st.lastRule ?? "", mono: true },
|
||||
{ label: "处理结果", value: st.lastResult ? `${CF_RESULT[st.lastResult] ?? st.lastResult}(${st.lastResult})` : "" },
|
||||
{ label: "最近通过方式", value: st.lastSolvedBy ? (CF_SOLVED_BY[st.lastSolvedBy] ?? st.lastSolvedBy) : "" },
|
||||
{ label: "最近通过时间", value: t(st.lastSolvedAt) },
|
||||
@@ -236,7 +236,7 @@ export function cloudflareTechItems(config: unknown): { label: string; value: st
|
||||
label: "cf_clearance 复用",
|
||||
value: st.cfReuse === "ok" ? "有效(ok)" : st.cfReuse === "fails" ? "无效(fails)" : "",
|
||||
},
|
||||
{ label: "浏览器代理至", value: t(st.browserUntil) },
|
||||
{ label: "浏览器代抓到", value: t(st.browserUntil) },
|
||||
{ label: "最近尝试", value: t(st.lastAttemptAt) },
|
||||
{ label: "最近错误", value: st.lastError ?? "" },
|
||||
].filter((it) => it.value);
|
||||
@@ -317,7 +317,7 @@ export function loginFailureText(
|
||||
return { text: "登录失败:站点要求二次验证。填写 TOTP 密钥后重试,或改用 Cookie", suggestCookie: true };
|
||||
case "challenge":
|
||||
return {
|
||||
text: "站点要求人机验证(Cloudflare)。会用浏览器自动过,过不去时在铃铛里提醒你",
|
||||
text: "站点要求人机验证(Cloudflare)。会先用浏览器自动通过,失败时在铃铛里提醒",
|
||||
suggestCookie: false,
|
||||
};
|
||||
case "bad_credentials":
|
||||
@@ -333,11 +333,11 @@ export function loginFailureText(
|
||||
suggestCookie: false,
|
||||
};
|
||||
case "network":
|
||||
return { text: `连不上站点${message ? `:${message}` : ""}`, suggestCookie: false };
|
||||
return { text: `连不上站点${message ? `:${message}` : ""}`, suggestCookie: false };
|
||||
case "unsupported":
|
||||
return { text: message ?? "这个站点不支持该凭证类型的自动登录", suggestCookie: false };
|
||||
return { text: message ?? "这个站点不支持用这种凭证自动登录", suggestCookie: false };
|
||||
default:
|
||||
return { text: message ?? "登录失败,原因未知", suggestCookie: false };
|
||||
return { text: message ?? "登录失败", suggestCookie: false };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ export const REASON_SHORT: Record<SiteLoginFailureReason, string> = {
|
||||
two_factor: "需二次验证",
|
||||
bad_credentials: "密码错误",
|
||||
account_blocked: "账号封禁",
|
||||
challenge: "Cloudflare 挑战",
|
||||
challenge: "Cloudflare 验证",
|
||||
auth_expired: "凭证失效",
|
||||
network: "网络失败",
|
||||
unsupported: "不支持",
|
||||
|
||||
Reference in new issue
Block a user