dsh-fish-soul 0.18.24 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/channels/douyin.js +42 -5
- package/lib/channels/vendor/qq-bridge.js +2 -2
- package/lib/client.behavior.js +10 -5
- package/lib/client.diag.js +40 -41
- package/lib/client.douyin.js +66 -53
- package/lib/client.js +60 -27
- package/lib/client.models.js +60 -22
- package/lib/client.persona.js +60 -26
- package/lib/client.scheduled-tasks.js +150 -0
- package/lib/client.soul.js +115 -71
- package/lib/db.js +20 -0
- package/lib/douyin-social.js +1 -1
- package/lib/gateway.js +14 -9
- package/lib/index.js +73 -1
- package/lib/life.js +106 -0
- package/lib/panel.css +71 -96
- package/lib/routes-scheduled-tasks.js +118 -0
- package/lib/routes.js +3 -0
- package/lib/scheduled-tasks.js +462 -0
- package/lib/social.js +1 -1
- package/lib/time-awareness.js +7 -4
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/channels/douyin.js
CHANGED
|
@@ -334,6 +334,21 @@ export function groupSender(m, members = {}) {
|
|
|
334
334
|
return { userId: '', nickname: '' };
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
/**
|
|
338
|
+
* 历史上的 `douyin.selfUid` 曾被存成 JSON 字符串本身(kv 里是带引号的 "\"123\""),
|
|
339
|
+
* 而消息的 senderId 是裸数字 —— 不剥引号就永远比对不上,自己的消息被当成对方发的。
|
|
340
|
+
* 剥完引号还必须是纯数字:不是的(手填的昵称 / 截断值)视为没学到,走未验证路径,不拿脏值去比对。
|
|
341
|
+
*/
|
|
342
|
+
function selfUidFromKv(raw) {
|
|
343
|
+
const s = stripQuotes(String(raw ?? ''));
|
|
344
|
+
return /^\d+$/.test(s) ? s : '';
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** 去掉首尾空白与一层成对的引号。 */
|
|
348
|
+
function stripQuotes(raw) {
|
|
349
|
+
return String(raw ?? '').trim().replace(/^["'](.*)["']$/, '$1').trim();
|
|
350
|
+
}
|
|
351
|
+
|
|
337
352
|
/** 一条抖音私信 → 入站消息(与 QQ 的 normalizeMessageEvent 同形)。不该当消息的返回 null。群聊按发送者分人。 */
|
|
338
353
|
export function normalizeDouyinMessage(m, { name, timeMs, messageId, group = false, members = {}, identity = '', convId = '' }) {
|
|
339
354
|
// 🔴 fromMe 是三态:true(我发的)/ false(对方发的)/ null(算不出,拿不到 selfSecUid)。
|
|
@@ -1567,12 +1582,12 @@ export class DouyinChannel {
|
|
|
1567
1582
|
*/
|
|
1568
1583
|
selfUids() {
|
|
1569
1584
|
const out = [];
|
|
1570
|
-
const learned =
|
|
1585
|
+
const learned = selfUidFromKv(getKv(this.db, 'douyin.selfUid', ''));
|
|
1571
1586
|
if (learned !== '') out.push(learned);
|
|
1572
1587
|
// sec_uid 也走 kv:以前读的是 `this.selfSecUid`,而那个字段**从来没有被赋过值**
|
|
1573
1588
|
// (vendor 里的 selfSecUid 是另一个对象的入参)—— 等于这段永远是空的死分支。
|
|
1574
1589
|
// 现在用 `douyin.selfSecUid` 这个 kv 键,谁能读到就 `setKv` 进来。
|
|
1575
|
-
const sec = String(this.selfSecUid ?? getKv(this.db, 'douyin.selfSecUid', '') ?? '')
|
|
1590
|
+
const sec = stripQuotes(String(this.selfSecUid ?? getKv(this.db, 'douyin.selfSecUid', '') ?? ''));
|
|
1576
1591
|
if (sec !== '' && sec !== learned) out.push(sec);
|
|
1577
1592
|
return out;
|
|
1578
1593
|
}
|
|
@@ -1634,7 +1649,7 @@ export class DouyinChannel {
|
|
|
1634
1649
|
learnSelfUid(convId, msgs) {
|
|
1635
1650
|
const pair = parseSingleConversation(convId);
|
|
1636
1651
|
if (pair === null) return;
|
|
1637
|
-
const known =
|
|
1652
|
+
const known = selfUidFromKv(getKv(this.db, 'douyin.selfUid', ''));
|
|
1638
1653
|
if (known !== '') return;
|
|
1639
1654
|
|
|
1640
1655
|
// ① 最稳的一条:对方发的消息里,senderId 明确是会话两侧之一 → 另一侧就是我。
|
|
@@ -1719,7 +1734,16 @@ export class DouyinChannel {
|
|
|
1719
1734
|
}
|
|
1720
1735
|
|
|
1721
1736
|
async readConversation({ c, name, key, st, sig, unread }) {
|
|
1722
|
-
|
|
1737
|
+
// 群游标挂着单聊形状的 convId(真机见过:某个群被钉上另一个私聊的 0:1:…),
|
|
1738
|
+
// 按它继续读会把私聊内容记进群频道,回复还会按这个 ID 发进人群。
|
|
1739
|
+
// 这里只把污染的固定目标清掉,不改游标:读失败时游标与消息一起留在原地(fail-closed),
|
|
1740
|
+
// 读到真正的群 ID 才由下面的流程重新捕获并覆盖。
|
|
1741
|
+
const stGroup = st?.group === true;
|
|
1742
|
+
const pollutedGroupCursor = stGroup && isSingleConversation(st?.convId);
|
|
1743
|
+
if (pollutedGroupCursor) {
|
|
1744
|
+
this.log('warn', `[fish-soul] 群聊游标「${name}」挂着单聊会话 ID(${st.convId}),已停止沿用,重新捕获会话`);
|
|
1745
|
+
}
|
|
1746
|
+
this.inbox.beginRead(key, `${stGroup ? 'douyin-group' : 'douyin'}:${name}`);
|
|
1723
1747
|
let res;
|
|
1724
1748
|
// 🔴 已固定的会话要钉住,不能被别的会话顶掉(串会话的防线)。
|
|
1725
1749
|
// 单聊:用「现在还能不能推出同一个身份」来验证游标还有效 ——
|
|
@@ -1729,7 +1753,7 @@ export class DouyinChannel {
|
|
|
1729
1753
|
// (identity 字段 = `group:<convId>`)⇒ 记着同一个群就沿用。
|
|
1730
1754
|
const priorIdentity = conversationIdentity(st?.convId, this.selfUids());
|
|
1731
1755
|
const priorIsSingle = priorIdentity !== '' && priorIdentity === st?.identity;
|
|
1732
|
-
const priorIsGroup =
|
|
1756
|
+
const priorIsGroup = stGroup && !pollutedGroupCursor && st?.identity === `group:${String(st?.convId ?? '').trim()}`;
|
|
1733
1757
|
const expectConvId = (priorIsSingle || priorIsGroup) ? String(st?.convId ?? '').trim() : '';
|
|
1734
1758
|
// 🔴 driver.read 内部是一串 browser.eval / captureImBodies / enterChat,**都没有超时**。
|
|
1735
1759
|
// CDP 会话 hang 住 / 页面卡住时它会永远等下去 —— 而 exclusive() 的 maxMs 只让
|
|
@@ -1777,6 +1801,14 @@ export class DouyinChannel {
|
|
|
1777
1801
|
// 群会话的身份靠**会话 ID 本身**(群号),不靠「谁是对端」。
|
|
1778
1802
|
// ⚠️ 但「已固定的会话不能被换掉」这条对群同样成立 ——
|
|
1779
1803
|
// 上面 expectConvId 现在从游标取(不再靠 identity),所以这里统一判。
|
|
1804
|
+
// 被污染的群游标只可能重新捕获到群:读回来还是单聊形状,说明拿到的仍不是这个群,
|
|
1805
|
+
// 按读失败处理 —— 不能让它顺着单聊频道入库(换个频道串会话)。
|
|
1806
|
+
if (pollutedGroupCursor && isSingleConversation(convId)) {
|
|
1807
|
+
this.inbox.failRead(key, '读取失败:群聊游标仍指向单聊会话');
|
|
1808
|
+
this.markReadFailed(key);
|
|
1809
|
+
this.log('warn', `[fish-soul] 读「${name}」仍拿到单聊会话 ID(${convId}),群聊游标未恢复,5 分钟内不再重试`);
|
|
1810
|
+
return;
|
|
1811
|
+
}
|
|
1780
1812
|
const groupConv = !isSingleConversation(convId);
|
|
1781
1813
|
if (convId === '' || (expectConvId && convId !== expectConvId)) {
|
|
1782
1814
|
this.inbox.failRead(key, '读取失败:会话身份缺失或与已验证目标不符');
|
|
@@ -1813,6 +1845,11 @@ export class DouyinChannel {
|
|
|
1813
1845
|
// senderBelongsToConversation 会因「没有 sender」拒掉它们 —— 但它们的身份
|
|
1814
1846
|
// 靠「在当前会话里看到的 + convId 已确认」成立,直接放行
|
|
1815
1847
|
if (String(m?.senderId ?? '').trim() === '' && m?.type && m.type !== 'text') return true;
|
|
1848
|
+
// 单聊的 DOM 纯文本(接口快照陈旧时对方的新话只在这条路上)没有 senderId:
|
|
1849
|
+
// 会话 ID 已在上面确认,单聊只有两方,明确是对方发的(fromMe === false)就是对方。
|
|
1850
|
+
// 只对单聊放行 —— 群里的发言人必须能对上,不能借这条混进来。
|
|
1851
|
+
if (isSingleConversation(convId) && Number(m?.convType) !== 2 && m?.fromMe === false
|
|
1852
|
+
&& String(m?.senderId ?? '').trim() === '' && (!m?.type || m.type === 'text')) return true;
|
|
1816
1853
|
// 🔴 群会话(convType=2 或会话 ID 不是 0:1: 形状)里的发言人是**群成员**,
|
|
1817
1854
|
// 不在「会话两侧」里 —— 单聊那套判据会把群消息整批丢掉。
|
|
1818
1855
|
// 群的身份靠「这条消息的 convId 就是当前会话」(上面已经校验过)。
|
|
@@ -169,7 +169,7 @@ export function 提取图块(message) {
|
|
|
169
169
|
* ⭐ 2026-11-21:模型有时会自己造格式——`[表情:比耶开心]` 这种纯文字标记,
|
|
170
170
|
* 代码里没有出站处理路径,会被当成普通文字发到 QQ 上,对方看到一串方括号。
|
|
171
171
|
* 这里兜底:把 `[表情:xx]` 换成 `` 发真图;
|
|
172
|
-
*
|
|
172
|
+
* 库里没有这个名字就原样保留,不静默剥掉(#189)。
|
|
173
173
|
*
|
|
174
174
|
* 只认精确匹配(文件名主体 = xx),不做模糊匹配——模糊匹配容易误伤,
|
|
175
175
|
* 比如 `[表情:OK]` 匹配到 `兔子OK.gif` 不是模型想要的。
|
|
@@ -195,7 +195,7 @@ export function 兜底表情包(文字, stickerFiles) {
|
|
|
195
195
|
return 文本.replace(/\[表情:([^\]]*)\]/g, (全, 名) => {
|
|
196
196
|
const 文件名 = 映射.get(String(名 || '').trim());
|
|
197
197
|
if (文件名) return ``;
|
|
198
|
-
return
|
|
198
|
+
return 全; // #189:库里没有就原样留着,别静默剥掉
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
|
package/lib/client.behavior.js
CHANGED
|
@@ -23,7 +23,12 @@ window.__ModuleLoader__.load({
|
|
|
23
23
|
function NumField({ value, min, max, step, label, onSave, ui }) {
|
|
24
24
|
const [v, setV] = react.useState(String(value));
|
|
25
25
|
react.useEffect(() => { setV(String(value)); }, [value]);
|
|
26
|
-
return ui.Num({ value: v, min, max, step, "aria-label": label, onChange: (e) => setV(e.target.value), onBlur: () => {
|
|
26
|
+
return ui.Num({ value: v, min, max, step, "aria-label": label, onChange: (e) => setV(e.target.value), onBlur: () => {
|
|
27
|
+
if (v.trim() === "" || !Number.isFinite(Number(v))) { setV(String(value)); return; }
|
|
28
|
+
const clamped = Math.min(max ?? Infinity, Math.max(min ?? -Infinity, Number(v)));
|
|
29
|
+
setV(String(clamped));
|
|
30
|
+
if (clamped !== value) onSave(clamped);
|
|
31
|
+
} });
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
/** 失焦才保存的多行列表(一行一个) */
|
|
@@ -140,13 +145,13 @@ window.__ModuleLoader__.load({
|
|
|
140
145
|
}
|
|
141
146
|
const topics = d.topics?.items ?? [];
|
|
142
147
|
const now = Date.now();
|
|
143
|
-
return Group({ title: "
|
|
148
|
+
return Group({ title: "每晚记录", aside: Button({ disabled: busy, onClick: writeNow }, busy ? "在写…" : "现在写一篇") },
|
|
144
149
|
Row({ title: "每晚写日记", desc: "记成她自己的私密记忆(群里不会想起),顺便想想明天想跟谁聊什么" },
|
|
145
150
|
h(Switch, { label: "每晚写日记", checked: c.enabled, onChange: (v) => save({ diary: { enabled: v } }) })),
|
|
146
|
-
c.enabled ? Row({ title: "几点写" }, h(NumField, { ui, value: c.hour, min: 18, max: 23, step: 1, label: "几点写", onSave: (n) => save({ diary: { hour: n } }) }), Muted("
|
|
151
|
+
c.enabled ? Row({ title: "几点写" }, h(NumField, { ui, value: c.hour, min: 18, max: 23, step: 1, label: "几点写", onSave: (n) => save({ diary: { hour: n } }) }), Muted("点以后")) : null,
|
|
147
152
|
Row({ title: "发到 QQ 空间", desc: "默认关;SnowLuma 不支持的话会在动态里记一条失败" },
|
|
148
153
|
h(Switch, { label: "发到 QQ 空间", checked: c.qzone, onChange: (v) => save({ diary: { qzone: v } }) })),
|
|
149
|
-
topics.length === 0 ? null : h("div", { className: "fs-list" }, topics.map((x
|
|
154
|
+
topics.length === 0 ? null : h("div", { className: "fs-list" }, topics.map((x) => h("div", { className: "fs-item", key: `${x.who ?? ""}:${x.topic}` },
|
|
150
155
|
Tag("想聊", "info"), h("span", { className: "fs-item-main" }, `${x.who ? `${x.who}:` : ""}${x.topic}`),
|
|
151
156
|
h("span", { className: "fs-item-meta" }, IconButton("close", "删除", async () => {
|
|
152
157
|
const r = await api("POST", "/diary/topic-remove", { who: x.who ?? "", topic: x.topic });
|
|
@@ -170,7 +175,7 @@ window.__ModuleLoader__.load({
|
|
|
170
175
|
const groups = data.groups ?? [];
|
|
171
176
|
return h(react.Fragment, null,
|
|
172
177
|
section === "habits" ? h(Habits, { cfg: data.config, save, ui }) : null,
|
|
173
|
-
section === "groups" ? Group({ title: "每个群" }, groups.length === 0 ? Empty("
|
|
178
|
+
section === "groups" ? Group({ title: "每个群" }, groups.length === 0 ? Empty("还没有群")
|
|
174
179
|
: groups.map((g) => h(GroupNote, { key: g.groupId, g, api, notify, onSaved: load, ui }))) : null,
|
|
175
180
|
section === "models" ? h(ChatModels, { data, api, notify, load, ui }) : null,
|
|
176
181
|
section === "diary" ? h(Diary, { data, save, api, notify, load, relTime, ui }) : null);
|
package/lib/client.diag.js
CHANGED
|
@@ -23,25 +23,32 @@ window.__ModuleLoader__.load({
|
|
|
23
23
|
/** 跟 ActivityPane 一样的轮询小工具(各分块页各有一份,不跨块 import)。 */
|
|
24
24
|
function usePoll(api, path, ms) {
|
|
25
25
|
const [data, setData] = react.useState(null);
|
|
26
|
-
const
|
|
26
|
+
const [err, setErr] = react.useState("");
|
|
27
|
+
const load = react.useCallback(async (guard) => {
|
|
27
28
|
const r = await api("GET", path);
|
|
28
|
-
if (
|
|
29
|
+
if (guard && !guard()) return;
|
|
30
|
+
if (r?.ok) { setData(r); setErr(""); }
|
|
31
|
+
else setErr(r?.error ?? "日志读取失败");
|
|
29
32
|
}, [api, path]);
|
|
30
33
|
react.useEffect(() => {
|
|
31
34
|
let alive = true;
|
|
32
|
-
const run =
|
|
35
|
+
const run = () => load(() => alive);
|
|
33
36
|
run();
|
|
34
37
|
const t = setInterval(run, ms);
|
|
35
38
|
return () => { alive = false; clearInterval(t); };
|
|
36
39
|
}, [load, ms]);
|
|
37
|
-
return [data, load];
|
|
40
|
+
return [data, () => load(), err];
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
function DiagPane({ api, notify, ui }) {
|
|
41
|
-
const { h, Group, Tag, Button,
|
|
44
|
+
const { h, Group, Tag, Button, useConfirm = () => [async () => true, null] } = ui;
|
|
42
45
|
const [raw, setRaw] = react.useState(false);
|
|
43
|
-
const [data, load] = usePoll(api, "/diag-log", 15000);
|
|
44
|
-
|
|
46
|
+
const [data, load, err] = usePoll(api, "/diag-log", 15000);
|
|
47
|
+
const [confirm, confirmNode] = useConfirm();
|
|
48
|
+
if (!data) {
|
|
49
|
+
if (err) return h("div", { className: "fs-notice", role: "alert" }, h("b", null, "运行日志读取失败"), h("span", null, err), Button({ onClick: load }, "重试"));
|
|
50
|
+
return h("div", { className: "fs-empty" }, "加载中…");
|
|
51
|
+
}
|
|
45
52
|
|
|
46
53
|
const entries = data.entries ?? [];
|
|
47
54
|
const pad = (n) => String(n).padStart(2, "0");
|
|
@@ -57,52 +64,44 @@ window.__ModuleLoader__.load({
|
|
|
57
64
|
if (d.sessionId) bits.push(`会话 ${String(d.sessionId).slice(0, 12)}…`);
|
|
58
65
|
if (d.channelId) bits.push(`聊天 ${d.channelId}`);
|
|
59
66
|
if (d.count !== undefined) bits.push(`${d.count} 条`);
|
|
60
|
-
if (d.chars !== undefined) bits.push(`${d.chars} 字${d.budget ? ` / 预算 ${d.budget}` : ""}${d.over80 ? "
|
|
67
|
+
if (d.chars !== undefined) bits.push(`${d.chars} 字${d.budget ? ` / 预算 ${d.budget}` : ""}${d.over80 ? " · 超 80%" : ""}`);
|
|
61
68
|
if (d.code) bits.push(`错误码 ${String(d.code).slice(0, 48)}`);
|
|
62
69
|
if (d.reason) bits.push(String(d.reason).slice(0, 120));
|
|
63
70
|
if (d.error) bits.push(String(d.error).slice(0, 120));
|
|
64
71
|
if (e.count > 1) bits.push(`重复 ${e.count} 次`);
|
|
65
|
-
return bits.join(",") || "
|
|
72
|
+
return bits.join(",") || "无细节";
|
|
73
|
+
};
|
|
74
|
+
const copy = async () => {
|
|
75
|
+
try { await navigator.clipboard.writeText(JSON.stringify(entries, null, 2)); notify("已复制"); }
|
|
76
|
+
catch { notify("复制失败,手动选中复制"); }
|
|
77
|
+
};
|
|
78
|
+
const clearLogs = async () => {
|
|
79
|
+
if (!(await confirm({ title: "清空运行日志", description: "清空当前的运行记录?", danger: true }))) return;
|
|
80
|
+
const r = await api("POST", "/diag-log/clear", {});
|
|
81
|
+
if (r?.ok) { notify("已清空"); load(); } else notify(r?.error ?? "清空失败");
|
|
66
82
|
};
|
|
67
|
-
const levelStyle = (lv) => (lv === "error"
|
|
68
|
-
? { color: "var(--dsw-alias-state-error-primary, #d93025)" }
|
|
69
|
-
: lv === "warn" ? { color: "var(--dsw-alias-state-warning-primary, #b26a00)" } : null);
|
|
70
83
|
|
|
71
84
|
return Group({
|
|
72
|
-
title: "
|
|
73
|
-
|
|
85
|
+
title: "最近 200 条",
|
|
86
|
+
tip: "插件启动步骤、人格卡挂载与每轮上下文长度,仅留内存不落盘",
|
|
87
|
+
aside: h("span", { className: "fs-group-aside" },
|
|
74
88
|
Tag(String(entries.length), "outline"),
|
|
75
|
-
Button({
|
|
76
|
-
Button({
|
|
77
|
-
Button({
|
|
78
|
-
|
|
79
|
-
onClick: async () => {
|
|
80
|
-
const r = await api("POST", "/diag-log/clear", {});
|
|
81
|
-
if (r?.ok) { notify("已清空"); load(); } else notify(r?.error ?? "清空失败");
|
|
82
|
-
}
|
|
83
|
-
}, "清空"))
|
|
89
|
+
Button({ onClick: () => load() }, "刷新"),
|
|
90
|
+
Button({ disabled: entries.length === 0, onClick: copy }, "复制"),
|
|
91
|
+
Button({ "aria-pressed": raw, onClick: () => setRaw((v) => !v) }, raw ? "看时间线" : "看原始"),
|
|
92
|
+
Button({ variant: "danger", disabled: entries.length === 0, onClick: clearLogs }, "清空"))
|
|
84
93
|
},
|
|
85
|
-
Muted("插件自己的运行记录:启动到哪一步、人格卡/瞬态块有没有挂上、会话是新建还是恢复、每轮上下文多长。只留最近 200 条,不落盘。"),
|
|
86
|
-
Muted("这里没有「宿主压缩上下文」的记录 —— 宿主不广播那个事件,插件看不到。上下文变长能在「这一轮上下文长度」里看出来。"),
|
|
87
94
|
entries.length === 0
|
|
88
95
|
? h("div", { className: "fs-empty" }, "还没有记录。重启宿主后回来就能看到启动过程。")
|
|
89
96
|
: raw
|
|
90
|
-
? h("pre", {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
display: "flex", gap: 10, alignItems: "baseline",
|
|
99
|
-
padding: "4px 0", borderBottom: "1px solid var(--dsw-alias-border-l1, #eee)", fontSize: 13
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
h("span", { style: { color: "var(--dsw-alias-text-3, #888)", fontVariantNumeric: "tabular-nums", flex: "0 0 auto" } }, fmtTime(e.at)),
|
|
103
|
-
h("span", { style: { fontWeight: 500, flex: "0 0 auto", ...(levelStyle(e.level) ?? {}) } }, e.label),
|
|
104
|
-
h("span", { style: { color: "var(--dsw-alias-text-2, #555)", wordBreak: "break-word" } }, describe(e)))))
|
|
105
|
-
);
|
|
97
|
+
? h("pre", { className: "fs-report fs-diag-raw" }, JSON.stringify(entries, null, 2))
|
|
98
|
+
: h("div", { className: "fs-diag-list" },
|
|
99
|
+
entries.map((e, i) => h("div", { key: `${e.at}-${e.key ?? i}`, className: "fs-diag-row" },
|
|
100
|
+
h("span", { className: "fs-diag-time" }, fmtTime(e.at)),
|
|
101
|
+
e.level === "error" ? Tag("错误", "danger") : e.level === "warn" ? Tag("警告", "warning") : null,
|
|
102
|
+
h("span", { className: "fs-diag-label", "data-level": e.level }, e.label),
|
|
103
|
+
h("span", { className: "fs-diag-detail" }, describe(e))))),
|
|
104
|
+
confirmNode);
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
return { DiagPane };
|
package/lib/client.douyin.js
CHANGED
|
@@ -16,7 +16,7 @@ window.__ModuleLoader__.load({
|
|
|
16
16
|
{ value: "volc", label: "火山方舟" },
|
|
17
17
|
{ value: "minimax", label: "MiniMax" },
|
|
18
18
|
{ value: "openai-compat", label: "OpenAI 兼容" },
|
|
19
|
-
{ value: "openmotion", label: "OpenMotion
|
|
19
|
+
{ value: "openmotion", label: "OpenMotion 本地渲染" }
|
|
20
20
|
];
|
|
21
21
|
// 各家常用接口地址示例(接口地址、API Key、模型名都必须填;填错会被对方拒绝)。
|
|
22
22
|
const VIDEO_BASE_URLS = {
|
|
@@ -33,24 +33,34 @@ window.__ModuleLoader__.load({
|
|
|
33
33
|
function LoginView({ api, notify, refresh, ui }) {
|
|
34
34
|
const { h, Empty, Dot } = ui;
|
|
35
35
|
const [shot, setShot] = react.useState(null);
|
|
36
|
+
const timerRef = react.useRef(null);
|
|
37
|
+
const aliveRef = react.useRef(true);
|
|
36
38
|
const load = react.useCallback(async () => {
|
|
37
39
|
const r = await api("POST", "/douyin/screenshot", { checkLogin: true });
|
|
40
|
+
if (!aliveRef.current) return;
|
|
38
41
|
if (r?.ok) {
|
|
39
42
|
setShot(r);
|
|
40
43
|
if (r.loggedIn === true) { notify("抖音已登录"); refresh(); }
|
|
41
44
|
}
|
|
42
|
-
}, [api]);
|
|
45
|
+
}, [api, notify, refresh]);
|
|
43
46
|
react.useEffect(() => {
|
|
47
|
+
aliveRef.current = true;
|
|
44
48
|
load();
|
|
45
49
|
const t = setInterval(load, 3000);
|
|
46
|
-
return () => clearInterval(t);
|
|
50
|
+
return () => { aliveRef.current = false; clearInterval(t); if (timerRef.current) clearTimeout(timerRef.current); };
|
|
47
51
|
}, [load]);
|
|
48
52
|
const click = async (e) => {
|
|
49
53
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
50
54
|
await api("POST", "/douyin/click", { x: (e.clientX - rect.left) / rect.width, y: (e.clientY - rect.top) / rect.height });
|
|
51
|
-
|
|
55
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
56
|
+
timerRef.current = setTimeout(load, 700);
|
|
52
57
|
};
|
|
53
|
-
return h("figure", {
|
|
58
|
+
return h("figure", {
|
|
59
|
+
className: "fs-shot", role: "button", tabIndex: 0, "aria-label": "抖音浏览器截图,点击操作窗口",
|
|
60
|
+
onClick: click,
|
|
61
|
+
onKeyDown: (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); api("POST", "/douyin/click", { x: 0.5, y: 0.5 }).then(() => { if (timerRef.current) clearTimeout(timerRef.current); timerRef.current = setTimeout(load, 700); }); } },
|
|
62
|
+
title: "点击会点到那个浏览器窗口"
|
|
63
|
+
},
|
|
54
64
|
shot === null ? Empty(Dot("ongoing")) : h("img", { alt: "抖音浏览器截图", src: shot.image, draggable: false }));
|
|
55
65
|
}
|
|
56
66
|
|
|
@@ -110,11 +120,14 @@ window.__ModuleLoader__.load({
|
|
|
110
120
|
|
|
111
121
|
const act = async (path, body, okMsg, failMsg) => {
|
|
112
122
|
setBusy(true);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
try {
|
|
124
|
+
const r = await api("POST", path, body);
|
|
125
|
+
if (!r?.ok) notify(r?.error ?? failMsg);
|
|
126
|
+
else { if (okMsg) notify(okMsg); refresh(); }
|
|
127
|
+
return r;
|
|
128
|
+
} finally {
|
|
129
|
+
setBusy(false);
|
|
130
|
+
}
|
|
118
131
|
};
|
|
119
132
|
const save = async (p = {}) => {
|
|
120
133
|
const hadKey = form.videoApiKey !== "";
|
|
@@ -179,48 +192,42 @@ window.__ModuleLoader__.load({
|
|
|
179
192
|
notices.length === 0 ? null : h("div", { className: "fs-notice", role: "alert" },
|
|
180
193
|
...notices.map(([t, text]) => h("span", { key: t }, h("b", null, t), ` · ${text}`))),
|
|
181
194
|
Group({ title: "浏览器" },
|
|
195
|
+
Row({ title: "抖音接入" }, poll, sw("抖音接入", d.enabled === true, (v) => save({ top: { enabled: v } }))),
|
|
182
196
|
Row({ title: "专用浏览器" },
|
|
183
197
|
Select({ value: form.custom ? CUSTOM : (d.browserPref?.kind ?? "edge"), "aria-label": "专用浏览器", onChange: (e) => pick(e.target.value) },
|
|
184
198
|
...browsers.map((b) => h("option", { key: b.kind, value: b.kind }, `${b.name}${b.version ? ` ${b.version}` : ""}`)),
|
|
185
199
|
browsers.length === 0 ? h("option", { key: "none", value: d.browserPref?.kind ?? "edge", disabled: true }, "没找到浏览器") : null,
|
|
186
200
|
h("option", { key: CUSTOM, value: CUSTOM }, "手动指定路径…")),
|
|
187
201
|
IconButton("refresh", "重新查找", () => act("/douyin/browser/rescan", {}, "已重新查找", "没找到"), { disabled: busy })),
|
|
188
|
-
form.custom ? Row({ title: "浏览器路径" }, Input({ ...bind("customPath"), placeholder: "C:\\…\\chrome.exe" })) : null,
|
|
202
|
+
form.custom ? Row({ title: "浏览器路径" }, Input({ ...bind("customPath"), "aria-label": "浏览器路径", placeholder: "C:\\…\\chrome.exe" })) : null,
|
|
189
203
|
Row({ title: "状态" }, hostState,
|
|
190
204
|
running ? null : Button({ variant: "primary", disabled: busy || d.enabled !== true, onClick: () => act("/douyin/browser/start", {}, "浏览器已启动", "没启动起来") }, "启动"),
|
|
191
|
-
running && host.loggedIn === true ? Button({
|
|
192
|
-
running ? Button({ variant: "danger", disabled: busy, onClick: () => act("/douyin/browser/close", {}, "浏览器已关闭", "关不掉") }, "关闭") : null),
|
|
205
|
+
running && host.loggedIn === true ? Button({ "aria-expanded": showShot, onClick: () => setShowShot(!showShot) }, showShot ? "收起截图" : "截图") : null,
|
|
206
|
+
running ? Button({ variant: "danger", disabled: busy, onClick: async () => { if (await confirm({ title: "关闭专用浏览器", description: "关闭正在运行的抖音浏览器?", danger: true })) await act("/douyin/browser/close", {}, "浏览器已关闭", "关不掉"); } }, "关闭") : null),
|
|
193
207
|
Row({ title: "窗口", desc: d.window === "visible" ? "最小化了的话,她看私信 / 刷视频时会弹出来" : "停在屏幕外,不会弹出来打扰你;别在任务栏把它最小化" },
|
|
194
|
-
running && d.window !== "visible" ? Button({
|
|
208
|
+
running && d.window !== "visible" ? Button({ disabled: busy, onClick: () => act("/douyin/window", { show: !d.windowShown }, null, "窗口挪不动") }, d.windowShown ? "藏起来" : "显示一下") : null,
|
|
195
209
|
h(Seg, { label: "窗口", value: d.window === "visible" ? "visible" : "background", options: WINDOW_MODES, onChange: (v) => save({ top: { window: v } }) })),
|
|
196
210
|
running && (host.loggedIn !== true || showShot) ? h(LoginView, { api, notify, refresh, ui }) : null),
|
|
197
211
|
Group({ title: "私信" },
|
|
198
212
|
d.channel?.identityBlocked
|
|
199
|
-
? Row({ title: "私信身份未就绪",
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
Row({ title: "抖音接入" }, poll, sw("抖音接入", d.enabled === true, (v) => save({ top: { enabled: v } }))),
|
|
213
|
+
? Row({ title: "私信身份未就绪", meta: d.channel?.identityState?.disabledByFlag ? "已被 DOUYIN_IDENTITY_BLOCKED 手动停用" : "尚未学到这个抖音号自己的 uid,正常聊过一轮后自动学到" },
|
|
214
|
+
State("warning", "未就绪"))
|
|
215
|
+
: Row({ title: "私信按会话认人", meta: (d.channel?.identityState?.selfUids ?? []).length ? `本号 uid:${d.channel.identityState.selfUids.join(" / ")}` : "按会话 ID 0:1:我方:对方 认人", desc: "昵称只作展示,改名或同名都不会串人;发送前用会话 ID 校验目标" },
|
|
216
|
+
State("done", "已就绪")),
|
|
204
217
|
Row({ title: "自动回复" }, d.autoReply ? null : Muted("只记不回"), sw("自动回复", d.autoReply === true, (v) => save({ top: { autoReply: v } }))),
|
|
205
218
|
(d.channel?.inbox?.counts?.processing ?? 0) > 0 ? Muted(`正在处理 ${d.channel.inbox.counts.processing} 条;如果长时间不变,重启后核实`) : null,
|
|
206
|
-
Row({ title: "
|
|
207
|
-
Input({ ...bind("masterUid"), placeholder: "你的抖音数字 uid" })),
|
|
208
|
-
Row({ title: "主人的名字", desc: "
|
|
209
|
-
// 🔴 填了「主人身份」但跟已学到的真实 uid 对不上 ⇒ 显式警告。
|
|
210
|
-
// 静默失效是最坏的失败:用户看到的是「她不理我」,不会想到是配置。
|
|
211
|
-
// 短号和真实 uid 都是纯数字,用户分不出来 —— 必须在这里点破。
|
|
219
|
+
Row({ title: "主人身份", meta: "可选,仅用于标为主人,不影响收发私信", desc: "填你自己的抖音数字 uid;注意上面显示的是机器人自己这个号的 uid,不是你的。只填数字就行" },
|
|
220
|
+
Input({ ...bind("masterUid"), inputMode: "numeric", "aria-label": "主人身份 uid", placeholder: "你的抖音数字 uid" })),
|
|
221
|
+
Row({ title: "主人的名字", desc: "仅作显示,不授予任何权限" }, Input({ ...bind("masterName"), "aria-label": "主人的名字", placeholder: "她私信列表里你的名字" })),
|
|
212
222
|
d.channel?.identityState?.masterUidMismatch
|
|
213
223
|
? Row({ title: "这个 uid 认不出来" }, State("warning",
|
|
214
|
-
`你填的 ${d.channel.identityState.masterUidMismatch.filled}
|
|
215
|
-
|
|
216
|
-
+ `已学到的身份:${d.channel.identityState.masterUidMismatch.learned.join(" / ")}`))
|
|
224
|
+
`你填的 ${d.channel.identityState.masterUidMismatch.filled} 跟已学到的抖音身份对不上,多半填成了账号短号。留空就行;已学到的身份:${d.channel.identityState.masterUidMismatch.learned.join(" / ")}`,
|
|
225
|
+
undefined, true))
|
|
217
226
|
: null,
|
|
218
|
-
// 待确认的抖音身份:昵称对应表只能「定位」,绑定必须主人亲手确认一次
|
|
219
|
-
// (自动绑 = 谁先来谁被绑,冒充者改名就能顶身份;实测确认过这个洞)。
|
|
220
227
|
(candidates ?? []).length === 0 ? null : Group({ title: "待确认的抖音身份" },
|
|
221
|
-
Muted("
|
|
228
|
+
Muted("请核对 uid 是不是你自己,确认后点「是我」。"),
|
|
222
229
|
...(candidates ?? []).map((c) => Row({ key: c.name, title: `${c.name} → QQ ${c.qq}`,
|
|
223
|
-
|
|
230
|
+
meta: `抖音 uid ${c.uid}${c.at ? ` · ${new Date(c.at).toLocaleString()}` : ""}` },
|
|
224
231
|
Button({ variant: "primary", disabled: busy, onClick: async () => {
|
|
225
232
|
setBusy(true);
|
|
226
233
|
try {
|
|
@@ -231,40 +238,46 @@ window.__ModuleLoader__.load({
|
|
|
231
238
|
} }, "是我"),
|
|
232
239
|
Button({ variant: "outline", disabled: busy, onClick: async () => {
|
|
233
240
|
setBusy(true);
|
|
234
|
-
try {
|
|
241
|
+
try {
|
|
242
|
+
const r = await api("POST", "/douyin/uin-dismiss", { name: c.name });
|
|
243
|
+
if (r?.ok) { notify(`已忽略:${c.name}`); await loadCandidates(); refresh(); }
|
|
244
|
+
else notify(r?.error ?? "操作失败");
|
|
245
|
+
} finally { setBusy(false); }
|
|
235
246
|
} }, "不是我")))),
|
|
236
247
|
Row({ title: "回所有能私信她的人", desc: d.replyAll ? "建议在抖音隐私设置里把「谁可以私信我」设为互关好友" : null },
|
|
237
248
|
sw("回所有能私信她的人", d.replyAll === true, (v) => save({ top: { replyAll: v } }))),
|
|
238
|
-
Row({ title: "超过多久的消息只记不回", desc: "
|
|
249
|
+
Row({ title: "超过多久的消息只记不回", desc: "断线补拉或重启后积压的老消息,超过这个时间就只记进记忆、不回复" },
|
|
239
250
|
Num({ min: 1, max: 1440, value: form.replyWindowMinutes, "aria-label": "分钟", onChange: (e) => patch({ replyWindowMinutes: e.target.value }), onBlur: () => save({ top: { replyWindowMinutes: form.replyWindowMinutes === "" ? 120 : Number(form.replyWindowMinutes) } }) }), Muted("分钟")),
|
|
240
|
-
d.replyAll ? null : Row({ title: "白名单", stack: true }, Area({ ...bind("allowList"), placeholder: "对方的抖音数字 uid,每行一个;昵称不参与放行" }))),
|
|
251
|
+
d.replyAll ? null : Row({ title: "白名单", stack: true }, Area({ ...bind("allowList"), "aria-label": "白名单", placeholder: "对方的抖音数字 uid,每行一个;昵称不参与放行" }))),
|
|
241
252
|
Group({ title: "群聊" },
|
|
242
253
|
Row({ title: "群里被叫到时回", desc: "群聊按说话的人分开认,不会当成一个人;没人 @ 她或叫她名字时只看不说" },
|
|
243
254
|
sw("群里被叫到时回", d.groupReply === true, (v) => save({ top: { groupReply: v } }))),
|
|
244
|
-
Row({ title: "叫她的名字", stack: true }, Area({ ...bind("callNames"),
|
|
245
|
-
Row({ title: "这些会话是群", stack: true }, Area({ ...bind("groups"), placeholder: "
|
|
255
|
+
Row({ title: "叫她的名字", stack: true }, Area({ ...bind("callNames"), "aria-label": "叫她的名字", placeholder: "她的抖音昵称等,每行一个" })),
|
|
256
|
+
Row({ title: "这些会话是群", stack: true }, Area({ ...bind("groups"), "aria-label": "这些会话是群", placeholder: "认不出来的群在这里填会话名,每行一个" }))),
|
|
246
257
|
Group({ title: "刷视频", aside: Tag(`今天 ${br.todayCount ?? 0} / ${br.perDay ?? 3}`, "outline") },
|
|
247
258
|
Row({ title: "空闲时自己刷" },
|
|
248
|
-
browseOn ? Button({
|
|
259
|
+
browseOn ? Button({ disabled: busy || br.running === true || d.enabled !== true || !running, onClick: () => act("/douyin/browse-now", {}, "开始刷了", "没刷成") }, br.running ? "正在刷…" : "现在刷") : null,
|
|
249
260
|
sw("空闲时自己刷", browseOn, (v) => save({ browse: { enabled: v } }))),
|
|
250
261
|
browseOn ? Row({ title: "每天" },
|
|
251
262
|
Num({ min: 0, max: 12, "aria-label": "轮数", ...bind("perDay") }), Muted("轮 ×"),
|
|
252
263
|
Num({ min: 1, max: 6, "aria-label": "每轮条数", ...bind("videosPerSession") }), Muted("条")) : null,
|
|
253
|
-
browseOn ? Row({ title: "
|
|
254
|
-
sw("
|
|
255
|
-
browseOn ? Row({ title: "喜欢就点赞", desc: "
|
|
256
|
-
browseOn ? Row({ title: "喜欢就收藏", desc: "
|
|
257
|
-
browseOn ? Row({ title: "抽帧看画面", desc: "把视频开头均匀抽 9
|
|
258
|
-
browseOn && br.frames === true ? Row({ title: "一天最多看几条", desc: "
|
|
259
|
-
Num({ min: 0, max: 20, value: framesPerDay, onChange: (e) => setFramesPerDay(e.target.value), onBlur: () => { const n = Number(framesPerDay); if (n !== br.framesPerDay) save({ browse: { framesPerDay: n } }); } }), Muted("条")) : null,
|
|
260
|
-
browseOn ? Row({ title: "刷到有意思的发给你", desc: br.shareInDm !== false ? "
|
|
264
|
+
browseOn ? Row({ title: "走接口刷", desc: "直接调抖音网页端接口拉推荐流和评论,不用开专用浏览器;关掉就回到浏览器里滑推荐页" },
|
|
265
|
+
sw("走接口刷", br.mode !== "browser", (v) => save({ browse: { mode: v ? "http" : "browser" } }))) : null,
|
|
266
|
+
browseOn ? Row({ title: "喜欢就点赞", desc: "模型判断特别喜欢时才点赞" }, sw("喜欢就点赞", br.like === true, (v) => save({ browse: { like: v } }))) : null,
|
|
267
|
+
browseOn ? Row({ title: "喜欢就收藏", desc: "模型说想留着以后再看时收藏,默认关" }, sw("喜欢就收藏", br.collect === true, (v) => save({ browse: { collect: v } }))) : null,
|
|
268
|
+
browseOn ? Row({ title: "抽帧看画面", desc: "把视频开头均匀抽 9 张拼成九宫格让模型识图;每条多一次识图调用" }, sw("抽帧看画面", br.frames === true, (v) => save({ browse: { frames: v } }))) : null,
|
|
269
|
+
browseOn && br.frames === true ? Row({ title: "一天最多看几条", desc: "自己刷的时候,一天最多抽几次帧" },
|
|
270
|
+
Num({ min: 0, max: 20, value: framesPerDay, "aria-label": "一天最多看几条", onChange: (e) => setFramesPerDay(e.target.value), onBlur: () => { if (framesPerDay === "") return; const n = Number(framesPerDay); if (Number.isFinite(n) && n !== br.framesPerDay) save({ browse: { framesPerDay: n } }); } }), Muted("条")) : null,
|
|
271
|
+
browseOn ? Row({ title: "刷到有意思的发给你", desc: br.shareInDm !== false ? "带链接和感受发到你的抖音私信,没连上就发 QQ;一天最多 2 条" : "带链接和感受发到你的 QQ 私聊;一天最多 2 条" }, sw("刷到有意思的发给你", br.share !== false, (v) => save({ browse: { share: v } }))) : null,
|
|
261
272
|
browseOn && br.share !== false ? Row({ title: "在抖音私信里分享", desc: "要填「主人的名字」、开自动回复" }, sw("在抖音私信里分享", br.shareInDm !== false, (v) => save({ browse: { shareInDm: v } }))) : null,
|
|
262
|
-
browseOn && br.share !== false && br.shareInDm !== false ? Row({ title: "发原生视频卡片", desc: "
|
|
273
|
+
browseOn && br.share !== false && br.shareInDm !== false ? Row({ title: "发原生视频卡片", desc: "在抖音私信里发点开就播的原生卡片;需专用浏览器开着,且按收件人身份锁定" }, sw("发原生视频卡片", d.shareCard === true, (v) => save({ top: { shareCard: v } }))) : null),
|
|
263
274
|
Group({ title: "作品和评论", aside: (post.enabled || video.enabled) ? h("span", { className: "fs-group-aside" },
|
|
264
275
|
post.enabled ? Tag(`今天发了 ${so.post?.todayCount ?? 0} / ${post.perDay ?? 1}`, "outline") : null,
|
|
265
276
|
video.enabled ? Tag(`今天视频 ${so.video?.todayCount ?? 0} / ${video.perDay ?? 1}`, "outline") : null) : null },
|
|
266
277
|
Row({ title: "自己发图文", desc: "把想说的话做成文字卡片,在创作者中心发图文;创作者中心可能要单独登录一次" },
|
|
267
|
-
post.enabled ? Button({
|
|
278
|
+
post.enabled ? Button({ disabled: busy || so.post?.running === true || so.video?.running === true || Boolean(so.postPending) || d.enabled !== true || !running, onClick: async () => {
|
|
279
|
+
if (await confirm({ title: "现在发一条图文?", description: "将在抖音创作者中心公开发布一条图文动态。", confirmLabel: "发布" })) await act("/douyin/post-now", {}, "发出去了", "没发成");
|
|
280
|
+
} }, so.post?.running ? "正在发…" : "现在发一条") : null,
|
|
268
281
|
sw("自己发图文", post.enabled === true, (v) => save({ post: { enabled: v } }))),
|
|
269
282
|
post.enabled ? Row({ title: "每天最多" }, Num({ min: 0, max: 5, "aria-label": "每天最多几条", ...bind("postPerDay") }), Muted("条")) : null,
|
|
270
283
|
// 视频:生成要调付费接口(按条计费)—— 开关旁边必须写清楚这是花钱的操作,点击前也要二次确认。
|
|
@@ -289,16 +302,16 @@ window.__ModuleLoader__.load({
|
|
|
289
302
|
Select({ value: form.videoResolution, "aria-label": "分辨率", onChange: (e) => { const v = e.target.value; patch({ videoResolution: v }); save({ video: { resolution: v } }); } },
|
|
290
303
|
...VIDEO_RESOLUTIONS.map((o) => h("option", { key: o.value, value: o.value }, o.label)))) : null,
|
|
291
304
|
video.enabled ? Row({ title: "每天最多" }, Num({ min: 0, max: 5, "aria-label": "每天最多几条视频", ...bind("videoPerDay") }), Muted("条")) : null,
|
|
292
|
-
so.postPending ? Row({ title: so.postPending.kind === "video" ? "视频结果待核实" : "图文结果待核实",
|
|
293
|
-
Button({
|
|
294
|
-
Button({
|
|
305
|
+
so.postPending ? Row({ title: so.postPending.kind === "video" ? "视频结果待核实" : "图文结果待核实", meta: so.postPending.text || "先到创作者中心核实,不会自动重发" },
|
|
306
|
+
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "not_published" }, "已记录为未发布", "记录失败") }, "已核实未发布"),
|
|
307
|
+
Button({ disabled: busy || so.postPending.status !== "unknown", onClick: () => act("/douyin/post-resolve", { jobId: so.postPending.id, outcome: "published" }, "已记录为已发布", "记录失败") }, "已核实已发布")) : null,
|
|
295
308
|
Row({ title: "回评论", desc: "每 20 分钟看看最近 3 个作品的评论区;抖音可能要短信验证,碰到会停下来提醒你" },
|
|
296
|
-
cm.enabled ? Button({
|
|
309
|
+
cm.enabled ? Button({ disabled: busy || d.enabled !== true || !running, onClick: () => act("/douyin/comments-now", {}, "看完了", "没看成") }, "现在看一眼") : null,
|
|
297
310
|
sw("回评论", cm.enabled === true, (v) => save({ comments: { enabled: v } }))),
|
|
298
311
|
cm.enabled ? Row({ title: "每小时最多" }, Num({ min: 0, max: 30, "aria-label": "每小时最多回几条", ...bind("commentsPerHour") }), Muted("条")) : null,
|
|
299
312
|
cm.enabled ? Row({ title: "允许发表情", desc: "把抖音的表情码([微笑] 这种)写进提示词,平台会自动渲染成表情图" },
|
|
300
313
|
sw("允许发表情", cm.emoji === true, (v) => save({ comments: { emoji: v } }))) : null,
|
|
301
|
-
so.blockedUntil ? Row({ title: "等验证" }, State("error", `抖音要验证,${Math.max(1, Math.ceil((so.blockedUntil - Date.now()) / 3600000))}
|
|
314
|
+
so.blockedUntil ? Row({ title: "等验证" }, State("error", `抖音要验证,${Math.max(1, Math.ceil((so.blockedUntil - Date.now()) / 3600000))} 小时内先不试;去浏览器里验证一下`, undefined, true)) : null,
|
|
302
315
|
so.lastError ? Row({ title: "上次出错" }, State("error", so.lastError)) : null,
|
|
303
316
|
socialLog.length === 0 ? null : h("div", { className: "fs-list" }, socialLog.map((x) => Item({ key: x.key, lead: x.tag, text: x.text, title: x.text, meta: [h("span", { key: "t" }, relTime(x.at, Date.now()))] })))),
|
|
304
317
|
recent.length === 0 ? null : Group({ title: "最近看过" },
|