"use client"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import Link from "next/link"; import { Clock3, ExternalLink, KeyRound, Music2, Plus, RefreshCw, Trash2, Zap, } from "lucide-react"; import { Shell } from "@/components/Shell"; import { useConfirm } from "@/components/ConfirmDialog"; import { useToast } from "@/components/Toast"; import { EnableSwitch } from "@/components/EnableSwitch"; import { PageLoader } from "@/components/ui"; import { TikTokUpcomingUploadRow, TikTokUploadConfirmModal, useTikTokUpload, type TikTokUploadTarget, } from "@/components/TikTokUploadUx"; import { UploadTimeline } from "@/components/UploadTimeline"; import { fetchJson, fmtDuration, fmtTs, todayBeijingISO } from "@/lib/api"; type Channel = { id: string; name: string; tiktok_username?: string; tiktok_uid?: string; nickname?: string; avatar_url?: string; follower_count?: number; following_count?: number; video_count?: number; heart_count?: number; profile_fetched_at?: number; profile_error?: string; enabled?: boolean; authorized?: boolean; oauth_ok?: number; oauth_error?: string; privacy_level?: string; title_template?: string; description_template?: string; note?: string; cookie_saved_at?: number; cookie_age_days?: number | null; cookie_ttl_days?: number; cookie_expires_in_days?: number | null; cookie_status?: "ok" | "warn" | "expired" | "missing" | string; socks_enabled?: boolean; socks_profile_id?: string; socks_profile_label?: string; platform_limited?: boolean; platform_limit_at?: number; platform_limit_msg?: string; platform_limit_probe_at?: number; }; type SocksProfile = { id: string; label?: string; type?: string; server?: string; port?: number; username?: string; password?: string; has_password?: boolean; }; type BoardChannel = { id: string; name?: string; tiktok_username?: string; nickname?: string; avatar_url?: string; tiktok_uid?: string; follower_count?: number; video_count?: number; heart_count?: number; enabled?: boolean; authorized?: boolean; used: number; scheduled: number; uploaded: number; pending: number; gap?: number; max_met?: boolean; daily_max?: number; }; type Upcoming = { id: string; anchor_name?: string; channel_name?: string; channel_pk?: string; upload_at?: number; status?: string; can_upload_now?: boolean; clip_ready?: boolean; clip_seconds?: number; room_id?: string; }; type Job = { id: string; anchor_name?: string; channel_name?: string; channel_pk?: string; status?: string; push_date?: string; error?: string; clip_ready?: boolean; clip_seconds?: number; tiktok_publish_id?: string; upload_at?: number; created_at?: number; finished_at?: number; room_id?: string; }; export default function TikTokPage() { const toast = useToast(); const confirm = useConfirm(); const leftPanelRef = useRef(null); const rightPanelRef = useRef(null); const [loading, setLoading] = useState(true); const [togglingId, setTogglingId] = useState(""); const [status, setStatus] = useState(null); const [channels, setChannels] = useState([]); const [socksProfiles, setSocksProfiles] = useState([]); const [socksDraft, setSocksDraft] = useState([]); const [socksSelectedId, setSocksSelectedId] = useState(""); const [savingSocks, setSavingSocks] = useState(false); const [jobs, setJobs] = useState([]); const [jobTotal, setJobTotal] = useState(0); const [showForm, setShowForm] = useState(false); const [editId, setEditId] = useState(""); const [formName, setFormName] = useState("TikTok 账号"); const [formPrivacy, setFormPrivacy] = useState("PUBLIC_TO_EVERYONE"); const [formTitle, setFormTitle] = useState(""); const [formSocksEnabled, setFormSocksEnabled] = useState(false); const [formSocksProfileId, setFormSocksProfileId] = useState(""); const [sessionChannelId, setSessionChannelId] = useState(""); const [sessionChannelName, setSessionChannelName] = useState(""); const [sessionId, setSessionId] = useState(""); const [sessionDcId, setSessionDcId] = useState(""); const [sessionUsername, setSessionUsername] = useState(""); const [savingSession, setSavingSession] = useState(false); const [showSessionForm, setShowSessionForm] = useState(false); const load = useCallback(async () => { const iso = todayBeijingISO(); const [st, j] = await Promise.all([ fetchJson("/api/tiktok/status"), fetchJson(`/api/tiktok/jobs?push_date=${iso}&limit=30`), ]); setStatus(st); setChannels(st?.channels || []); const profiles = Array.isArray(st?.socks_profiles) ? (st.socks_profiles as SocksProfile[]) : []; setSocksProfiles(profiles); setSocksDraft(profiles.map((p) => ({ ...p }))); setSocksSelectedId((prev) => { if (prev && profiles.some((p) => p.id === prev)) return prev; return String(profiles[0]?.id || ""); }); setJobs(j?.jobs || []); setJobTotal(j?.total || 0); setLoading(false); }, []); const uploadUx = useTikTokUpload(load); useEffect(() => { void load(); let n = 0; const t = setInterval(() => { if (document.hidden) return; n += 1; if (n % 2 === 0) { void load(); } else { void fetchJson("/api/tiktok/status?light=1") .then((st) => { setStatus((prev: Record | null) => ({ ...(prev || {}), ...st, channels: prev?.channels || st?.channels || [], socks_profiles: prev?.socks_profiles || st?.socks_profiles || [], setup: prev?.setup ?? st?.setup, })); }) .catch(() => undefined); } }, 20000); const onVis = () => { if (!document.hidden) void load(); }; document.addEventListener("visibilitychange", onVis); return () => { clearInterval(t); document.removeEventListener("visibilitychange", onVis); }; }, [load]); useEffect(() => { const left = leftPanelRef.current; const right = rightPanelRef.current; if (!left || !right) return; const sync = () => { right.style.maxHeight = `${left.getBoundingClientRect().height}px`; }; sync(); const ro = new ResizeObserver(sync); ro.observe(left); return () => ro.disconnect(); }); const setup = status?.setup; const hasChannels = channels.length > 0; const authorizedCount = channels.filter((c) => c.authorized).length; const allReady = hasChannels && authorizedCount === channels.length; const setupDone = allReady; const board = status?.board || {}; const boardChannels: BoardChannel[] = board.channels || []; const upcoming: Upcoming[] = board.upcoming || []; const beijingWindow = board.beijing_window || ""; const openAddForm = () => { setEditId(""); setFormName("TikTok 账号"); setFormPrivacy("PUBLIC_TO_EVERYONE"); setFormTitle(""); setFormSocksEnabled(false); setFormSocksProfileId(String(socksProfiles[0]?.id || "")); setShowForm(true); setShowSessionForm(false); }; const togglePipeline = async () => { const on = status?.enabled; await fetchJson(on ? "/api/tiktok/stop" : "/api/tiktok/start", { method: "POST" }); toast.push(on ? "TikTok 已暂停" : "TikTok 已启动", "ok"); void load(); }; const applyCookiePayload = (raw: unknown, source: "clipboard" | "extension" = "clipboard") => { const data = typeof raw === "string" ? JSON.parse(raw) : raw; const sessionid = String((data as any)?.sessionid || "").trim(); const dc_id = String( (data as any)?.dc_id || (data as any)?.["tt-target-idc"] || (data as any)?.tt_target_idc || "", ).trim(); const username = String((data as any)?.tiktok_username || "").trim(); if (!sessionid) { throw new Error(source === "extension" ? "插件未返回 sessionid" : "剪贴板里没有 sessionid"); } setSessionId(sessionid); setSessionDcId(dc_id); if (username) setSessionUsername(username); return { sessionid, dc_id, username }; }; const importFromClipboard = async () => { try { const text = await navigator.clipboard.readText(); const filled = applyCookiePayload(text, "clipboard"); toast.push( filled.dc_id ? `已从剪贴板填入(机房 ${filled.dc_id})` : "已从剪贴板填入 Cookie(未含机房)", "ok", ); } catch (e: any) { toast.push(e?.message || "读取剪贴板失败", "err"); } }; const importFromExtension = () => { // Prefer postMessage — content script isolated world may miss CustomEvent. window.postMessage({ source: "dylive-web", type: "dylive-tiktok-cookie-request" }, "*"); window.dispatchEvent(new Event("dylive-tiktok-cookie-request")); window.setTimeout(() => { const flag = (window as any).__dyliveTiktokCookieGot; if (!flag) { toast.push("插件无响应:请加载 extensions/dylive-helper/dist,并先登录 tiktok.com", "err"); } (window as any).__dyliveTiktokCookieGot = false; }, 2500); }; useEffect(() => { let lastKey = ""; const applyFromExt = (detail: unknown, error?: string) => { (window as any).__dyliveTiktokCookieGot = true; if (error) { toast.push(error, "err"); return; } try { const filled = applyCookiePayload(detail, "extension"); const key = `${filled.sessionid}|${filled.dc_id}`; if (key === lastKey) return; // postMessage + CustomEvent 各推一次 lastKey = key; toast.push( filled.dc_id ? `已从插件填入(机房 ${filled.dc_id})` : "已从插件填入 sessionid;tt-target-idc 未读到,可手动填或留空自动探测", filled.dc_id ? "ok" : "warn", ); } catch (e: any) { toast.push(e?.message || "插件数据无效", "err"); } }; const onFill = (ev: Event) => { applyFromExt((ev as CustomEvent).detail); }; const onMessage = (ev: MessageEvent) => { if (ev.source !== window) return; const data = ev.data; if (!data || data.source !== "dylive-helper" || data.type !== "dylive-tiktok-cookie") return; if (data.ok === false) { applyFromExt({}, String(data.error || "插件读取失败")); return; } applyFromExt(data.payload || {}); }; window.addEventListener("dylive-tiktok-cookie", onFill as EventListener); window.addEventListener("message", onMessage); return () => { window.removeEventListener("dylive-tiktok-cookie", onFill as EventListener); window.removeEventListener("message", onMessage); }; }, [toast]); const saveSession = async () => { if (!sessionChannelId) { toast.push("请选择账号", "err"); return; } if (!sessionId.trim()) { toast.push("请填写 sessionid", "err"); return; } setSavingSession(true); try { await fetchJson(`/api/tiktok/channels/${sessionChannelId}/session`, { method: "POST", body: JSON.stringify({ sessionid: sessionId.trim(), dc_id: sessionDcId.trim(), tiktok_username: sessionUsername.trim(), }), }); toast.push("Cookie 会话已保存", "ok"); setShowSessionForm(false); setSessionId(""); void load(); } catch (e: any) { toast.push(e?.message || "保存失败", "err"); } finally { setSavingSession(false); } }; const addChannel = async () => { const r = await fetchJson("/api/tiktok/channels", { method: "POST", body: JSON.stringify({ name: formName, privacy_level: formPrivacy, title_template: formTitle, description_template: "", socks_enabled: formSocksEnabled, socks_profile_id: formSocksEnabled ? formSocksProfileId : "", }), }); toast.push("账号已添加,请粘贴 Cookie", "ok"); setShowForm(false); const ch = r?.channel as Channel | undefined; if (ch?.id) { openSessionForm(ch.id, ch); } void load(); }; const saveChannel = async () => { if (!editId) return; await fetchJson(`/api/tiktok/channels/${editId}`, { method: "PATCH", body: JSON.stringify({ name: formName, privacy_level: formPrivacy, title_template: formTitle, description_template: "", socks_enabled: formSocksEnabled, socks_profile_id: formSocksEnabled ? formSocksProfileId : "", }), }); toast.push("已保存", "ok"); setShowForm(false); setEditId(""); void load(); }; const removeChannel = async (id: string) => { const ok = await confirm({ title: "删除 TikTok 账号", message: "确定删除此账号?", confirmLabel: "删除", destructive: true, }); if (!ok) return; await fetchJson(`/api/tiktok/channels/${id}`, { method: "DELETE" }); toast.push("已删除", "ok"); void load(); }; const openSessionForm = (id: string, ch?: Channel) => { setSessionChannelId(id); setSessionChannelName(ch?.name || ""); setSessionId(""); setSessionDcId(""); setSessionUsername(ch?.tiktok_username || ""); setShowForm(false); setShowSessionForm(true); }; const refreshProfile = async (ch: Channel) => { try { await fetchJson(`/api/tiktok/channels/${ch.id}/profile/refresh`, { method: "POST" }); toast.push(`已刷新「${ch.name}」资料`, "ok"); void load(); } catch (e: any) { toast.push(e?.message || "刷新资料失败", "err"); } }; const fmtCount = (n?: number) => { const v = Number(n || 0); if (v >= 10000) return `${(v / 10000).toFixed(v >= 100000 ? 0 : 1)}万`; return String(v); }; const toggleChannelEnabled = async (ch: Channel) => { const turningOn = ch.enabled === false; if (!turningOn) { const ok = await confirm({ title: `停用「${ch.name}」?`, message: "关闭后将立即清除该账号全部任务与成片,并停止取样/录制/上传。可随时再开。", confirmLabel: "停用并清任务", destructive: true, }); if (!ok) return; } setTogglingId(ch.id); try { const r = await fetchJson(`/api/tiktok/channels/${ch.id}`, { method: "PATCH", body: JSON.stringify({ enabled: turningOn }), }); const cleared = r.cleared as { jobs?: number; clips?: number } | undefined; if (!turningOn && cleared) { toast.push( `已停用 · 清除任务 ${cleared.jobs ?? 0} · 成片 ${cleared.clips ?? 0}`, "ok", ); } else { toast.push(turningOn ? `已启用「${ch.name}」` : `已停用「${ch.name}」`, "ok"); } void load(); } catch (e: any) { toast.push(e?.message || "切换失败", "err"); } finally { setTogglingId(""); } }; const sampleNow = async () => { const r = await fetchJson("/api/tiktok/sample-now", { method: "POST" }); const n = Number(r.enqueued || 0); const live = Number(r.live_count || 0); if (n > 0) { toast.push(`正在从 ${live} 路在播中录制 ${n} 条`, "ok"); } else { toast.push(String(r.reason || "没有可取样的在播直播间"), "err"); } void load(); }; const fillQuota = async () => { try { const r = await fetchJson("/api/tiktok/fill-quota", { method: "POST" }); const n = Number(r.just_quota_filled || 0); toast.push(n > 0 ? `已补入 ${n} 条待录任务` : "今日配额已满或暂无在播可补", n > 0 ? "ok" : "warn"); void load(); } catch (e: any) { toast.push(e?.message || "补齐失败", "err"); } }; const toUploadTarget = (u: { id: string; anchor_name?: string; room_id?: string; channel_name?: string; channel_pk?: string; upload_at?: number; clip_ready?: boolean; clip_seconds?: number; status?: string; }): TikTokUploadTarget => { const ch = channels.find((c) => c.id === (u.channel_pk || "")); return { id: u.id, anchor_name: u.anchor_name, room_id: u.room_id, channel_name: u.channel_name || ch?.name || "", channel_pk: u.channel_pk, upload_at: u.upload_at, clip_ready: u.clip_ready !== false, clip_seconds: Number(u.clip_seconds || 0) || undefined, status: u.status, title_template: ch?.title_template || "", }; }; const retryJob = async (jobId: string) => { await fetchJson(`/api/tiktok/jobs/${jobId}/retry`, { method: "POST" }); toast.push("已重新排队", "ok"); void load(); }; const startEdit = (ch: Channel) => { setEditId(ch.id); setFormName(ch.name || "TikTok 账号"); setFormPrivacy(ch.privacy_level || "PUBLIC_TO_EVERYONE"); setFormTitle(ch.title_template || ""); setFormSocksEnabled(Boolean(ch.socks_enabled)); setFormSocksProfileId(String(ch.socks_profile_id || socksProfiles[0]?.id || "")); setShowForm(true); }; const saveSocksProfiles = async () => { setSavingSocks(true); try { const r = await fetchJson("/api/tiktok/socks-profiles", { method: "PUT", body: JSON.stringify({ profiles: socksDraft }), }); const next = Array.isArray(r?.socks_profiles) ? (r.socks_profiles as SocksProfile[]) : []; setSocksProfiles(next); setSocksDraft(next.map((p) => ({ ...p }))); toast.push("SOCKS 配置已保存", "ok"); void load(); } catch (e: any) { toast.push(e?.message || "保存 SOCKS 失败", "err"); } finally { setSavingSocks(false); } }; const statusLabel = useMemo( () => ({ pending: "待录制", recording: "录制中", recorded: "成片就绪", scheduled: "已排程", uploading: "上传中", uploaded: "已上传", failed: "失败", }), [], ); const cookieAgeLabel = (ch?: Channel) => { if (!ch?.authorized) return "未配置 Cookie"; const days = Number(ch.cookie_age_days ?? 0); const left = Number(ch.cookie_expires_in_days ?? 0); const used = days < 1 ? `已用 ${Math.max(0, Math.round(days * 24))} 小时` : `已用 ${days} 天`; if (ch.cookie_status === "expired") return `${used} · 已过期,请更新`; if (ch.cookie_status === "warn") return `${used} · 即将过期(剩 ${left} 天)`; return `${used} · 约剩 ${left} 天`; }; const cookieAgeClass = (ch?: Channel) => { if (!ch?.authorized || ch.cookie_status === "missing") return "text-rose-300"; if (ch.cookie_status === "expired") return "text-rose-300"; if (ch.cookie_status === "warn") return "text-amber-300"; return "text-teal-300"; }; const displayChannels: BoardChannel[] = (() => { const fromBoard = boardChannels.length ? boardChannels : channels.map((c) => ({ id: c.id, name: c.name, tiktok_username: c.tiktok_username, enabled: c.enabled, authorized: c.authorized, used: 0, scheduled: 0, uploaded: 0, pending: 0, gap: 15, max_met: false, daily_max: 15, })); const seen = new Set(fromBoard.map((c) => c.id)); const extra = channels .filter((c) => !seen.has(c.id)) .map((c) => ({ id: c.id, name: c.name, tiktok_username: c.tiktok_username, enabled: c.enabled, authorized: c.authorized, used: 0, scheduled: 0, uploaded: 0, pending: 0, gap: 15, max_met: false, daily_max: 15, })); return [...fromBoard, ...extra]; })(); if (loading && !status) { return ( ); } return ( uploadUx.confirmUpload(channelPk)} busy={uploadUx.busy} />
{/* Header */}

TikTok 自动上传

Cookie 上传 · TiktokAutoUploader · 抖音直播录屏 → TikTok

{setupDone && ( <> )}
{/* 首次使用:仅显示引导或表单,不堆叠 */} {!hasChannels && !showForm && !showSessionForm && (

开始使用 TikTok 上传

无需 TikTok 开发者应用。浏览器登录 tiktok.com 后复制{" "} sessionid,粘贴即可上传。

  1. 点击下方「添加账号」
  2. 保存后在弹窗中粘贴 Cookie
  3. 全部账号配置完成后,再点「启动自动上传」
{setup?.note &&

⚠️ {setup.note}

}
)} {/* 有账号但未全部配置 Cookie */} {hasChannels && !allReady && !showForm && !showSessionForm && (
还有 {channels.length - authorizedCount} 个账号未粘贴 Cookie,配置完成后才能启动自动上传。
)} {/* Summary cards */} {setupDone && (
今日剩余配额
{status?.quota_gap ?? "—"}
{beijingWindow}
抖音直播中
{status?.douyin_live_count ?? 0}
可取样来源
即将上传
{upcoming.length}
已排程素材
运行状态
{status?.enabled ? "自动上传中" : "已暂停"}
)} {/* 有账号时:顶部操作栏 */} {hasChannels && !showForm && !showSessionForm && (
打开 TikTok 登录
)} {/* Channel form */} {showForm && (

{editId ? "编辑账号" : "新增 TikTok 账号"}

可添加多个账号,每个账号各自粘贴 Cookie、各自计时,互不影响。

上传时随机:你的自定义文案 + 数据库 100 条英文(#streetfood #fyp),约 ≤150 字;不会自动拼直播间名。

默认不勾选(直连)。勾选后使用下方 SOCKS 配置池中的某一套,按账号独立选择。

{formSocksEnabled && ( )}
)} {showSessionForm && (

粘贴 TikTok Cookie

每个账号单独保存 Cookie。sessionid 约 30 天过期,保存后会开始计时。sessionid 等同密码,请勿泄露。

{(() => { const current = channels.find((c) => c.id === sessionChannelId); if (!current?.authorized) return null; return (

当前 Cookie:{cookieAgeLabel(current)} {current.cookie_saved_at ? ` · 保存于 ${fmtTs(current.cookie_saved_at)}` : ""} 。保存新 Cookie 会重新开始计时。

); })()}
)} {/* TikTok SOCKS profile pool */}

TikTok 上传 SOCKS(静态住宅 IP)

先在这里维护多套 SOCKS,再在每个账号的「编辑」里勾选并选择要用哪一套。默认不勾选 = 直连上传。

{(() => { const selected = socksDraft.find((p) => String(p.id) === String(socksSelectedId)) || socksDraft[0] || null; const setList = (next: SocksProfile[]) => { setSocksDraft(next); if (!next.some((p) => String(p.id) === String(socksSelectedId))) { setSocksSelectedId(String(next[0]?.id || "")); } }; const patchSelected = (patch: Partial) => { if (!selected) return; setList( socksDraft.map((p) => (String(p.id) === String(selected.id) ? { ...p, ...patch } : p)), ); }; return (
{selected && ( )}
{selected ? (
) : (

暂无 SOCKS 配置,请点「新增配置」。

)}
); })()}
{/* Two-column board */} {channels.length > 0 && (

账号配额({channels.length})

北京日 {beijingWindow || "—"} · 按账号日上限合计(默认可改)
{displayChannels.map((ch) => { const full = channels.find((x) => x.id === ch.id); const pct = Math.min(100, Math.round(((ch.used || 0) / Math.max(1, ch.daily_max || 15)) * 100)); return (
{full?.avatar_url ? ( // eslint-disable-next-line @next/next/no-img-element ) : (
TT
)}
{full?.nickname || ch.name || "未命名"}
{full?.tiktok_username || ch.tiktok_username ? `@${(full?.tiktok_username || ch.tiktok_username || "").replace(/^@/, "")}` : ch.name || "—"} {full?.tiktok_uid ? ` · id ${full.tiktok_uid}` : ""}
{full ? ( void toggleChannelEnabled(full)} /> ) : null} {full?.authorized ? "Cookie 就绪" : "未配置"}
{(full?.follower_count || full?.video_count || full?.heart_count) ? (
粉丝 {fmtCount(full?.follower_count)} 视频 {fmtCount(full?.video_count)} 赞 {fmtCount(full?.heart_count)}
) : full?.authorized ? (
{full.profile_error || "资料未拉取,可点「刷新资料」"}
) : null}
{cookieAgeLabel(full)}
{full?.authorized && full.cookie_saved_at ? (
保存于 {fmtTs(full.cookie_saved_at)}
) : null}
{full?.socks_enabled ? `SOCKS · ${full.socks_profile_label || full.socks_profile_id || "已启用"}` : "SOCKS · 直连"}
{full?.platform_limited ? (
官方限流中 {full.platform_limit_msg ? `:${full.platform_limit_msg}` : ""} 。每小时自动试传,成功即解除。 {full.platform_limit_probe_at ? ` 上次试传 ${fmtTs(full.platform_limit_probe_at)}` : ""}
) : null}
已传 {ch.uploaded ?? 0} 排程 {ch.scheduled ?? 0} 待录 {ch.pending ?? 0} {ch.max_met ? "已满" : `余 ${ch.gap ?? 0}`}
{full?.authorized ? ( ) : null} {full && ( )}
); })}

即将上传

素材 {upcoming.length}
{board?.timeline?.hours ? (
{ const full = upcoming.find((u: { id: string }) => u.id === j.id); if (full) uploadUx.openConfirm(toUploadTarget(full)); }} />
) : null}
{upcoming.length === 0 ? (
暂无排程。启动自动上传后,系统会从抖音直播中取样。
) : ( upcoming.map((u) => ( )) )}
)} {/* Jobs table — 有账号即显示 */} {hasChannels && (

任务流水(今日 {jobTotal})

{jobs.length === 0 ? ( ) : ( jobs.map((j) => ( )) )}
主播 账号 时长 状态 时间 操作
暂无任务
{j.anchor_name || "—"} {j.channel_name || (j.channel_pk ? "—" : "待分配")} {Number(j.clip_seconds || 0) > 0 ? ( fmtDuration(Number(j.clip_seconds)) ) : j.clip_ready ? ( 成片就绪 ) : j.status === "recording" || j.status === "pending" ? ( 录制中 ) : ( "—" )} {statusLabel[j.status as keyof typeof statusLabel] || j.status} {j.error && (
{(j as any).error_class?.label || "失败"} {(j as any).error_class?.action_label ? ` · ${(j as any).error_class.action_label}` : ""}
{j.error}
)}
{j.finished_at ? fmtTs(j.finished_at) : j.created_at ? fmtTs(j.created_at) : "—"}
{j.clip_ready && j.status !== "uploaded" && ( )} {j.status === "failed" && ( )}
)} {/* Quick help — 未完成配置时显示 */} {!allReady && (
如何获取 Cookie
  1. 加载 Chrome 插件:extensions/dylive-helper/dist (chrome://extensions → 开发者模式 → 加载已解压)
  2. 登录{" "} tiktok.com ,再在本页点「从插件读取」,或插件 TikTok 页「填入控制台」
  3. 确认 sessionid 已填入后点「保存 Cookie」
)}
); }