karin-plugin-kkk 2.32.2 → 2.33.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/CHANGELOG.md +35 -0
- package/lib/apps/admin.js +1 -1
- package/lib/apps/help.js +1 -1
- package/lib/apps/push.js +1 -1
- package/lib/apps/qrlogin.js +1 -1
- package/lib/apps/statistics.js +1 -1
- package/lib/apps/testPush.js +2 -0
- package/lib/build-metadata.json +5 -5
- package/lib/core_chunk/amagi.d.mts +188 -1740
- package/lib/core_chunk/amagi.js +1 -1
- package/lib/core_chunk/amagiClient.js +1 -1
- package/lib/core_chunk/db.js +1 -1
- package/lib/core_chunk/{index-DNlQJ2Zs.d.mts → index-B2QgJ0_6.d.mts} +21 -2
- package/lib/core_chunk/main.js +1941 -846
- package/lib/core_chunk/richtext.d.mts +2 -2
- package/lib/core_chunk/richtext.js +2 -2
- package/lib/core_chunk/template.d.mts +53 -11
- package/lib/core_chunk/template.js +1 -1
- package/lib/core_chunk/vendor.js +1246 -995
- package/lib/karin-plugin-kkk.css +148 -1
- package/lib/root.js +1 -1
- package/lib/web.config.js +1 -1
- package/package.json +3 -3
- /package/lib/core_chunk/{index-_BS3nWFN.d.mts → index-_og592jD.d.mts} +0 -0
package/lib/core_chunk/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM } from "./rolldown-runtime.js";
|
|
2
|
-
import { $ as SiGooglephotos, $t as
|
|
2
|
+
import { $ as SiGooglephotos, $n as ArrowDownToLine, $t as RefreshCw, A as RiHashtag, An as Download, At as Users, B as RiThumbUpFill, Bn as CircleFadingArrowUp, Bt as Square, C as AiFillHeart, Cn as Gift, Ct as format, D as Markdown, Dn as Eye, Dt as X, E as AiOutlineVideoCamera, En as FilePlay, Et as Zap, F as RiMessage3Fill, Fn as Code, Ft as TriangleAlert, G as RiVideoLine, Gn as Check, Gt as Shield, H as RiTrophyFill, Hn as CircleCheck, Ht as Sparkles, I as RiPieChart2Fill, In as Clock, It as Trash2, J as SiSamsung, Jn as Calendar, Jt as Settings2, K as SiXiaomi, Kn as ChartColumn, Kt as ShieldCheck, L as RiShareForwardFill, Ln as Clock3, Lt as Terminal, M as RiHeart3Line, Mn as Cpu, Mt as UsersRound, N as RiHeartLine, Nn as CornerDownLeft, Nt as UserPlus, O as RiArrowRightFill, On as EyeOff, Ot as WandSparkles, P as RiLiveLine, Pn as Copy, Pt as Upload, Q as SiHonor, Qn as BellRing, Qt as RotateCcw, R as RiStarFill, Rn as Clapperboard, Rt as Sun, S as BiImage, Sn as GitBranch, St as formatDistanceToNow, T as AiFillStar, Tn as FileText, Tt as twMerge, U as RiUserFollowLine, Un as CircleCheckBig, Ut as Smartphone, V as RiTiktokFill, Vn as CircleEllipsis, Vt as SquarePen, W as RiVerifiedBadgeFill, Wn as CircleAlert, Wt as ShoppingBag, X as SiOneplus, Xn as Bot, Xt as ScanLine, Y as SiOppo, Yn as Box, Yt as Search, Z as SiHuawei, Zn as Bookmark, Zt as Save, _ as MdSchedule, _n as LayoutTemplate, _t as t, a as VictoryScatter, an as Play, ar as require_react, at as r$1, b as FaTiktok, bn as Heart, bt as parse, c as VictoryChart, cn as Music, cr as Xhshow, ct as e$1, d as VictoryTheme, dn as MessageCircle, dt as n, en as Radio, er as Chip, et as SiGithub, f as rehypeHighlight, fn as Menu, ft as e, g as MdLocationOn, gn as Link, gt as c, h as MdLightbulbOutline, hn as LoaderCircle, ht as o$3, i as require_heic_decode, in as Plus, ir as require_server_node, it as o$2, j as RiHeart3Fill, jn as Crown, jt as User, k as RiGroupLine, kn as ExternalLink, kt as Video, l as VictoryAxis, ln as Moon, lr as zod_default, lt as m, m as MdInfoOutline, mn as MapPin, mt as o$1, n as require_lib, nn as QrCode, nr as clsx, nt as SiApple, o as VictoryPie, on as Pencil, or as require_protobufjs, ot as o, p as MdFitScreen, pn as Maximize, pt as a$1, q as SiVivo, qn as Camera, qt as Share2, r as require_jpeg_js, rn as Puzzle, rr as require_jsx_runtime, rt as SiAnthropic, s as VictoryLine, sn as Palette, sr as Chalk, st as o$4, t as createProxyMiddleware, tn as Quote, tr as Button, tt as SiBilibili, u as VictoryLabel, un as Monitor, ut as a, v as FaCommentDots, vn as Info, vt as r, w as AiFillPushpin, wn as Gamepad2, wt as differenceInSeconds, x as FaUserGroup, xn as Hash, xt as fromUnixTime, y as FaMusic, yn as Image$1, yt as zhCN, z as RiStarLine, zn as CircleQuestionMark, zt as Star } from "./vendor.js";
|
|
3
3
|
import "node:module";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path, { resolve } from "node:path";
|
|
@@ -12791,7 +12791,7 @@ async function processImageUrl(imageUrl, title, index) {
|
|
|
12791
12791
|
//#region ../template/src/dev/preview/utils/time.ts
|
|
12792
12792
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
12793
12793
|
var import_server_node = require_server_node();
|
|
12794
|
-
var formatDuration$
|
|
12794
|
+
var formatDuration$5 = (ms) => {
|
|
12795
12795
|
const totalSeconds = Math.max(Math.floor(ms / 1e3), 0);
|
|
12796
12796
|
const hours = Math.floor(totalSeconds / 3600);
|
|
12797
12797
|
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
@@ -12815,7 +12815,7 @@ var buildStatus = (state) => {
|
|
|
12815
12815
|
statusText: `文件 ${filePath} 将在未知时间后删除`,
|
|
12816
12816
|
countdownText: "--:--"
|
|
12817
12817
|
};
|
|
12818
|
-
const countdownText = formatDuration$
|
|
12818
|
+
const countdownText = formatDuration$5(state.remainingMs);
|
|
12819
12819
|
return {
|
|
12820
12820
|
statusText: `文件 ${filePath} 将在 ${countdownText} 后删除`,
|
|
12821
12821
|
countdownText
|
|
@@ -12995,7 +12995,7 @@ var PreviewLayout = ({ state }) => {
|
|
|
12995
12995
|
};
|
|
12996
12996
|
//#endregion
|
|
12997
12997
|
//#region ../template/src/utils/cn.ts
|
|
12998
|
-
function cn(...inputs) {
|
|
12998
|
+
function cn$1(...inputs) {
|
|
12999
12999
|
return twMerge(clsx(inputs));
|
|
13000
13000
|
}
|
|
13001
13001
|
//#endregion
|
|
@@ -14026,7 +14026,7 @@ var ViteLogo = ({ className = "w-auto h-12" }) => /* @__PURE__ */ (0, import_jsx
|
|
|
14026
14026
|
var DefaultLayout = ({ children, version, data, scale = 3, className = "", style = {}, watermarkTextBitSize }) => {
|
|
14027
14027
|
const { useDarkTheme } = data;
|
|
14028
14028
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
14029
|
-
className: cn("w-360 shrink-0 bg-background text-foreground font-[HarmonyOSHans-Regular]", useDarkTheme ? "dark" : "light", className),
|
|
14029
|
+
className: cn$1("w-360 shrink-0 bg-background text-foreground font-[HarmonyOSHans-Regular]", useDarkTheme ? "dark" : "light", className),
|
|
14030
14030
|
"data-theme": useDarkTheme ? "dark" : "light",
|
|
14031
14031
|
id: "container",
|
|
14032
14032
|
style: {
|
|
@@ -14102,12 +14102,12 @@ var DefaultLayout = ({ children, version, data, scale = 3, className = "", style
|
|
|
14102
14102
|
className: "w-4 h-4"
|
|
14103
14103
|
}),
|
|
14104
14104
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
14105
|
-
className: cn(version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
|
|
14105
|
+
className: cn$1(version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
|
|
14106
14106
|
children: version.hasUpdate ? "有可用更新" : version.releaseType
|
|
14107
14107
|
})
|
|
14108
14108
|
]
|
|
14109
14109
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
14110
|
-
className: cn("text-5xl font-bold tracking-wide", version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
|
|
14110
|
+
className: cn$1("text-5xl font-bold tracking-wide", version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
|
|
14111
14111
|
children: ["v", version.pluginVersion]
|
|
14112
14112
|
})]
|
|
14113
14113
|
}),
|
|
@@ -14184,7 +14184,7 @@ var DefaultLayout = ({ children, version, data, scale = 3, className = "", style
|
|
|
14184
14184
|
var UsernameDisplay = ({ metadata, className, style }) => {
|
|
14185
14185
|
const vipColor = metadata.vipStatus === 1 ? metadata.nicknameColor ?? "#FB7299" : null;
|
|
14186
14186
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
14187
|
-
className: cn(!vipColor && "text-foreground", "font-bold", className),
|
|
14187
|
+
className: cn$1(!vipColor && "text-foreground", "font-bold", className),
|
|
14188
14188
|
style: {
|
|
14189
14189
|
...style,
|
|
14190
14190
|
...vipColor ? { color: vipColor } : {}
|
|
@@ -14616,14 +14616,14 @@ var BangumiBilibiliEpisodes = (props) => {
|
|
|
14616
14616
|
className: "flex justify-center items-center text-7xl font-bold select-text text-foreground",
|
|
14617
14617
|
children: day
|
|
14618
14618
|
}),
|
|
14619
|
-
!isLastOfAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("mt-8 w-1 bg-divider", episodesInSameDate > 1 ? "h-110" : "h-95") })
|
|
14619
|
+
!isLastOfAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn$1("mt-8 w-1 bg-divider", episodesInSameDate > 1 ? "h-110" : "h-95") })
|
|
14620
14620
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
14621
14621
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-1 h-10 bg-divider" }),
|
|
14622
14622
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-2 w-4 h-4 rounded-full bg-divider" }),
|
|
14623
|
-
(!isLastOfAll || episodesInSameDate > 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("w-1 bg-divider", isLastOfDate ? "h-110" : "h-130") })
|
|
14623
|
+
(!isLastOfAll || episodesInSameDate > 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn$1("w-1 bg-divider", isLastOfDate ? "h-110" : "h-130") })
|
|
14624
14624
|
] })
|
|
14625
14625
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
14626
|
-
className: cn("flex-1 min-w-0", !isLastOfAll && isLastOfDate && "mb-20"),
|
|
14626
|
+
className: cn$1("flex-1 min-w-0", !isLastOfAll && isLastOfDate && "mb-20"),
|
|
14627
14627
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
14628
14628
|
className: "flex justify-between items-center mb-10",
|
|
14629
14629
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -14850,6 +14850,15 @@ var createLinkCardNode = (title, url, options = {}) => ({
|
|
|
14850
14850
|
meta: options.meta
|
|
14851
14851
|
});
|
|
14852
14852
|
/**
|
|
14853
|
+
* 创建 hashtag 节点。
|
|
14854
|
+
*
|
|
14855
|
+
* 纯文本高亮,不带任何图标。适用于抖音等平台的 #话题# 展示。
|
|
14856
|
+
*/
|
|
14857
|
+
var createHashtagNode = (text) => ({
|
|
14858
|
+
type: "hashtag",
|
|
14859
|
+
text
|
|
14860
|
+
});
|
|
14861
|
+
/**
|
|
14853
14862
|
* 合并相邻文本节点并丢弃空文本节点。
|
|
14854
14863
|
*
|
|
14855
14864
|
* 这样 core 可以按匹配过程简单 push 节点,最后统一整理,避免前端拿到碎片过多的数据。
|
|
@@ -14887,6 +14896,7 @@ var extractRichTextPlainText = (document) => {
|
|
|
14887
14896
|
case "webLink":
|
|
14888
14897
|
case "vote":
|
|
14889
14898
|
case "viewPicture":
|
|
14899
|
+
case "hashtag":
|
|
14890
14900
|
case "emoji": return "text" in node ? node.text ?? "" : node.name ?? "";
|
|
14891
14901
|
case "heading":
|
|
14892
14902
|
case "paragraph":
|
|
@@ -14914,6 +14924,11 @@ var createRichTextDocument = (nodes, options = {}) => ({
|
|
|
14914
14924
|
nodes: normalizeRichTextNodes(nodes)
|
|
14915
14925
|
});
|
|
14916
14926
|
//#endregion
|
|
14927
|
+
//#region ../richtext/src/react/cn.ts
|
|
14928
|
+
function cn(...inputs) {
|
|
14929
|
+
return twMerge(clsx(inputs));
|
|
14930
|
+
}
|
|
14931
|
+
//#endregion
|
|
14917
14932
|
//#region ../richtext/src/react/index.tsx
|
|
14918
14933
|
/**
|
|
14919
14934
|
* 限制图片来源协议。
|
|
@@ -14972,7 +14987,7 @@ var SearchKeywordIcon = ({ className }) => {
|
|
|
14972
14987
|
};
|
|
14973
14988
|
/** 话题图标 */
|
|
14974
14989
|
var TopicIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
14975
|
-
className:
|
|
14990
|
+
className: cn(className, "inline-block w-16 mb-4 mr-4 align-middle"),
|
|
14976
14991
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14977
14992
|
viewBox: "0 0 16 16",
|
|
14978
14993
|
children: [
|
|
@@ -14996,7 +15011,7 @@ var TopicIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
|
14996
15011
|
});
|
|
14997
15012
|
/** 抽奖图标 */
|
|
14998
15013
|
var LotteryIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
14999
|
-
className:
|
|
15014
|
+
className: cn(className, "inline-block w-16 h-auto mb-4 mr-2 align-middle"),
|
|
15000
15015
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15001
15016
|
viewBox: "0 0 18 18",
|
|
15002
15017
|
children: [
|
|
@@ -15024,7 +15039,7 @@ var LotteryIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs
|
|
|
15024
15039
|
});
|
|
15025
15040
|
/** 网页链接图标 */
|
|
15026
15041
|
var WebLinkIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
15027
|
-
className:
|
|
15042
|
+
className: cn(className, "inline-block w-14 mb-3 mr-2 align-middle"),
|
|
15028
15043
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15029
15044
|
viewBox: "0 0 18 18",
|
|
15030
15045
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
@@ -15037,7 +15052,7 @@ var WebLinkIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs
|
|
|
15037
15052
|
});
|
|
15038
15053
|
/** 投票图标 */
|
|
15039
15054
|
var VoteIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
15040
|
-
className:
|
|
15055
|
+
className: cn(className, "inline-block w-20 mb-2 align-middle"),
|
|
15041
15056
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15042
15057
|
viewBox: "0 0 18 18",
|
|
15043
15058
|
children: [
|
|
@@ -15057,7 +15072,7 @@ var VoteIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("
|
|
|
15057
15072
|
});
|
|
15058
15073
|
/** 查看图片图标 */
|
|
15059
15074
|
var ViewPictureIcon = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
15060
|
-
className:
|
|
15075
|
+
className: cn(className, "inline-block w-20 align-middle"),
|
|
15061
15076
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15062
15077
|
viewBox: "0 0 22 22",
|
|
15063
15078
|
width: "22",
|
|
@@ -15172,6 +15187,11 @@ var renderNodeToReact = (node, index, options) => {
|
|
|
15172
15187
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TopicIcon, {})
|
|
15173
15188
|
}), node.text]
|
|
15174
15189
|
}, `topic-${index}`);
|
|
15190
|
+
case "hashtag": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
15191
|
+
className: options.hashtag?.className,
|
|
15192
|
+
"data-richtext-node": "hashtag",
|
|
15193
|
+
children: node.text
|
|
15194
|
+
}, `hashtag-${index}`);
|
|
15175
15195
|
case "at": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
15176
15196
|
className: options.at?.className,
|
|
15177
15197
|
"data-richtext-node": "at",
|
|
@@ -15191,7 +15211,7 @@ var renderNodeToReact = (node, index, options) => {
|
|
|
15191
15211
|
}), node.text]
|
|
15192
15212
|
}, `lottery-${index}`);
|
|
15193
15213
|
case "webLink": return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", {
|
|
15194
|
-
className:
|
|
15214
|
+
className: cn(options.webLink?.className, "break-all"),
|
|
15195
15215
|
href: node.jumpUrl,
|
|
15196
15216
|
target: "_blank",
|
|
15197
15217
|
rel: "noopener noreferrer",
|
|
@@ -15277,7 +15297,7 @@ var renderNodeToReact = (node, index, options) => {
|
|
|
15277
15297
|
const lines = node.content.split("\n");
|
|
15278
15298
|
const showLang = node.language && node.language !== "plaintext";
|
|
15279
15299
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15280
|
-
className:
|
|
15300
|
+
className: cn("bg-surface rounded-4xl my-8 border border-border", options.codeBlock?.className),
|
|
15281
15301
|
"data-richtext-node": "codeBlock",
|
|
15282
15302
|
"data-language": node.language,
|
|
15283
15303
|
children: [showLang && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -15571,7 +15591,7 @@ var FansMedal = ({ detail }) => {
|
|
|
15571
15591
|
const nameColor = intToRgba(detail.medal_color_name);
|
|
15572
15592
|
const levelColor = intToRgba(detail.medal_color_level);
|
|
15573
15593
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15574
|
-
className: cn("inline-flex items-center shrink-0", "h-14 rounded-full border"),
|
|
15594
|
+
className: cn$1("inline-flex items-center shrink-0", "h-14 rounded-full border"),
|
|
15575
15595
|
style: {
|
|
15576
15596
|
borderColor,
|
|
15577
15597
|
backgroundImage: `linear-gradient(90deg, ${bgStart}, ${bgEnd})`
|
|
@@ -15583,7 +15603,7 @@ var FansMedal = ({ detail }) => {
|
|
|
15583
15603
|
referrerPolicy: "no-referrer",
|
|
15584
15604
|
crossOrigin: "anonymous"
|
|
15585
15605
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15586
|
-
className: cn("flex items-center", detail.first_icon ? "pr-4" : "px-4"),
|
|
15606
|
+
className: cn$1("flex items-center", detail.first_icon ? "pr-4" : "px-4"),
|
|
15587
15607
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
15588
15608
|
className: "font-medium whitespace-nowrap text-3xl",
|
|
15589
15609
|
style: { color: nameColor },
|
|
@@ -15601,7 +15621,7 @@ var FansMedal = ({ detail }) => {
|
|
|
15601
15621
|
*/
|
|
15602
15622
|
var TopBadge = () => {
|
|
15603
15623
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
15604
|
-
className: cn("inline-flex justify-center items-center", "px-4 py-2 mr-4 mb-1 rounded-xl", "text-[45px] font-light leading-none", "align-baseline", "bg-[#ffedf5] text-[#ff799e]", "dark:bg-[#321b26] dark:text-[#cb5775]"),
|
|
15624
|
+
className: cn$1("inline-flex justify-center items-center", "px-4 py-2 mr-4 mb-1 rounded-xl", "text-[45px] font-light leading-none", "align-baseline", "bg-[#ffedf5] text-[#ff799e]", "dark:bg-[#321b26] dark:text-[#cb5775]"),
|
|
15605
15625
|
children: "置顶"
|
|
15606
15626
|
});
|
|
15607
15627
|
};
|
|
@@ -15785,7 +15805,7 @@ var VideoInfoHeader$1 = (props) => {
|
|
|
15785
15805
|
*/
|
|
15786
15806
|
var CommentItemComponent$2 = ({ isLast = false, ...props }) => {
|
|
15787
15807
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15788
|
-
className: cn("flex relative px-10 py-10 max-w-full", { "pb-0": isLast }),
|
|
15808
|
+
className: cn$1("flex relative px-10 py-10 max-w-full", { "pb-0": isLast }),
|
|
15789
15809
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15790
15810
|
className: "relative mr-[33.75px] shrink-0 w-50 h-50 flex items-center justify-center",
|
|
15791
15811
|
children: [
|
|
@@ -16884,7 +16904,7 @@ var BilibiliVideoDynamic = import_react.memo((props) => {
|
|
|
16884
16904
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVideoContent, { ...props }),
|
|
16885
16905
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
16886
16906
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
|
|
16887
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn(props.data.staff && props.data.staff.length > 0 && "h-23", !props.data.staff && "h-40") }),
|
|
16907
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn$1(props.data.staff && props.data.staff.length > 0 && "h-23", !props.data.staff && "h-40") }),
|
|
16888
16908
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVideoStaff, { ...props }),
|
|
16889
16909
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
|
|
16890
16910
|
]
|
|
@@ -17077,7 +17097,7 @@ var BilibiliUgcCard = ({ ugc }) => {
|
|
|
17077
17097
|
var BilibiliAdditionalCard = ({ additional, gap = true, className }) => {
|
|
17078
17098
|
if (!additional) return null;
|
|
17079
17099
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17080
|
-
className: cn(gap && "px-20 pb-20", className),
|
|
17100
|
+
className: cn$1(gap && "px-20 pb-20", className),
|
|
17081
17101
|
children: [
|
|
17082
17102
|
additional.type === "ADDITIONAL_TYPE_RESERVE" && additional.reserve && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliReserveCard, { reserve: additional.reserve }),
|
|
17083
17103
|
additional.type === "ADDITIONAL_TYPE_VOTE" && additional.vote && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVoteCard, { vote: additional.vote }),
|
|
@@ -18843,20 +18863,50 @@ var AmbientBackground$1 = import_react.memo(({ pic }) => /* @__PURE__ */ (0, imp
|
|
|
18843
18863
|
]
|
|
18844
18864
|
}));
|
|
18845
18865
|
AmbientBackground$1.displayName = "AmbientBackground";
|
|
18866
|
+
var MAX_DANMAKU_ROWS = 4;
|
|
18867
|
+
/**
|
|
18868
|
+
* 封面弹幕层:模拟视频平台截图中的滚动弹幕轨道,行数由 MAX_DANMAKU_ROWS 控制。
|
|
18869
|
+
*/
|
|
18870
|
+
var DanmakuOverlay = import_react.memo(({ items }) => {
|
|
18871
|
+
if (!items.length) return null;
|
|
18872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
18873
|
+
className: "pointer-events-none absolute inset-x-0 top-0 z-20 overflow-hidden px-16",
|
|
18874
|
+
style: {
|
|
18875
|
+
height: `calc(${MAX_DANMAKU_ROWS} * 20rem)`,
|
|
18876
|
+
maskImage: "linear-gradient(to right, transparent 0, black 3rem, black calc(100% - 10rem), transparent 100%)",
|
|
18877
|
+
WebkitMaskImage: "linear-gradient(to right, transparent 0, black 3rem, black calc(100% - 10rem), transparent 100%)"
|
|
18878
|
+
},
|
|
18879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
18880
|
+
className: "relative pt-8 overflow-visible whitespace-normal text-[0] leading-16",
|
|
18881
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
18882
|
+
className: "mr-20 inline-block shrink-0 whitespace-nowrap align-top text-4xl font-black leading-16 text-white",
|
|
18883
|
+
style: {
|
|
18884
|
+
marginLeft: index === 0 ? void 0 : `${(index * 5 + item.content.length * 3) % 5 * 2}rem`,
|
|
18885
|
+
opacity: Math.max(.2, 1 - index * .025),
|
|
18886
|
+
textShadow: "0 3px 8px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.95)",
|
|
18887
|
+
WebkitTextStroke: "1px rgba(0,0,0,0.58)"
|
|
18888
|
+
},
|
|
18889
|
+
children: item.content
|
|
18890
|
+
}, `${item.content}-${index}`))
|
|
18891
|
+
})
|
|
18892
|
+
});
|
|
18893
|
+
});
|
|
18894
|
+
DanmakuOverlay.displayName = "DanmakuOverlay";
|
|
18846
18895
|
var BilibiliVideoInfo = import_react.memo((props) => {
|
|
18847
18896
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DefaultLayout, {
|
|
18848
18897
|
...props,
|
|
18849
18898
|
className: "relative overflow-hidden",
|
|
18850
18899
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AmbientBackground$1, { pic: props.data.pic }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
18851
18900
|
className: "relative z-10",
|
|
18852
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.
|
|
18901
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
18902
|
+
className: "relative overflow-hidden",
|
|
18853
18903
|
style: coverMaskStyle$1,
|
|
18854
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
|
|
18904
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
|
|
18855
18905
|
src: props.data.pic,
|
|
18856
18906
|
alt: props.data.title,
|
|
18857
18907
|
className: "object-cover w-full",
|
|
18858
18908
|
placeholder: "视频封面"
|
|
18859
|
-
})
|
|
18909
|
+
}), props.data.hotDanmaku && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DanmakuOverlay, { items: props.data.hotDanmaku })]
|
|
18860
18910
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
18861
18911
|
className: "flex flex-col gap-10 px-16 pt-20",
|
|
18862
18912
|
children: [
|
|
@@ -18997,7 +19047,7 @@ BilibiliVideoInfo.displayName = "BilibiliVideoInfo";
|
|
|
18997
19047
|
/**
|
|
18998
19048
|
* 抖音Logo头部组件
|
|
18999
19049
|
*/
|
|
19000
|
-
var DouyinHeader$
|
|
19050
|
+
var DouyinHeader$2 = ({ useDarkTheme }) => {
|
|
19001
19051
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19002
19052
|
className: "flex items-center px-12 py-15",
|
|
19003
19053
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -19126,7 +19176,7 @@ var ContentSection = ({ markdown, images }) => {
|
|
|
19126
19176
|
/**
|
|
19127
19177
|
* 作品信息组件
|
|
19128
19178
|
*/
|
|
19129
|
-
var InfoSection$
|
|
19179
|
+
var InfoSection$2 = (props) => {
|
|
19130
19180
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19131
19181
|
className: "flex flex-col px-16 py-5",
|
|
19132
19182
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -19161,7 +19211,7 @@ var InfoSection$4 = (props) => {
|
|
|
19161
19211
|
/**
|
|
19162
19212
|
* 用户信息组件
|
|
19163
19213
|
*/
|
|
19164
|
-
var UserInfoSection$
|
|
19214
|
+
var UserInfoSection$1 = (props) => {
|
|
19165
19215
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19166
19216
|
className: "flex flex-col gap-12",
|
|
19167
19217
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -19255,7 +19305,7 @@ var DouyinArticleWork = (props) => {
|
|
|
19255
19305
|
...props,
|
|
19256
19306
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
19257
19307
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
19258
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinHeader$
|
|
19308
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinHeader$2, { useDarkTheme: props.data.useDarkTheme }),
|
|
19259
19309
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
19260
19310
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleSection, {
|
|
19261
19311
|
title: props.data.title,
|
|
@@ -19268,13 +19318,13 @@ var DouyinArticleWork = (props) => {
|
|
|
19268
19318
|
images: props.data.images
|
|
19269
19319
|
}),
|
|
19270
19320
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
19271
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection$
|
|
19321
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection$2, { ...props }),
|
|
19272
19322
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-25" }),
|
|
19273
19323
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19274
19324
|
className: "flex flex-col gap-10 px-0 pt-25",
|
|
19275
19325
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19276
19326
|
className: "flex justify-between items-start px-20 pb-20",
|
|
19277
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$
|
|
19327
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$1, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19278
19328
|
className: "flex flex-col items-center gap-4",
|
|
19279
19329
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
19280
19330
|
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
@@ -19595,26 +19645,26 @@ var ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
|
|
|
19595
19645
|
})
|
|
19596
19646
|
}), reply.children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-0.5 bg-border-secondary h-full grow mt-3 rounded-t-full" })]
|
|
19597
19647
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19598
|
-
className: cn("flex flex-col pl-6 min-w-0 gap-2", isLast && reply.children.length === 0 ? "pb-16" : "pb-6"),
|
|
19648
|
+
className: cn$1("flex flex-col pl-6 min-w-0 gap-2", isLast && reply.children.length === 0 ? "pb-16" : "pb-6"),
|
|
19599
19649
|
children: [
|
|
19600
19650
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19601
19651
|
className: "flex flex-nowrap items-center content-center w-full overflow-hidden",
|
|
19602
19652
|
children: [
|
|
19603
19653
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
19604
|
-
className: cn("mr-2 text-4xl font-normal text-muted", isNicknameLonger ? "min-w-0 truncate shrink" : "shrink-0"),
|
|
19654
|
+
className: cn$1("mr-2 text-4xl font-normal text-muted", isNicknameLonger ? "min-w-0 truncate shrink" : "shrink-0"),
|
|
19605
19655
|
children: reply.nickname
|
|
19606
19656
|
}),
|
|
19607
19657
|
reply.label_text !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19608
|
-
className: cn("px-4 py-1 text-3xl rounded-xl mr-2", reply.label_text === "作者" ? "bg-[#fe2c55] text-white" : "bg-surface text-muted"),
|
|
19658
|
+
className: cn$1("px-4 py-1 text-3xl rounded-xl mr-2", reply.label_text === "作者" ? "bg-[#fe2c55] text-white" : "bg-surface text-muted"),
|
|
19609
19659
|
children: reply.label_text
|
|
19610
19660
|
}),
|
|
19611
19661
|
reply.reply_to_username && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19612
|
-
className: cn("flex items-center", !isNicknameLonger ? "overflow-hidden min-w-0 shrink" : "shrink-0"),
|
|
19662
|
+
className: cn$1("flex items-center", !isNicknameLonger ? "overflow-hidden min-w-0 shrink" : "shrink-0"),
|
|
19613
19663
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(a, {
|
|
19614
19664
|
weight: "fill",
|
|
19615
19665
|
className: "w-7 h-auto mr-3.5 mx-1 text-muted shrink-0"
|
|
19616
19666
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
19617
|
-
className: cn("text-4xl font-normal text-muted", !isNicknameLonger && "truncate"),
|
|
19667
|
+
className: cn$1("text-4xl font-normal text-muted", !isNicknameLonger && "truncate"),
|
|
19618
19668
|
children: reply.reply_to_username
|
|
19619
19669
|
})]
|
|
19620
19670
|
})
|
|
@@ -19684,7 +19734,7 @@ var ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
|
|
|
19684
19734
|
*/
|
|
19685
19735
|
var CommentItemComponent$1 = (props) => {
|
|
19686
19736
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19687
|
-
className: cn("flex flex-col px-6 pt-8", {
|
|
19737
|
+
className: cn$1("flex flex-col px-6 pt-8", {
|
|
19688
19738
|
"pb-0": props.isLast,
|
|
19689
19739
|
"pb-10": !props.isLast
|
|
19690
19740
|
}),
|
|
@@ -19846,7 +19896,7 @@ var DouyinComment = import_react.memo((props) => {
|
|
|
19846
19896
|
* @param props 组件属性
|
|
19847
19897
|
* @returns JSX元素
|
|
19848
19898
|
*/
|
|
19849
|
-
var DouyinHeader$
|
|
19899
|
+
var DouyinHeader$1 = ({ useDarkTheme }) => {
|
|
19850
19900
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19851
19901
|
className: "flex items-center px-12 py-15",
|
|
19852
19902
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -19867,7 +19917,7 @@ var DouyinHeader$3 = ({ useDarkTheme }) => {
|
|
|
19867
19917
|
* @param props 组件属性
|
|
19868
19918
|
* @returns JSX元素
|
|
19869
19919
|
*/
|
|
19870
|
-
var CoverSection$
|
|
19920
|
+
var CoverSection$1 = ({ imageUrl }) => {
|
|
19871
19921
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19872
19922
|
className: "flex flex-col items-center my-5",
|
|
19873
19923
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -19885,7 +19935,7 @@ var CoverSection$3 = ({ imageUrl }) => {
|
|
|
19885
19935
|
* @param props 组件属性
|
|
19886
19936
|
* @returns JSX元素
|
|
19887
19937
|
*/
|
|
19888
|
-
var InfoSection$
|
|
19938
|
+
var InfoSection$1 = (props) => {
|
|
19889
19939
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19890
19940
|
className: "flex flex-col px-16 py-5",
|
|
19891
19941
|
children: [
|
|
@@ -19937,7 +19987,7 @@ var InfoSection$3 = (props) => {
|
|
|
19937
19987
|
* @param props 组件属性
|
|
19938
19988
|
* @returns JSX元素
|
|
19939
19989
|
*/
|
|
19940
|
-
var UserInfoSection
|
|
19990
|
+
var UserInfoSection = (props) => {
|
|
19941
19991
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19942
19992
|
className: "flex flex-col gap-12",
|
|
19943
19993
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -20036,7 +20086,7 @@ var UserInfoSection$2 = (props) => {
|
|
|
20036
20086
|
});
|
|
20037
20087
|
};
|
|
20038
20088
|
/** 共创者信息 */
|
|
20039
|
-
var CoCreatorsInfo
|
|
20089
|
+
var CoCreatorsInfo = ({ info }) => {
|
|
20040
20090
|
const creators = info?.co_creators ?? [];
|
|
20041
20091
|
if (creators.length === 0) return null;
|
|
20042
20092
|
const items = creators.slice(0, 50);
|
|
@@ -20121,11 +20171,11 @@ var DouyinDynamic = (props) => {
|
|
|
20121
20171
|
...props,
|
|
20122
20172
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
20123
20173
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
20124
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinHeader$
|
|
20174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinHeader$1, { useDarkTheme: props.data.useDarkTheme }),
|
|
20125
20175
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
20126
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoverSection$
|
|
20176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoverSection$1, { imageUrl: props.data.image_url }),
|
|
20127
20177
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-5" }),
|
|
20128
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection$
|
|
20178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection$1, { ...props }),
|
|
20129
20179
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-25" }),
|
|
20130
20180
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20131
20181
|
className: "flex flex-col gap-10 px-0 pt-25",
|
|
@@ -20140,10 +20190,10 @@ var DouyinDynamic = (props) => {
|
|
|
20140
20190
|
children: [coCreatorCount, "人共创"]
|
|
20141
20191
|
})]
|
|
20142
20192
|
})
|
|
20143
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoCreatorsInfo
|
|
20193
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoCreatorsInfo, { info: props.data.cooperation_info })]
|
|
20144
20194
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20145
20195
|
className: "flex justify-between items-start px-20 pb-20",
|
|
20146
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection
|
|
20196
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20147
20197
|
className: "flex flex-col items-center gap-4",
|
|
20148
20198
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20149
20199
|
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
@@ -20427,197 +20477,344 @@ var StatItem$3 = ({ icon: IconComponent, value, iconClassName }) => /* @__PURE__
|
|
|
20427
20477
|
});
|
|
20428
20478
|
//#endregion
|
|
20429
20479
|
//#region ../template/src/components/platforms/douyin/ImageWork.tsx
|
|
20430
|
-
/**
|
|
20431
|
-
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
|
|
20448
|
-
}
|
|
20449
|
-
|
|
20450
|
-
|
|
20451
|
-
|
|
20452
|
-
|
|
20453
|
-
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
})
|
|
20480
|
+
/** 抖音实况图标,来源于根目录 noun-live-photo-710576.svg 的 React 化精简版。 */
|
|
20481
|
+
var LivePhotoIcon = ({ size = 28, className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
20482
|
+
width: size,
|
|
20483
|
+
height: size,
|
|
20484
|
+
viewBox: "0 0 100 100",
|
|
20485
|
+
fill: "none",
|
|
20486
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20487
|
+
className,
|
|
20488
|
+
"aria-hidden": "true",
|
|
20489
|
+
children: [
|
|
20490
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
|
|
20491
|
+
cx: "50",
|
|
20492
|
+
cy: "50",
|
|
20493
|
+
r: "37",
|
|
20494
|
+
stroke: "currentColor",
|
|
20495
|
+
strokeWidth: "6",
|
|
20496
|
+
strokeDasharray: "2 9",
|
|
20497
|
+
strokeLinecap: "round"
|
|
20498
|
+
}),
|
|
20499
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
|
|
20500
|
+
cx: "50",
|
|
20501
|
+
cy: "50",
|
|
20502
|
+
r: "25",
|
|
20503
|
+
stroke: "currentColor",
|
|
20504
|
+
strokeWidth: "6"
|
|
20505
|
+
}),
|
|
20506
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
|
|
20507
|
+
cx: "50",
|
|
20508
|
+
cy: "50",
|
|
20509
|
+
r: "10",
|
|
20510
|
+
fill: "currentColor"
|
|
20462
20511
|
})
|
|
20463
|
-
|
|
20512
|
+
]
|
|
20513
|
+
});
|
|
20514
|
+
/** 首图媒体类型徽标配置。 */
|
|
20515
|
+
var imageMediaTypeMeta = {
|
|
20516
|
+
static: {
|
|
20517
|
+
label: "静态",
|
|
20518
|
+
icon: o$1
|
|
20519
|
+
},
|
|
20520
|
+
live: {
|
|
20521
|
+
label: "动图",
|
|
20522
|
+
icon: LivePhotoIcon
|
|
20523
|
+
},
|
|
20524
|
+
clip: {
|
|
20525
|
+
label: "短片",
|
|
20526
|
+
icon: o$2
|
|
20527
|
+
}
|
|
20464
20528
|
};
|
|
20465
|
-
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
className: "flex flex-col px-16 py-5",
|
|
20471
|
-
children: [
|
|
20472
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20473
|
-
className: "text-[70px] font-bold leading-relaxed mb-9 text-foreground select-text",
|
|
20474
|
-
style: {
|
|
20475
|
-
letterSpacing: "1.5px",
|
|
20476
|
-
wordWrap: "break-word"
|
|
20477
|
-
},
|
|
20478
|
-
dangerouslySetInnerHTML: { __html: props.data.desc }
|
|
20479
|
-
}),
|
|
20480
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20481
|
-
className: "flex items-center gap-6 text-[45px] text-muted font-light mb-2.5 select-text",
|
|
20482
|
-
children: [
|
|
20483
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20484
|
-
className: "flex gap-2 items-center",
|
|
20485
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Heart, { className: "w-11 h-11 text-like" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.dianzan, "点赞"] })]
|
|
20486
|
-
}),
|
|
20487
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }),
|
|
20488
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20489
|
-
className: "flex gap-2 items-center",
|
|
20490
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageCircle, { className: "w-11 h-11 text-comment" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.pinglun, "评论"] })]
|
|
20491
|
-
}),
|
|
20492
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }),
|
|
20493
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20494
|
-
className: "flex gap-2 items-center",
|
|
20495
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Bookmark, { className: "w-11 h-11" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.shouchang, "收藏"] })]
|
|
20496
|
-
}),
|
|
20497
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }),
|
|
20498
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20499
|
-
className: "flex gap-2 items-center",
|
|
20500
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Share2, { className: "w-11 h-11 text-success" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.share, "分享"] })]
|
|
20501
|
-
})
|
|
20502
|
-
]
|
|
20503
|
-
}),
|
|
20504
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20505
|
-
className: "flex items-center gap-2 text-[45px] text-muted font-light select-text",
|
|
20506
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clock, { className: "w-11 h-11 text-time" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["发布于: ", props.data.create_time] })]
|
|
20507
|
-
}),
|
|
20508
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20509
|
-
className: "flex items-center gap-2 text-[45px] text-muted font-light select-text",
|
|
20510
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Maximize, { className: "w-11 h-11 text-time text-time" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["图片生成于: ", format(/* @__PURE__ */ new Date(), "yyyy-MM-dd HH:mm:ss")] })]
|
|
20511
|
-
})
|
|
20512
|
-
]
|
|
20529
|
+
var DouyinAvatarUserInfo$1 = (props) => {
|
|
20530
|
+
const { avater_url, username, create_time, useDarkTheme, dynamicTYPE } = props.data;
|
|
20531
|
+
const publishTime = formatDistanceToNow(fromUnixTime(create_time), {
|
|
20532
|
+
addSuffix: true,
|
|
20533
|
+
locale: zhCN
|
|
20513
20534
|
});
|
|
20514
|
-
};
|
|
20515
|
-
/**
|
|
20516
|
-
* 用户信息组件
|
|
20517
|
-
*/
|
|
20518
|
-
var UserInfoSection$1 = (props) => {
|
|
20519
20535
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20520
|
-
className: "flex
|
|
20536
|
+
className: "flex gap-10 items-center justify-between px-0 pb-0 pl-24 pr-10",
|
|
20521
20537
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20522
|
-
className: "flex gap-
|
|
20538
|
+
className: "flex gap-10 items-center",
|
|
20523
20539
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20524
|
-
className: "
|
|
20525
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
20526
|
-
|
|
20527
|
-
|
|
20528
|
-
|
|
20529
|
-
|
|
20530
|
-
|
|
20531
|
-
})
|
|
20540
|
+
className: "flex justify-center items-center bg-white rounded-full w-35 h-35",
|
|
20541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20542
|
+
src: avater_url,
|
|
20543
|
+
alt: "头像",
|
|
20544
|
+
className: "rounded-full w-33 h-33 shadow-large",
|
|
20545
|
+
referrerPolicy: "no-referrer",
|
|
20546
|
+
crossOrigin: "anonymous"
|
|
20532
20547
|
})
|
|
20533
20548
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20534
|
-
className: "flex flex-col gap-
|
|
20535
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.
|
|
20536
|
-
className: "text-
|
|
20537
|
-
children:
|
|
20549
|
+
className: "flex flex-col gap-8 text-7xl",
|
|
20550
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20551
|
+
className: "text-6xl font-bold select-text text-foreground",
|
|
20552
|
+
children: username
|
|
20538
20553
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20539
|
-
className: "flex gap-2 items-center text-4xl text-muted",
|
|
20540
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
20541
|
-
size: 32,
|
|
20542
|
-
className: "text-muted"
|
|
20543
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
20554
|
+
className: "flex gap-2 items-center text-4xl font-normal whitespace-nowrap text-muted",
|
|
20555
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clock3, { size: 40 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20544
20556
|
className: "select-text",
|
|
20545
|
-
children:
|
|
20557
|
+
children: publishTime
|
|
20546
20558
|
})]
|
|
20547
20559
|
})]
|
|
20548
20560
|
})]
|
|
20549
20561
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20550
|
-
className: "
|
|
20562
|
+
className: "shrink-0 flex flex-col items-end gap-2",
|
|
20563
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20564
|
+
src: useDarkTheme ? "/image/douyin/dylogo-light.svg" : "/image/douyin/dylogo-dark.svg",
|
|
20565
|
+
alt: "抖音",
|
|
20566
|
+
className: "h-20 w-auto object-contain"
|
|
20567
|
+
}), dynamicTYPE && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20568
|
+
className: "px-6 py-2 rounded-full bg-surface-secondary text-2xl font-medium text-muted select-text tracking-widest",
|
|
20569
|
+
children: dynamicTYPE
|
|
20570
|
+
})]
|
|
20571
|
+
})]
|
|
20572
|
+
});
|
|
20573
|
+
};
|
|
20574
|
+
var DouyinCoverImage = (props) => {
|
|
20575
|
+
const { image_list, music } = props.data;
|
|
20576
|
+
const imageItems = image_list.images;
|
|
20577
|
+
const cover = imageItems[0];
|
|
20578
|
+
const previews = imageItems.slice(1);
|
|
20579
|
+
const totalCount = image_list.total_count;
|
|
20580
|
+
const previewItems = previews.slice(0, 2);
|
|
20581
|
+
if (!cover?.url) return null;
|
|
20582
|
+
const firstMediaMeta = imageMediaTypeMeta[cover?.media_type ?? "static"];
|
|
20583
|
+
const FirstMediaIcon = firstMediaMeta.icon;
|
|
20584
|
+
const firstMediaBadge = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20585
|
+
className: "absolute top-7 right-7 z-20 flex items-center gap-2 px-4 py-2 rounded-2xl bg-black/50 backdrop-blur-sm text-white shadow-large",
|
|
20586
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FirstMediaIcon, {
|
|
20587
|
+
size: 34,
|
|
20588
|
+
className: "text-white",
|
|
20589
|
+
weight: "fill"
|
|
20590
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20591
|
+
className: "text-3xl font-medium select-text",
|
|
20592
|
+
children: firstMediaMeta.label
|
|
20593
|
+
})]
|
|
20594
|
+
});
|
|
20595
|
+
const musicBadge = music && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20596
|
+
className: "absolute left-7 bottom-7 z-20 flex items-center gap-4 max-w-[72%] p-3 rounded-3xl bg-black/45 backdrop-blur-2xl border border-white/20 shadow-large overflow-hidden",
|
|
20597
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20598
|
+
className: "relative shrink-0 w-18 h-18",
|
|
20599
|
+
children: music.cover ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20600
|
+
src: music.cover,
|
|
20601
|
+
alt: "",
|
|
20602
|
+
className: "absolute inset-0 w-full h-full rounded-2xl object-cover blur-md scale-110 opacity-70",
|
|
20603
|
+
referrerPolicy: "no-referrer",
|
|
20604
|
+
crossOrigin: "anonymous"
|
|
20605
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20606
|
+
src: music.cover,
|
|
20607
|
+
alt: "BGM封面",
|
|
20608
|
+
className: "relative z-10 w-full h-full rounded-2xl object-cover",
|
|
20609
|
+
referrerPolicy: "no-referrer",
|
|
20610
|
+
crossOrigin: "anonymous"
|
|
20611
|
+
})] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20612
|
+
className: "flex items-center justify-center w-full h-full rounded-2xl bg-white/15 text-white",
|
|
20613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(e, {
|
|
20614
|
+
size: 36,
|
|
20615
|
+
weight: "fill"
|
|
20616
|
+
})
|
|
20617
|
+
})
|
|
20618
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20619
|
+
className: "flex flex-col gap-1 min-w-0 pr-2 text-white",
|
|
20620
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20621
|
+
className: "text-3xl font-semibold truncate select-text",
|
|
20622
|
+
children: music.title
|
|
20623
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20624
|
+
className: "text-2xl text-white/85 truncate select-text",
|
|
20625
|
+
children: music.author
|
|
20626
|
+
})]
|
|
20627
|
+
})]
|
|
20628
|
+
});
|
|
20629
|
+
if (previewItems.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20630
|
+
className: "px-20",
|
|
20631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20632
|
+
className: "relative overflow-hidden rounded-5xl shadow-large",
|
|
20551
20633
|
children: [
|
|
20552
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
20553
|
-
|
|
20554
|
-
|
|
20555
|
-
|
|
20556
|
-
|
|
20557
|
-
|
|
20558
|
-
size: 28,
|
|
20559
|
-
className: "text-like"
|
|
20560
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20561
|
-
className: "text-muted",
|
|
20562
|
-
children: "获赞"
|
|
20563
|
-
})]
|
|
20564
|
-
}),
|
|
20565
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full h-px bg-border" }),
|
|
20566
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20567
|
-
className: "select-text font-medium text-4xl",
|
|
20568
|
-
children: props.data.获赞
|
|
20569
|
-
})
|
|
20570
|
-
]
|
|
20634
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20635
|
+
src: cover.url,
|
|
20636
|
+
alt: "图文封面",
|
|
20637
|
+
className: "object-contain w-full h-auto",
|
|
20638
|
+
referrerPolicy: "no-referrer",
|
|
20639
|
+
crossOrigin: "anonymous"
|
|
20571
20640
|
}),
|
|
20572
|
-
|
|
20573
|
-
|
|
20641
|
+
firstMediaBadge,
|
|
20642
|
+
musicBadge
|
|
20643
|
+
]
|
|
20644
|
+
})
|
|
20645
|
+
});
|
|
20646
|
+
const stack = [{
|
|
20647
|
+
url: cover.url,
|
|
20648
|
+
filter: "none",
|
|
20649
|
+
shift: 0
|
|
20650
|
+
}, ...previewItems.map((item, idx) => ({
|
|
20651
|
+
url: item.url,
|
|
20652
|
+
filter: idx === 0 ? "brightness(0.88) saturate(0.86) contrast(0.96) blur(1px) opacity(0.8)" : "brightness(0.78) saturate(0.68) contrast(0.9) blur(3px) opacity(0.6)",
|
|
20653
|
+
shift: (idx + 1) * 16
|
|
20654
|
+
}))].filter((item) => item.url);
|
|
20655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20656
|
+
className: "px-20",
|
|
20657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20658
|
+
className: "relative overflow-visible rounded-5xl",
|
|
20659
|
+
children: stack.map((item, idx) => {
|
|
20660
|
+
return idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20661
|
+
className: "relative overflow-hidden rounded-5xl shadow-large",
|
|
20662
|
+
style: { zIndex: stack.length },
|
|
20574
20663
|
children: [
|
|
20575
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
20576
|
-
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
className: "text-muted",
|
|
20582
|
-
children: "关注"
|
|
20583
|
-
})]
|
|
20664
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20665
|
+
src: item.url,
|
|
20666
|
+
alt: "图文封面",
|
|
20667
|
+
className: "w-full h-auto block",
|
|
20668
|
+
referrerPolicy: "no-referrer",
|
|
20669
|
+
crossOrigin: "anonymous"
|
|
20584
20670
|
}),
|
|
20585
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20586
|
-
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20590
|
-
|
|
20591
|
-
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20596
|
-
className: "flex gap-1 items-center",
|
|
20597
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Users, {
|
|
20598
|
-
size: 28,
|
|
20599
|
-
className: "text-accent"
|
|
20600
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20601
|
-
className: "text-muted",
|
|
20602
|
-
children: "粉丝"
|
|
20603
|
-
})]
|
|
20671
|
+
totalCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20672
|
+
className: "absolute top-7 left-7 px-5 py-2 rounded-2xl bg-black/50 backdrop-blur-sm",
|
|
20673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
20674
|
+
className: "text-3xl font-medium text-white select-text",
|
|
20675
|
+
children: [
|
|
20676
|
+
"共 ",
|
|
20677
|
+
totalCount,
|
|
20678
|
+
" 张"
|
|
20679
|
+
]
|
|
20680
|
+
})
|
|
20604
20681
|
}),
|
|
20605
|
-
|
|
20606
|
-
|
|
20607
|
-
className: "select-text font-medium text-4xl",
|
|
20608
|
-
children: props.data.粉丝
|
|
20609
|
-
})
|
|
20682
|
+
firstMediaBadge,
|
|
20683
|
+
musicBadge
|
|
20610
20684
|
]
|
|
20611
|
-
})
|
|
20612
|
-
|
|
20685
|
+
}, idx) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20686
|
+
className: "absolute inset-0 overflow-hidden rounded-5xl shadow-large",
|
|
20687
|
+
style: {
|
|
20688
|
+
transform: `translate(${item.shift}px, ${item.shift * 2}px)`,
|
|
20689
|
+
zIndex: stack.length - idx
|
|
20690
|
+
},
|
|
20691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20692
|
+
src: item.url,
|
|
20693
|
+
alt: `预览图 ${idx + 1}`,
|
|
20694
|
+
className: "w-full h-full object-cover object-center",
|
|
20695
|
+
style: { filter: item.filter },
|
|
20696
|
+
referrerPolicy: "no-referrer",
|
|
20697
|
+
crossOrigin: "anonymous"
|
|
20698
|
+
})
|
|
20699
|
+
}, idx);
|
|
20700
|
+
})
|
|
20701
|
+
})
|
|
20702
|
+
});
|
|
20703
|
+
};
|
|
20704
|
+
var DouyinDynamicContent$1 = (props) => {
|
|
20705
|
+
const { title, desc } = props.data;
|
|
20706
|
+
const richTextOptions = {
|
|
20707
|
+
hashtag: { className: "text-[#04498d] dark:text-[#face15] font-medium" },
|
|
20708
|
+
mention: { className: "text-[#04498d] dark:text-[#face15] font-medium" }
|
|
20709
|
+
};
|
|
20710
|
+
const hasTitle = Boolean(title?.nodes.length);
|
|
20711
|
+
const hasDesc = desc.nodes.length > 0;
|
|
20712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20713
|
+
className: "flex flex-col px-20 w-full leading-relaxed",
|
|
20714
|
+
children: [hasTitle && title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20715
|
+
className: "text-[72px] leading-tight mb-8 text-foreground select-text",
|
|
20716
|
+
style: {
|
|
20717
|
+
wordBreak: "break-word",
|
|
20718
|
+
overflowWrap: "break-word"
|
|
20719
|
+
},
|
|
20720
|
+
children: renderRichTextToReact(title, richTextOptions)
|
|
20721
|
+
}), hasDesc && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20722
|
+
className: "text-[56px] tracking-[0.5px] leading-[1.7] whitespace-pre-wrap text-foreground select-text",
|
|
20723
|
+
style: {
|
|
20724
|
+
wordBreak: "break-word",
|
|
20725
|
+
overflowWrap: "break-word"
|
|
20726
|
+
},
|
|
20727
|
+
children: renderRichTextToReact(desc, richTextOptions)
|
|
20613
20728
|
})]
|
|
20614
20729
|
});
|
|
20615
20730
|
};
|
|
20616
|
-
|
|
20617
|
-
|
|
20618
|
-
*/
|
|
20619
|
-
|
|
20620
|
-
|
|
20731
|
+
var DouyinDynamicStatus$1 = (props) => {
|
|
20732
|
+
const { dianzan, pinglun, shouchang, share, ip_location, suggest_word } = props.data;
|
|
20733
|
+
const renderTime = format(/* @__PURE__ */ new Date(), "yyyy-MM-dd HH:mm:ss");
|
|
20734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20735
|
+
className: "flex flex-col gap-10 px-18 w-full leading-relaxed",
|
|
20736
|
+
children: [
|
|
20737
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20738
|
+
className: "flex gap-6 items-center text-5xl tracking-normal select-text text-foreground/70",
|
|
20739
|
+
children: [
|
|
20740
|
+
{
|
|
20741
|
+
icon: o$3,
|
|
20742
|
+
value: dianzan,
|
|
20743
|
+
label: "点赞"
|
|
20744
|
+
},
|
|
20745
|
+
{
|
|
20746
|
+
icon: t,
|
|
20747
|
+
value: pinglun,
|
|
20748
|
+
label: "评论"
|
|
20749
|
+
},
|
|
20750
|
+
{
|
|
20751
|
+
icon: r,
|
|
20752
|
+
value: shouchang,
|
|
20753
|
+
label: "收藏"
|
|
20754
|
+
},
|
|
20755
|
+
{
|
|
20756
|
+
icon: e$1,
|
|
20757
|
+
value: share,
|
|
20758
|
+
label: "分享"
|
|
20759
|
+
}
|
|
20760
|
+
].map((stat, idx) => {
|
|
20761
|
+
const Icon = stat.icon;
|
|
20762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [idx > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20763
|
+
className: "flex gap-2 items-end",
|
|
20764
|
+
children: [
|
|
20765
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
20766
|
+
size: 50,
|
|
20767
|
+
weight: "fill",
|
|
20768
|
+
className: "mt-2"
|
|
20769
|
+
}),
|
|
20770
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20771
|
+
className: "font-medium",
|
|
20772
|
+
children: stat.value
|
|
20773
|
+
}),
|
|
20774
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20775
|
+
className: "text-3xl font-light",
|
|
20776
|
+
children: stat.label
|
|
20777
|
+
})
|
|
20778
|
+
]
|
|
20779
|
+
})] }, stat.label);
|
|
20780
|
+
})
|
|
20781
|
+
}),
|
|
20782
|
+
ip_location && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20783
|
+
className: "flex gap-12 items-center font-light select-text text-foreground/70",
|
|
20784
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20785
|
+
className: "flex gap-2 items-center",
|
|
20786
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(a$1, {
|
|
20787
|
+
size: 50,
|
|
20788
|
+
weight: "fill",
|
|
20789
|
+
className: "mt-1"
|
|
20790
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20791
|
+
className: "text-5xl font-medium",
|
|
20792
|
+
children: ip_location
|
|
20793
|
+
})]
|
|
20794
|
+
}), suggest_word && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20795
|
+
className: "flex gap-2 items-center py-3.5 px-6 bg-foreground/5 dark:bg-foreground/10 rounded-full text-4xl font-light select-text text-foreground/70",
|
|
20796
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20797
|
+
className: "text-muted",
|
|
20798
|
+
children: suggest_word.hint_text
|
|
20799
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20800
|
+
className: "text-[#04498d] dark:text-[#face15] font-medium",
|
|
20801
|
+
children: suggest_word.word
|
|
20802
|
+
})]
|
|
20803
|
+
})]
|
|
20804
|
+
}),
|
|
20805
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20806
|
+
className: "flex gap-3 items-center text-4xl font-light tracking-normal select-text text-foreground/70",
|
|
20807
|
+
children: [
|
|
20808
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Maximize, { size: 44 }),
|
|
20809
|
+
"图片生成于: ",
|
|
20810
|
+
renderTime
|
|
20811
|
+
]
|
|
20812
|
+
})
|
|
20813
|
+
]
|
|
20814
|
+
});
|
|
20815
|
+
};
|
|
20816
|
+
var DouyinCoCreatorList$1 = (props) => {
|
|
20817
|
+
const creators = props.data.cooperation_info?.co_creators ?? [];
|
|
20621
20818
|
if (creators.length === 0) return null;
|
|
20622
20819
|
const items = creators.slice(0, 50);
|
|
20623
20820
|
const listRef = import_react.useRef(null);
|
|
@@ -20635,46 +20832,44 @@ var CoCreatorsInfo$1 = ({ info }) => {
|
|
|
20635
20832
|
return () => window.removeEventListener("resize", calc);
|
|
20636
20833
|
}, [items.length]);
|
|
20637
20834
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20638
|
-
className: "flex flex-col
|
|
20835
|
+
className: "flex flex-col px-20 w-full",
|
|
20639
20836
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20640
20837
|
ref: listRef,
|
|
20641
20838
|
className: "flex overflow-hidden gap-8 py-1 pr-2 w-full",
|
|
20642
|
-
|
|
20643
|
-
|
|
20644
|
-
|
|
20645
|
-
|
|
20646
|
-
|
|
20647
|
-
|
|
20648
|
-
|
|
20649
|
-
|
|
20650
|
-
|
|
20651
|
-
|
|
20652
|
-
|
|
20653
|
-
className: "object-cover w-28 h-auto rounded-full"
|
|
20654
|
-
})
|
|
20655
|
-
}),
|
|
20656
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20657
|
-
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground/80",
|
|
20658
|
-
children: c.nickname || "未提供"
|
|
20659
|
-
}),
|
|
20660
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20661
|
-
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-foreground/70",
|
|
20662
|
-
children: c.role_title || "未提供"
|
|
20839
|
+
children: [items.slice(0, visibleCount).map((c, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20840
|
+
className: "flex flex-col items-center min-w-38 w-38 shrink-0",
|
|
20841
|
+
children: [
|
|
20842
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20843
|
+
className: "flex justify-center items-center bg-white rounded-full w-30 h-30",
|
|
20844
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20845
|
+
src: c.avatar_url,
|
|
20846
|
+
alt: "共创者头像",
|
|
20847
|
+
className: "object-cover w-28 h-28 rounded-full",
|
|
20848
|
+
referrerPolicy: "no-referrer",
|
|
20849
|
+
crossOrigin: "anonymous"
|
|
20663
20850
|
})
|
|
20664
|
-
|
|
20665
|
-
|
|
20666
|
-
|
|
20851
|
+
}),
|
|
20852
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20853
|
+
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground",
|
|
20854
|
+
children: c.nickname || "未提供"
|
|
20855
|
+
}),
|
|
20856
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20857
|
+
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-muted",
|
|
20858
|
+
children: c.role_title || "未提供"
|
|
20859
|
+
})
|
|
20860
|
+
]
|
|
20861
|
+
}, `${c.nickname || "creator"}-${idx}`)), items.length > visibleCount && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20667
20862
|
className: "flex flex-col items-center min-w-38 w-38 shrink-0",
|
|
20668
20863
|
children: [
|
|
20669
20864
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20670
|
-
className: "flex justify-center items-center rounded-full bg-surface-secondary w-
|
|
20865
|
+
className: "flex justify-center items-center rounded-full bg-surface-secondary w-30 h-30",
|
|
20671
20866
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20672
20867
|
className: "text-[42px] leading-none text-muted",
|
|
20673
20868
|
children: "···"
|
|
20674
20869
|
})
|
|
20675
20870
|
}),
|
|
20676
20871
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20677
|
-
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground
|
|
20872
|
+
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground",
|
|
20678
20873
|
children: [
|
|
20679
20874
|
"还有",
|
|
20680
20875
|
items.length - visibleCount,
|
|
@@ -20682,7 +20877,7 @@ var CoCreatorsInfo$1 = ({ info }) => {
|
|
|
20682
20877
|
]
|
|
20683
20878
|
}),
|
|
20684
20879
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20685
|
-
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-
|
|
20880
|
+
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-muted",
|
|
20686
20881
|
children: "共创"
|
|
20687
20882
|
})
|
|
20688
20883
|
]
|
|
@@ -20690,50 +20885,134 @@ var CoCreatorsInfo$1 = ({ info }) => {
|
|
|
20690
20885
|
})
|
|
20691
20886
|
});
|
|
20692
20887
|
};
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
*/
|
|
20696
|
-
|
|
20888
|
+
var DouyinDynamicFooter$1 = (props) => {
|
|
20889
|
+
const { avater_url, username, 抖音号, 获赞, 关注, 粉丝, share_url, useDarkTheme } = props.data;
|
|
20890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20891
|
+
className: "flex justify-between items-start px-20 pb-20",
|
|
20892
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20893
|
+
className: "flex flex-col gap-12",
|
|
20894
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20895
|
+
className: "flex gap-12 items-start",
|
|
20896
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20897
|
+
className: "relative shrink-0",
|
|
20898
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20899
|
+
className: "flex justify-center items-center bg-white rounded-full w-35 h-35",
|
|
20900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20901
|
+
src: avater_url,
|
|
20902
|
+
alt: "头像",
|
|
20903
|
+
className: "rounded-full w-33 h-33 shadow-large",
|
|
20904
|
+
referrerPolicy: "no-referrer",
|
|
20905
|
+
crossOrigin: "anonymous"
|
|
20906
|
+
})
|
|
20907
|
+
})
|
|
20908
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20909
|
+
className: "flex flex-col gap-5",
|
|
20910
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20911
|
+
className: "text-7xl font-bold select-text text-foreground",
|
|
20912
|
+
children: username
|
|
20913
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20914
|
+
className: "flex gap-2 items-center text-4xl text-muted",
|
|
20915
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Hash, { size: 32 }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
20916
|
+
className: "select-text",
|
|
20917
|
+
children: ["抖音号: ", 抖音号]
|
|
20918
|
+
})]
|
|
20919
|
+
})]
|
|
20920
|
+
})]
|
|
20921
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20922
|
+
className: "text-3xl flex gap-6 items-center text-foreground/70",
|
|
20923
|
+
children: [
|
|
20924
|
+
{
|
|
20925
|
+
icon: o$3,
|
|
20926
|
+
iconSize: 36,
|
|
20927
|
+
label: "获赞",
|
|
20928
|
+
value: 获赞
|
|
20929
|
+
},
|
|
20930
|
+
{
|
|
20931
|
+
icon: o$4,
|
|
20932
|
+
iconSize: 36,
|
|
20933
|
+
label: "关注",
|
|
20934
|
+
value: 关注
|
|
20935
|
+
},
|
|
20936
|
+
{
|
|
20937
|
+
icon: r$1,
|
|
20938
|
+
iconSize: 36,
|
|
20939
|
+
label: "粉丝",
|
|
20940
|
+
value: 粉丝
|
|
20941
|
+
}
|
|
20942
|
+
].map((stat) => {
|
|
20943
|
+
const Icon = stat.icon;
|
|
20944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20945
|
+
className: "flex flex-col gap-1 items-start px-6 py-3 rounded-2xl bg-surface",
|
|
20946
|
+
children: [
|
|
20947
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20948
|
+
className: "flex gap-1 items-center",
|
|
20949
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
20950
|
+
size: stat.iconSize,
|
|
20951
|
+
weight: "fill"
|
|
20952
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20953
|
+
className: "text-muted",
|
|
20954
|
+
children: stat.label
|
|
20955
|
+
})]
|
|
20956
|
+
}),
|
|
20957
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full h-px bg-border" }),
|
|
20958
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20959
|
+
className: "select-text font-medium text-4xl",
|
|
20960
|
+
children: stat.value
|
|
20961
|
+
})
|
|
20962
|
+
]
|
|
20963
|
+
}, stat.label);
|
|
20964
|
+
})
|
|
20965
|
+
})]
|
|
20966
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20967
|
+
className: "flex flex-col items-center gap-4",
|
|
20968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20969
|
+
src: generateQRCode(share_url, useDarkTheme),
|
|
20970
|
+
alt: "二维码",
|
|
20971
|
+
className: "h-auto w-75 rounded-2xl"
|
|
20972
|
+
})
|
|
20973
|
+
})]
|
|
20974
|
+
});
|
|
20975
|
+
};
|
|
20976
|
+
var DouyinImageWork = import_react.memo((props) => {
|
|
20697
20977
|
const coCreatorCount = props.data.cooperation_info?.co_creator_nums ?? props.data.cooperation_info?.co_creators?.length ?? void 0;
|
|
20978
|
+
const hasCoCreators = !!coCreatorCount && coCreatorCount > 0;
|
|
20698
20979
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultLayout, {
|
|
20699
20980
|
...props,
|
|
20700
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
|
|
20706
|
-
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
className:
|
|
20710
|
-
|
|
20711
|
-
|
|
20712
|
-
|
|
20713
|
-
|
|
20981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20982
|
+
className: "p-4",
|
|
20983
|
+
children: [
|
|
20984
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-25" }),
|
|
20985
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinAvatarUserInfo$1, { ...props }),
|
|
20986
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
20987
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinDynamicContent$1, { ...props }),
|
|
20988
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
20989
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinCoverImage, { ...props }),
|
|
20990
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn$1(props.data.image_list.images.length > 2 ? "h-25" : "h-20") }),
|
|
20991
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinDynamicStatus$1, { ...props }),
|
|
20992
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn$1(hasCoCreators && "h-23", !hasCoCreators && "h-40") }),
|
|
20993
|
+
hasCoCreators && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
20994
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20995
|
+
className: "px-20 pb-8",
|
|
20714
20996
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20715
20997
|
className: "gap-2 inline-flex items-center rounded-2xl bg-surface text-foreground/80 px-6 py-3",
|
|
20716
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
20717
|
-
|
|
20998
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(o, {
|
|
20999
|
+
size: 26,
|
|
21000
|
+
weight: "fill"
|
|
21001
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
21002
|
+
className: "text-3xl font-medium leading-none select-text",
|
|
20718
21003
|
children: [coCreatorCount, "人共创"]
|
|
20719
21004
|
})]
|
|
20720
21005
|
})
|
|
20721
|
-
}),
|
|
20722
|
-
|
|
20723
|
-
|
|
20724
|
-
|
|
20725
|
-
|
|
20726
|
-
|
|
20727
|
-
|
|
20728
|
-
alt: "二维码",
|
|
20729
|
-
className: "h-auto w-75 rounded-xl"
|
|
20730
|
-
})
|
|
20731
|
-
})]
|
|
20732
|
-
})]
|
|
20733
|
-
})
|
|
20734
|
-
] })
|
|
21006
|
+
}),
|
|
21007
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinCoCreatorList$1, { ...props }),
|
|
21008
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" })
|
|
21009
|
+
] }),
|
|
21010
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinDynamicFooter$1, { ...props })
|
|
21011
|
+
]
|
|
21012
|
+
})
|
|
20735
21013
|
});
|
|
20736
|
-
};
|
|
21014
|
+
});
|
|
21015
|
+
DouyinImageWork.displayName = "DouyinImageWork";
|
|
20737
21016
|
//#endregion
|
|
20738
21017
|
//#region ../template/src/components/platforms/douyin/Live.tsx
|
|
20739
21018
|
var coverMaskStyle = {
|
|
@@ -20847,7 +21126,7 @@ AmbientBackground.displayName = "AmbientBackground";
|
|
|
20847
21126
|
/**
|
|
20848
21127
|
* 封面组件 - 全宽铺满 + 双向渐变溶解 + LIVE大字
|
|
20849
21128
|
*/
|
|
20850
|
-
var CoverSection
|
|
21129
|
+
var CoverSection = ({ imageUrl }) => {
|
|
20851
21130
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20852
21131
|
className: "relative",
|
|
20853
21132
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -20869,7 +21148,7 @@ var CoverSection$1 = ({ imageUrl }) => {
|
|
|
20869
21148
|
/**
|
|
20870
21149
|
* 直播信息组件
|
|
20871
21150
|
*/
|
|
20872
|
-
var InfoSection
|
|
21151
|
+
var InfoSection = ({ data }) => {
|
|
20873
21152
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20874
21153
|
className: "flex flex-col gap-8 px-16 pt-12",
|
|
20875
21154
|
children: [
|
|
@@ -21082,8 +21361,8 @@ var DouyinLive = (props) => {
|
|
|
21082
21361
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AmbientBackground, { pic: d.image_url }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
21083
21362
|
className: "relative z-10",
|
|
21084
21363
|
children: [
|
|
21085
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoverSection
|
|
21086
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection
|
|
21364
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoverSection, { imageUrl: d.image_url }),
|
|
21365
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection, { data: d }),
|
|
21087
21366
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BottomSection, { data: d })
|
|
21088
21367
|
]
|
|
21089
21368
|
})]
|
|
@@ -21096,7 +21375,7 @@ var DouyinLive = (props) => {
|
|
|
21096
21375
|
* @param props 组件属性
|
|
21097
21376
|
* @returns JSX元素
|
|
21098
21377
|
*/
|
|
21099
|
-
var DouyinHeader
|
|
21378
|
+
var DouyinHeader = ({ useDarkTheme }) => {
|
|
21100
21379
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
21101
21380
|
className: "flex items-center px-12 py-15",
|
|
21102
21381
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -21240,7 +21519,7 @@ var DouyinMusicInfo = (props) => {
|
|
|
21240
21519
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultLayout, {
|
|
21241
21520
|
...props,
|
|
21242
21521
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
21243
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinHeader
|
|
21522
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinHeader, { useDarkTheme: data.useDarkTheme }),
|
|
21244
21523
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MusicCoverSection, {
|
|
21245
21524
|
imageUrl: data.image_url,
|
|
21246
21525
|
description: data.desc,
|
|
@@ -22118,7 +22397,7 @@ var formatCount$2 = (count) => {
|
|
|
22118
22397
|
* 格式化视频时长显示 (如: 6:20)
|
|
22119
22398
|
* @param milliseconds 毫秒数
|
|
22120
22399
|
*/
|
|
22121
|
-
var formatDuration$
|
|
22400
|
+
var formatDuration$4 = (milliseconds) => {
|
|
22122
22401
|
const seconds = Math.floor(milliseconds / 1e3);
|
|
22123
22402
|
return `${Math.floor(seconds / 60)}:${(seconds % 60).toString().padStart(2, "0")}`;
|
|
22124
22403
|
};
|
|
@@ -22154,7 +22433,7 @@ var VideoCard = ({ video }) => {
|
|
|
22154
22433
|
}),
|
|
22155
22434
|
video.is_video && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22156
22435
|
className: "absolute bottom-4 right-4 px-8 py-3 rounded-2xl text-4xl bg-white/50 text-black backdrop-blur-xs shadow-lg",
|
|
22157
|
-
children: formatDuration$
|
|
22436
|
+
children: formatDuration$4(video.duration)
|
|
22158
22437
|
}),
|
|
22159
22438
|
video.music && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22160
22439
|
className: "absolute bottom-4 left-4 flex items-center gap-2 px-6 py-3 rounded-2xl text-xl bg-white/50 text-black backdrop-blur-xs shadow-lg",
|
|
@@ -22368,12 +22647,12 @@ var formatNumber$1 = (num) => {
|
|
|
22368
22647
|
if (num >= 1e4) return `${(num / 1e4).toFixed(1)}万`;
|
|
22369
22648
|
return num.toLocaleString();
|
|
22370
22649
|
};
|
|
22371
|
-
var formatDuration$
|
|
22650
|
+
var formatDuration$3 = (ms) => {
|
|
22372
22651
|
const seconds = Math.floor(ms / 1e3);
|
|
22373
22652
|
return `${Math.floor(seconds / 60)}:${(seconds % 60).toString().padStart(2, "0")}`;
|
|
22374
22653
|
};
|
|
22375
22654
|
var DouyinVideoInfo = import_react.memo((props) => {
|
|
22376
|
-
const duration = (0, import_react.useMemo)(() => props.data.video ? formatDuration$
|
|
22655
|
+
const duration = (0, import_react.useMemo)(() => props.data.video ? formatDuration$3(props.data.video.duration) : null, [props.data.video]);
|
|
22377
22656
|
const coverMaskStyle = (0, import_react.useMemo)(() => ({
|
|
22378
22657
|
maskImage: `linear-gradient(to bottom,
|
|
22379
22658
|
transparent 0%,
|
|
@@ -22604,201 +22883,271 @@ var StatItem$1 = ({ icon, value }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx
|
|
|
22604
22883
|
DouyinVideoInfo.displayName = "DouyinVideoInfo";
|
|
22605
22884
|
//#endregion
|
|
22606
22885
|
//#region ../template/src/components/platforms/douyin/VideoWork.tsx
|
|
22607
|
-
|
|
22608
|
-
|
|
22609
|
-
|
|
22610
|
-
|
|
22611
|
-
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
|
|
22615
|
-
|
|
22616
|
-
|
|
22617
|
-
|
|
22618
|
-
|
|
22619
|
-
|
|
22620
|
-
|
|
22621
|
-
|
|
22622
|
-
|
|
22623
|
-
})]
|
|
22624
|
-
});
|
|
22625
|
-
};
|
|
22626
|
-
/**
|
|
22627
|
-
* 视频封面组件
|
|
22628
|
-
*/
|
|
22629
|
-
var CoverSection = ({ imageUrl }) => {
|
|
22630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22631
|
-
className: "flex flex-col items-center my-5",
|
|
22632
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22633
|
-
className: "flex flex-col items-center overflow-hidden shadow-large rounded-[25px] w-[90%] relative",
|
|
22634
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22635
|
-
className: "rounded-[25px] object-contain w-full h-full",
|
|
22636
|
-
src: imageUrl,
|
|
22637
|
-
alt: "视频封面"
|
|
22638
|
-
})
|
|
22639
|
-
})
|
|
22640
|
-
});
|
|
22641
|
-
};
|
|
22642
|
-
/**
|
|
22643
|
-
* 作品信息组件
|
|
22644
|
-
*/
|
|
22645
|
-
var InfoSection = (props) => {
|
|
22646
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22647
|
-
className: "flex flex-col px-16 py-5",
|
|
22648
|
-
children: [
|
|
22649
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22650
|
-
className: "text-[70px] font-bold leading-relaxed mb-9 text-foreground select-text",
|
|
22651
|
-
style: {
|
|
22652
|
-
letterSpacing: "1.5px",
|
|
22653
|
-
wordWrap: "break-word"
|
|
22654
|
-
},
|
|
22655
|
-
dangerouslySetInnerHTML: { __html: props.data.desc }
|
|
22656
|
-
}),
|
|
22657
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22658
|
-
className: "flex items-center gap-6 text-[45px] text-muted font-light mb-2.5 select-text",
|
|
22659
|
-
children: [
|
|
22660
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22661
|
-
className: "flex gap-2 items-center",
|
|
22662
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Heart, { className: "w-11 h-11 text-like" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.dianzan, "点赞"] })]
|
|
22663
|
-
}),
|
|
22664
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }),
|
|
22665
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22666
|
-
className: "flex gap-2 items-center",
|
|
22667
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageCircle, { className: "w-11 h-11 text-comment" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.pinglun, "评论"] })]
|
|
22668
|
-
}),
|
|
22669
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }),
|
|
22670
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22671
|
-
className: "flex gap-2 items-center",
|
|
22672
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Bookmark, { className: "w-11 h-11" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.shouchang, "收藏"] })]
|
|
22673
|
-
}),
|
|
22674
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }),
|
|
22675
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22676
|
-
className: "flex gap-2 items-center",
|
|
22677
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Share2, { className: "w-11 h-11 text-success" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [props.data.share, "分享"] })]
|
|
22678
|
-
})
|
|
22679
|
-
]
|
|
22680
|
-
}),
|
|
22681
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22682
|
-
className: "flex items-center gap-2 text-[45px] text-muted font-light select-text",
|
|
22683
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clock, { className: "w-11 h-11 text-time" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["发布于: ", props.data.create_time] })]
|
|
22684
|
-
}),
|
|
22685
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22686
|
-
className: "flex items-center gap-2 text-[45px] text-muted font-light select-text",
|
|
22687
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Maximize, { className: "w-11 h-11 text-time text-time" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["图片生成于: ", format(/* @__PURE__ */ new Date(), "yyyy-MM-dd HH:mm:ss")] })]
|
|
22688
|
-
})
|
|
22689
|
-
]
|
|
22886
|
+
function formatDuration$2(duration) {
|
|
22887
|
+
if (typeof duration !== "number" || !Number.isFinite(duration) || duration < 0) return void 0;
|
|
22888
|
+
const totalSeconds = Math.floor(duration / 1e3);
|
|
22889
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
22890
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
22891
|
+
const seconds = totalSeconds % 60;
|
|
22892
|
+
const pad = (value) => value.toString().padStart(2, "0");
|
|
22893
|
+
if (hours > 0) return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
22894
|
+
return `${pad(minutes)}:${pad(seconds)}`;
|
|
22895
|
+
}
|
|
22896
|
+
var DouyinAvatarUserInfo = (props) => {
|
|
22897
|
+
const { avater_url, username, create_time, useDarkTheme, dynamicTYPE } = props.data;
|
|
22898
|
+
const subscriberRole = props.data.cooperation_info?.subscriber_role;
|
|
22899
|
+
const publishTime = formatDistanceToNow(fromUnixTime(create_time), {
|
|
22900
|
+
addSuffix: true,
|
|
22901
|
+
locale: zhCN
|
|
22690
22902
|
});
|
|
22691
|
-
};
|
|
22692
|
-
/**
|
|
22693
|
-
* 用户信息组件
|
|
22694
|
-
*/
|
|
22695
|
-
var UserInfoSection = (props) => {
|
|
22696
22903
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22697
|
-
className: "flex
|
|
22904
|
+
className: "flex gap-10 items-center justify-between px-0 pb-0 pl-24 pr-10",
|
|
22698
22905
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22699
|
-
className: "flex gap-
|
|
22906
|
+
className: "flex gap-10 items-center",
|
|
22700
22907
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22701
|
-
className: "
|
|
22702
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
22703
|
-
|
|
22704
|
-
|
|
22705
|
-
|
|
22706
|
-
|
|
22707
|
-
|
|
22708
|
-
})
|
|
22908
|
+
className: "flex justify-center items-center bg-white rounded-full w-35 h-35",
|
|
22909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22910
|
+
src: avater_url,
|
|
22911
|
+
alt: "头像",
|
|
22912
|
+
className: "rounded-full w-33 h-33 shadow-large",
|
|
22913
|
+
referrerPolicy: "no-referrer",
|
|
22914
|
+
crossOrigin: "anonymous"
|
|
22709
22915
|
})
|
|
22710
22916
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22711
|
-
className: "flex flex-col gap-
|
|
22712
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.
|
|
22713
|
-
className: "text-
|
|
22714
|
-
children:
|
|
22917
|
+
className: "flex flex-col gap-8 text-7xl",
|
|
22918
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22919
|
+
className: "text-6xl font-bold select-text text-foreground",
|
|
22920
|
+
children: username
|
|
22715
22921
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22716
|
-
className: "flex gap-2 items-center text-4xl text-muted",
|
|
22922
|
+
className: "flex gap-2 items-center text-4xl font-normal whitespace-nowrap text-muted",
|
|
22717
22923
|
children: [
|
|
22718
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
22719
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
22924
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clock3, { size: 40 }),
|
|
22925
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22720
22926
|
className: "select-text",
|
|
22721
|
-
children:
|
|
22927
|
+
children: publishTime
|
|
22722
22928
|
}),
|
|
22723
|
-
|
|
22724
|
-
className: "ml-5 px-3 py-1 rounded-xl bg-surface-secondary text-3xl",
|
|
22725
|
-
children:
|
|
22929
|
+
subscriberRole && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22930
|
+
className: "ml-5 px-3 py-1 rounded-xl bg-surface-secondary text-3xl text-foreground",
|
|
22931
|
+
children: subscriberRole
|
|
22726
22932
|
})
|
|
22727
22933
|
]
|
|
22728
22934
|
})]
|
|
22729
22935
|
})]
|
|
22730
22936
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22731
|
-
className: "
|
|
22937
|
+
className: "shrink-0 flex flex-col items-end gap-2",
|
|
22938
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22939
|
+
src: useDarkTheme ? "/image/douyin/dylogo-light.svg" : "/image/douyin/dylogo-dark.svg",
|
|
22940
|
+
alt: "抖音",
|
|
22941
|
+
className: "h-20 w-auto object-contain"
|
|
22942
|
+
}), dynamicTYPE && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22943
|
+
className: "px-6 py-2 rounded-full bg-surface-secondary text-2xl font-medium text-muted select-text tracking-widest",
|
|
22944
|
+
children: dynamicTYPE
|
|
22945
|
+
})]
|
|
22946
|
+
})]
|
|
22947
|
+
});
|
|
22948
|
+
};
|
|
22949
|
+
var DouyinVideoCover = (props) => {
|
|
22950
|
+
const { image_url, music, duration } = props.data;
|
|
22951
|
+
const durationText = formatDuration$2(duration);
|
|
22952
|
+
const musicBadge = music && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22953
|
+
className: "absolute left-7 bottom-7 z-20 flex items-center gap-4 max-w-[72%] p-3 rounded-3xl bg-black/45 backdrop-blur-2xl border border-white/20 shadow-large overflow-hidden",
|
|
22954
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22955
|
+
className: "relative shrink-0 w-18 h-18",
|
|
22956
|
+
children: music.cover ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22957
|
+
src: music.cover,
|
|
22958
|
+
alt: "",
|
|
22959
|
+
className: "absolute inset-0 w-full h-full rounded-2xl object-cover blur-md scale-110 opacity-70",
|
|
22960
|
+
referrerPolicy: "no-referrer",
|
|
22961
|
+
crossOrigin: "anonymous"
|
|
22962
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22963
|
+
src: music.cover,
|
|
22964
|
+
alt: "BGM封面",
|
|
22965
|
+
className: "relative z-10 w-full h-full rounded-2xl object-cover",
|
|
22966
|
+
referrerPolicy: "no-referrer",
|
|
22967
|
+
crossOrigin: "anonymous"
|
|
22968
|
+
})] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22969
|
+
className: "flex items-center justify-center w-full h-full rounded-2xl bg-white/15 text-white",
|
|
22970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(e, {
|
|
22971
|
+
size: 36,
|
|
22972
|
+
weight: "fill"
|
|
22973
|
+
})
|
|
22974
|
+
})
|
|
22975
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22976
|
+
className: "flex flex-col gap-1 min-w-0 pr-2 text-white",
|
|
22977
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22978
|
+
className: "text-3xl font-semibold truncate select-text",
|
|
22979
|
+
children: music.title
|
|
22980
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22981
|
+
className: "text-2xl text-white/85 truncate select-text",
|
|
22982
|
+
children: music.author
|
|
22983
|
+
})]
|
|
22984
|
+
})]
|
|
22985
|
+
});
|
|
22986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22987
|
+
className: "px-20",
|
|
22988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22989
|
+
className: "relative overflow-hidden rounded-5xl shadow-large",
|
|
22732
22990
|
children: [
|
|
22733
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
22734
|
-
|
|
22735
|
-
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
size: 28,
|
|
22740
|
-
className: "text-like"
|
|
22741
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22742
|
-
className: "text-muted",
|
|
22743
|
-
children: "获赞"
|
|
22744
|
-
})]
|
|
22745
|
-
}),
|
|
22746
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full h-px bg-border" }),
|
|
22747
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22748
|
-
className: "select-text font-medium text-4xl",
|
|
22749
|
-
children: props.data.获赞
|
|
22750
|
-
})
|
|
22751
|
-
]
|
|
22991
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22992
|
+
src: image_url,
|
|
22993
|
+
alt: "视频封面",
|
|
22994
|
+
className: "object-contain w-full h-auto block",
|
|
22995
|
+
referrerPolicy: "no-referrer",
|
|
22996
|
+
crossOrigin: "anonymous"
|
|
22752
22997
|
}),
|
|
22753
22998
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22754
|
-
className: "
|
|
22755
|
-
children: [
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
|
|
22999
|
+
className: "absolute bottom-8 right-10 z-20 flex items-center justify-center text-white mix-blend-difference",
|
|
23000
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
23001
|
+
width: "0",
|
|
23002
|
+
height: "0",
|
|
23003
|
+
className: "absolute",
|
|
23004
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("filter", {
|
|
23005
|
+
id: "douyin-play-inner-blur",
|
|
23006
|
+
colorInterpolationFilters: "sRGB",
|
|
23007
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feGaussianBlur", {
|
|
23008
|
+
in: "SourceGraphic",
|
|
23009
|
+
stdDeviation: "30",
|
|
23010
|
+
result: "blur"
|
|
23011
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("feComposite", {
|
|
23012
|
+
in: "blur",
|
|
23013
|
+
in2: "SourceAlpha",
|
|
23014
|
+
operator: "in"
|
|
22764
23015
|
})]
|
|
22765
|
-
}),
|
|
22766
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full h-px bg-border" }),
|
|
22767
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22768
|
-
className: "select-text font-medium text-4xl",
|
|
22769
|
-
children: props.data.关注
|
|
22770
23016
|
})
|
|
22771
|
-
|
|
23017
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(a, {
|
|
23018
|
+
size: 150,
|
|
23019
|
+
weight: "fill",
|
|
23020
|
+
"aria-label": "播放",
|
|
23021
|
+
style: { filter: "url(#douyin-play-inner-blur)" }
|
|
23022
|
+
})]
|
|
22772
23023
|
}),
|
|
22773
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
22774
|
-
className: "
|
|
22775
|
-
children:
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22782
|
-
className: "text-muted",
|
|
22783
|
-
children: "粉丝"
|
|
22784
|
-
})]
|
|
22785
|
-
}),
|
|
22786
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full h-px bg-border" }),
|
|
22787
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
22788
|
-
className: "select-text font-medium text-4xl",
|
|
22789
|
-
children: props.data.粉丝
|
|
22790
|
-
})
|
|
22791
|
-
]
|
|
22792
|
-
})
|
|
23024
|
+
durationText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23025
|
+
className: "absolute top-7 left-7 z-20 px-5 py-2 rounded-2xl bg-black/50 backdrop-blur-sm",
|
|
23026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23027
|
+
className: "text-3xl font-medium text-white select-text",
|
|
23028
|
+
children: durationText
|
|
23029
|
+
})
|
|
23030
|
+
}),
|
|
23031
|
+
musicBadge
|
|
22793
23032
|
]
|
|
23033
|
+
})
|
|
23034
|
+
});
|
|
23035
|
+
};
|
|
23036
|
+
var DouyinDynamicContent = (props) => {
|
|
23037
|
+
const { title, desc } = props.data;
|
|
23038
|
+
const richTextOptions = {
|
|
23039
|
+
hashtag: { className: "text-[#04498d] dark:text-[#face15] font-medium" },
|
|
23040
|
+
mention: { className: "text-[#04498d] dark:text-[#face15] font-medium" }
|
|
23041
|
+
};
|
|
23042
|
+
const hasTitle = Boolean(title?.nodes.length);
|
|
23043
|
+
const hasDesc = desc.nodes.length > 0;
|
|
23044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23045
|
+
className: "flex flex-col px-20 w-full leading-relaxed",
|
|
23046
|
+
children: [hasTitle && title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23047
|
+
className: "text-[72px] leading-tight mb-8 text-foreground select-text",
|
|
23048
|
+
style: {
|
|
23049
|
+
wordBreak: "break-word",
|
|
23050
|
+
overflowWrap: "break-word"
|
|
23051
|
+
},
|
|
23052
|
+
children: renderRichTextToReact(title, richTextOptions)
|
|
23053
|
+
}), hasDesc && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23054
|
+
className: "text-[56px] tracking-[0.5px] leading-[1.7] whitespace-pre-wrap text-foreground select-text",
|
|
23055
|
+
style: {
|
|
23056
|
+
wordBreak: "break-word",
|
|
23057
|
+
overflowWrap: "break-word"
|
|
23058
|
+
},
|
|
23059
|
+
children: renderRichTextToReact(desc, richTextOptions)
|
|
22794
23060
|
})]
|
|
22795
23061
|
});
|
|
22796
23062
|
};
|
|
22797
|
-
|
|
22798
|
-
|
|
22799
|
-
*/
|
|
22800
|
-
|
|
22801
|
-
|
|
23063
|
+
var DouyinDynamicStatus = (props) => {
|
|
23064
|
+
const { dianzan, pinglun, shouchang, share, ip_location, suggest_word } = props.data;
|
|
23065
|
+
const renderTime = format(/* @__PURE__ */ new Date(), "yyyy-MM-dd HH:mm:ss");
|
|
23066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23067
|
+
className: "flex flex-col gap-10 px-18 w-full leading-relaxed",
|
|
23068
|
+
children: [
|
|
23069
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23070
|
+
className: "flex gap-6 items-center text-5xl tracking-normal select-text text-foreground/70",
|
|
23071
|
+
children: [
|
|
23072
|
+
{
|
|
23073
|
+
icon: o$3,
|
|
23074
|
+
value: dianzan,
|
|
23075
|
+
label: "点赞"
|
|
23076
|
+
},
|
|
23077
|
+
{
|
|
23078
|
+
icon: t,
|
|
23079
|
+
value: pinglun,
|
|
23080
|
+
label: "评论"
|
|
23081
|
+
},
|
|
23082
|
+
{
|
|
23083
|
+
icon: r,
|
|
23084
|
+
value: shouchang,
|
|
23085
|
+
label: "收藏"
|
|
23086
|
+
},
|
|
23087
|
+
{
|
|
23088
|
+
icon: e$1,
|
|
23089
|
+
value: share,
|
|
23090
|
+
label: "分享"
|
|
23091
|
+
}
|
|
23092
|
+
].map((stat, idx) => {
|
|
23093
|
+
const Icon = stat.icon;
|
|
23094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [idx > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "·" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23095
|
+
className: "flex gap-2 items-end",
|
|
23096
|
+
children: [
|
|
23097
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
23098
|
+
size: 50,
|
|
23099
|
+
weight: "fill",
|
|
23100
|
+
className: "mt-2"
|
|
23101
|
+
}),
|
|
23102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23103
|
+
className: "font-medium",
|
|
23104
|
+
children: stat.value
|
|
23105
|
+
}),
|
|
23106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23107
|
+
className: "text-3xl font-light",
|
|
23108
|
+
children: stat.label
|
|
23109
|
+
})
|
|
23110
|
+
]
|
|
23111
|
+
})] }, stat.label);
|
|
23112
|
+
})
|
|
23113
|
+
}),
|
|
23114
|
+
ip_location && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23115
|
+
className: "flex gap-12 items-center font-light select-text text-foreground/70",
|
|
23116
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23117
|
+
className: "flex gap-2 items-center",
|
|
23118
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(a$1, {
|
|
23119
|
+
size: 50,
|
|
23120
|
+
weight: "fill",
|
|
23121
|
+
className: "mt-1"
|
|
23122
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23123
|
+
className: "text-5xl font-medium",
|
|
23124
|
+
children: ip_location
|
|
23125
|
+
})]
|
|
23126
|
+
}), suggest_word && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23127
|
+
className: "flex gap-2 items-center py-3.5 px-6 bg-foreground/5 dark:bg-foreground/10 rounded-full text-4xl font-light select-text text-foreground/70",
|
|
23128
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23129
|
+
className: "text-muted",
|
|
23130
|
+
children: suggest_word.hint_text
|
|
23131
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23132
|
+
className: "text-[#04498d] dark:text-[#face15] font-medium",
|
|
23133
|
+
children: suggest_word.word
|
|
23134
|
+
})]
|
|
23135
|
+
})]
|
|
23136
|
+
}),
|
|
23137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23138
|
+
className: "flex gap-3 items-center text-4xl font-light tracking-normal select-text text-foreground/70",
|
|
23139
|
+
children: [
|
|
23140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Maximize, { size: 44 }),
|
|
23141
|
+
"图片生成于: ",
|
|
23142
|
+
renderTime
|
|
23143
|
+
]
|
|
23144
|
+
})
|
|
23145
|
+
]
|
|
23146
|
+
});
|
|
23147
|
+
};
|
|
23148
|
+
var DouyinCoCreatorList = (props) => {
|
|
23149
|
+
const subscriberNickname = props.data.username;
|
|
23150
|
+
const creators = (props.data.cooperation_info?.co_creators ?? []).filter((c) => c.nickname !== subscriberNickname);
|
|
22802
23151
|
if (creators.length === 0) return null;
|
|
22803
23152
|
const items = creators.slice(0, 50);
|
|
22804
23153
|
const listRef = import_react.useRef(null);
|
|
@@ -22816,35 +23165,33 @@ var CoCreatorsInfo = ({ info, subscriberNickname }) => {
|
|
|
22816
23165
|
return () => window.removeEventListener("resize", calc);
|
|
22817
23166
|
}, [items.length]);
|
|
22818
23167
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22819
|
-
className: "flex flex-col
|
|
23168
|
+
className: "flex flex-col px-20 w-full",
|
|
22820
23169
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22821
23170
|
ref: listRef,
|
|
22822
23171
|
className: "flex overflow-hidden gap-8 py-1 pr-2 w-full",
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
className: "object-cover w-28 h-auto rounded-full"
|
|
22835
|
-
})
|
|
22836
|
-
}),
|
|
22837
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22838
|
-
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground",
|
|
22839
|
-
children: c.nickname || "未提供"
|
|
22840
|
-
}),
|
|
22841
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22842
|
-
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-foreground/70",
|
|
22843
|
-
children: c.role_title || "未提供"
|
|
23172
|
+
children: [items.slice(0, visibleCount).map((c, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23173
|
+
className: "flex flex-col items-center min-w-38 w-38 shrink-0",
|
|
23174
|
+
children: [
|
|
23175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23176
|
+
className: "flex justify-center items-center bg-white rounded-full w-30 h-30",
|
|
23177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
23178
|
+
src: c.avatar_url,
|
|
23179
|
+
alt: "共创者头像",
|
|
23180
|
+
className: "object-cover w-28 h-28 rounded-full",
|
|
23181
|
+
referrerPolicy: "no-referrer",
|
|
23182
|
+
crossOrigin: "anonymous"
|
|
22844
23183
|
})
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
23184
|
+
}),
|
|
23185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23186
|
+
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground",
|
|
23187
|
+
children: c.nickname || "未提供"
|
|
23188
|
+
}),
|
|
23189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23190
|
+
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-muted",
|
|
23191
|
+
children: c.role_title || "未提供"
|
|
23192
|
+
})
|
|
23193
|
+
]
|
|
23194
|
+
}, `${c.nickname || "creator"}-${idx}`)), items.length > visibleCount && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22848
23195
|
className: "flex flex-col items-center min-w-38 w-38 shrink-0",
|
|
22849
23196
|
children: [
|
|
22850
23197
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -22855,7 +23202,7 @@ var CoCreatorsInfo = ({ info, subscriberNickname }) => {
|
|
|
22855
23202
|
})
|
|
22856
23203
|
}),
|
|
22857
23204
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22858
|
-
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground
|
|
23205
|
+
className: "overflow-hidden mt-6 w-full text-3xl font-medium leading-tight text-center truncate whitespace-nowrap select-text text-foreground",
|
|
22859
23206
|
children: [
|
|
22860
23207
|
"还有",
|
|
22861
23208
|
items.length - visibleCount,
|
|
@@ -22863,7 +23210,7 @@ var CoCreatorsInfo = ({ info, subscriberNickname }) => {
|
|
|
22863
23210
|
]
|
|
22864
23211
|
}),
|
|
22865
23212
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
22866
|
-
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-
|
|
23213
|
+
className: "overflow-hidden mt-2 w-full text-3xl leading-tight text-center truncate whitespace-nowrap select-text text-muted",
|
|
22867
23214
|
children: "共创"
|
|
22868
23215
|
})
|
|
22869
23216
|
]
|
|
@@ -22871,53 +23218,134 @@ var CoCreatorsInfo = ({ info, subscriberNickname }) => {
|
|
|
22871
23218
|
})
|
|
22872
23219
|
});
|
|
22873
23220
|
};
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
*/
|
|
22877
|
-
|
|
23221
|
+
var DouyinDynamicFooter = (props) => {
|
|
23222
|
+
const { avater_url, username, 抖音号, 获赞, 关注, 粉丝, share_url, useDarkTheme } = props.data;
|
|
23223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23224
|
+
className: "flex justify-between items-start px-20 pb-20",
|
|
23225
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23226
|
+
className: "flex flex-col gap-12",
|
|
23227
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23228
|
+
className: "flex gap-12 items-start",
|
|
23229
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23230
|
+
className: "relative shrink-0",
|
|
23231
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23232
|
+
className: "flex justify-center items-center bg-white rounded-full w-35 h-35",
|
|
23233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
23234
|
+
src: avater_url,
|
|
23235
|
+
alt: "头像",
|
|
23236
|
+
className: "rounded-full w-33 h-33 shadow-large",
|
|
23237
|
+
referrerPolicy: "no-referrer",
|
|
23238
|
+
crossOrigin: "anonymous"
|
|
23239
|
+
})
|
|
23240
|
+
})
|
|
23241
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23242
|
+
className: "flex flex-col gap-5",
|
|
23243
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23244
|
+
className: "text-7xl font-bold select-text text-foreground",
|
|
23245
|
+
children: username
|
|
23246
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23247
|
+
className: "flex gap-2 items-center text-4xl text-muted",
|
|
23248
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Hash, { size: 32 }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
23249
|
+
className: "select-text",
|
|
23250
|
+
children: ["抖音号: ", 抖音号]
|
|
23251
|
+
})]
|
|
23252
|
+
})]
|
|
23253
|
+
})]
|
|
23254
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23255
|
+
className: "text-3xl flex gap-6 items-center text-foreground/70",
|
|
23256
|
+
children: [
|
|
23257
|
+
{
|
|
23258
|
+
icon: o$3,
|
|
23259
|
+
iconSize: 36,
|
|
23260
|
+
label: "获赞",
|
|
23261
|
+
value: 获赞
|
|
23262
|
+
},
|
|
23263
|
+
{
|
|
23264
|
+
icon: o$4,
|
|
23265
|
+
iconSize: 36,
|
|
23266
|
+
label: "关注",
|
|
23267
|
+
value: 关注
|
|
23268
|
+
},
|
|
23269
|
+
{
|
|
23270
|
+
icon: r$1,
|
|
23271
|
+
iconSize: 36,
|
|
23272
|
+
label: "粉丝",
|
|
23273
|
+
value: 粉丝
|
|
23274
|
+
}
|
|
23275
|
+
].map((stat) => {
|
|
23276
|
+
const Icon = stat.icon;
|
|
23277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23278
|
+
className: "flex flex-col gap-1 items-start px-6 py-3 rounded-2xl bg-surface",
|
|
23279
|
+
children: [
|
|
23280
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23281
|
+
className: "flex gap-1 items-center",
|
|
23282
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
23283
|
+
size: stat.iconSize,
|
|
23284
|
+
weight: "fill"
|
|
23285
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23286
|
+
className: "text-muted",
|
|
23287
|
+
children: stat.label
|
|
23288
|
+
})]
|
|
23289
|
+
}),
|
|
23290
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full h-px bg-border" }),
|
|
23291
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23292
|
+
className: "select-text font-medium text-4xl",
|
|
23293
|
+
children: stat.value
|
|
23294
|
+
})
|
|
23295
|
+
]
|
|
23296
|
+
}, stat.label);
|
|
23297
|
+
})
|
|
23298
|
+
})]
|
|
23299
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23300
|
+
className: "flex flex-col items-center gap-4",
|
|
23301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
23302
|
+
src: generateQRCode(share_url, useDarkTheme),
|
|
23303
|
+
alt: "二维码",
|
|
23304
|
+
className: "h-auto w-75 rounded-2xl"
|
|
23305
|
+
})
|
|
23306
|
+
})]
|
|
23307
|
+
});
|
|
23308
|
+
};
|
|
23309
|
+
var DouyinVideoWork = import_react.memo((props) => {
|
|
22878
23310
|
const coCreatorCount = props.data.cooperation_info?.co_creator_nums ?? props.data.cooperation_info?.co_creators?.length ?? void 0;
|
|
23311
|
+
const hasCoCreators = !!coCreatorCount && coCreatorCount > 0;
|
|
22879
23312
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultLayout, {
|
|
22880
23313
|
...props,
|
|
22881
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
|
|
22885
|
-
|
|
22886
|
-
|
|
22887
|
-
|
|
22888
|
-
|
|
22889
|
-
|
|
22890
|
-
|
|
22891
|
-
|
|
22892
|
-
|
|
22893
|
-
|
|
22894
|
-
|
|
23314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23315
|
+
className: "p-4",
|
|
23316
|
+
children: [
|
|
23317
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-25" }),
|
|
23318
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinAvatarUserInfo, { ...props }),
|
|
23319
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
23320
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinDynamicContent, { ...props }),
|
|
23321
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
23322
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinVideoCover, { ...props }),
|
|
23323
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
|
|
23324
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinDynamicStatus, { ...props }),
|
|
23325
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn$1(hasCoCreators && "h-23", !hasCoCreators && "h-40") }),
|
|
23326
|
+
hasCoCreators && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
23327
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23328
|
+
className: "px-20 pb-8",
|
|
22895
23329
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22896
23330
|
className: "gap-2 inline-flex items-center rounded-2xl bg-surface text-foreground/80 px-6 py-3",
|
|
22897
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
22898
|
-
|
|
23331
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(o, {
|
|
23332
|
+
size: 26,
|
|
23333
|
+
weight: "fill"
|
|
23334
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
23335
|
+
className: "text-3xl font-medium leading-none select-text",
|
|
22899
23336
|
children: [coCreatorCount, "人共创"]
|
|
22900
23337
|
})]
|
|
22901
23338
|
})
|
|
22902
|
-
}),
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
className: "flex flex-col items-center gap-4",
|
|
22910
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22911
|
-
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
22912
|
-
alt: "二维码",
|
|
22913
|
-
className: "h-auto w-75 rounded-xl"
|
|
22914
|
-
})
|
|
22915
|
-
})]
|
|
22916
|
-
})]
|
|
22917
|
-
})
|
|
22918
|
-
] })
|
|
23339
|
+
}),
|
|
23340
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinCoCreatorList, { ...props }),
|
|
23341
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" })
|
|
23342
|
+
] }),
|
|
23343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DouyinDynamicFooter, { ...props })
|
|
23344
|
+
]
|
|
23345
|
+
})
|
|
22919
23346
|
});
|
|
22920
|
-
};
|
|
23347
|
+
});
|
|
23348
|
+
DouyinVideoWork.displayName = "DouyinVideoWork";
|
|
22921
23349
|
//#endregion
|
|
22922
23350
|
//#region ../template/src/components/platforms/kuaishou/Comment.tsx
|
|
22923
23351
|
var kuaishouMentionClassName = "text-[#03488d] dark:text-[#c7daef]";
|
|
@@ -27323,7 +27751,7 @@ var VersionWarning = (props) => {
|
|
|
27323
27751
|
})
|
|
27324
27752
|
}),
|
|
27325
27753
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Puzzle, {
|
|
27326
|
-
className: cn("w-10 h-auto"),
|
|
27754
|
+
className: cn$1("w-10 h-auto"),
|
|
27327
27755
|
style: { color: mutedColor }
|
|
27328
27756
|
}),
|
|
27329
27757
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
@@ -34679,6 +35107,7 @@ var wrapWithErrorHandler = (fn, options) => {
|
|
|
34679
35107
|
return async (e, next) => {
|
|
34680
35108
|
const rawEvent = e;
|
|
34681
35109
|
const normalizedEvent = await injectBotToEventForPushTask(rawEvent, options.businessName);
|
|
35110
|
+
const normalizedNext = next ?? (() => void 0);
|
|
34682
35111
|
const emojiManager = Boolean(rawEvent) && !isPushTask(rawEvent, options.businessName) ? new EmojiReactionManager(rawEvent) : void 0;
|
|
34683
35112
|
let processingTimer = null;
|
|
34684
35113
|
let successTimer = null;
|
|
@@ -34688,7 +35117,7 @@ var wrapWithErrorHandler = (fn, options) => {
|
|
|
34688
35117
|
emojiManager.add("PROCESSING").catch(() => {});
|
|
34689
35118
|
}, 1500);
|
|
34690
35119
|
}
|
|
34691
|
-
const ctx = logger.runContext(async () => fn(normalizedEvent,
|
|
35120
|
+
const ctx = logger.runContext(async () => fn(normalizedEvent, normalizedNext));
|
|
34692
35121
|
try {
|
|
34693
35122
|
const result = await ctx.run();
|
|
34694
35123
|
if (emojiManager) successTimer = setTimeout(() => {
|
|
@@ -34889,6 +35318,30 @@ async function getBiliFrameRate(path) {
|
|
|
34889
35318
|
} catch {}
|
|
34890
35319
|
return 30;
|
|
34891
35320
|
}
|
|
35321
|
+
/**
|
|
35322
|
+
* 统计用于视频信息封面展示的弹幕(相同内容聚合)
|
|
35323
|
+
* @param danmakuList 弹幕列表
|
|
35324
|
+
* @param topN 返回的条数,默认 5
|
|
35325
|
+
* @returns 重复弹幕优先,不足时用真实弹幕按出现顺序补齐
|
|
35326
|
+
*/
|
|
35327
|
+
function getHotDanmaku(danmakuList, topN = 5) {
|
|
35328
|
+
const counter = /* @__PURE__ */ new Map();
|
|
35329
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
35330
|
+
const sortedDanmaku = [...danmakuList].sort((a, b) => a.progress - b.progress);
|
|
35331
|
+
for (const dm of sortedDanmaku) {
|
|
35332
|
+
const content = dm.content?.trim();
|
|
35333
|
+
if (!content) continue;
|
|
35334
|
+
if (!firstSeen.has(content)) firstSeen.set(content, dm.progress);
|
|
35335
|
+
counter.set(content, (counter.get(content) ?? 0) + 1);
|
|
35336
|
+
}
|
|
35337
|
+
return [...counter.entries()].map(([content, count]) => ({
|
|
35338
|
+
content,
|
|
35339
|
+
count
|
|
35340
|
+
})).sort((a, b) => {
|
|
35341
|
+
if (b.count !== a.count) return b.count - a.count;
|
|
35342
|
+
return (firstSeen.get(a.content) ?? 0) - (firstSeen.get(b.content) ?? 0);
|
|
35343
|
+
}).slice(0, topN);
|
|
35344
|
+
}
|
|
34892
35345
|
/** 字号配置映射 */
|
|
34893
35346
|
var FONT_SIZE_MAP$1 = {
|
|
34894
35347
|
small: {
|
|
@@ -35658,6 +36111,9 @@ var Bilibili = class extends Base {
|
|
|
35658
36111
|
host_mid: infoData.data.data.owner.mid,
|
|
35659
36112
|
typeMode: "strict"
|
|
35660
36113
|
});
|
|
36114
|
+
const danmakuCid = iddata.p ? infoData.data.data.pages[iddata.p - 1]?.cid ?? infoData.data.data.cid : infoData.data.data.cid;
|
|
36115
|
+
const danmakuDuration = iddata.p ? infoData.data.data.pages[iddata.p - 1]?.duration ?? infoData.data.data.duration : infoData.data.data.duration;
|
|
36116
|
+
const hotDanmaku = getHotDanmaku(await this.fetchVideoDanmakuList(danmakuCid, danmakuDuration), 20);
|
|
35661
36117
|
const img = await Render(this.e, "bilibili/videoInfo", {
|
|
35662
36118
|
share_url: "https://b23.tv/" + infoData.data.data.bvid,
|
|
35663
36119
|
title: infoData.data.data.title,
|
|
@@ -35666,6 +36122,7 @@ var Bilibili = class extends Base {
|
|
|
35666
36122
|
bvid: infoData.data.data.bvid,
|
|
35667
36123
|
ctime: infoData.data.data.ctime,
|
|
35668
36124
|
pic: infoData.data.data.pic,
|
|
36125
|
+
hotDanmaku,
|
|
35669
36126
|
owner: {
|
|
35670
36127
|
...infoData.data.data.owner,
|
|
35671
36128
|
usernameMeta: getUsernameMetadata(userProfileData.data.data.card),
|
|
@@ -35741,20 +36198,10 @@ var Bilibili = class extends Base {
|
|
|
35741
36198
|
else {
|
|
35742
36199
|
if (Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64) this.islogin = false;
|
|
35743
36200
|
let danmakuList = [];
|
|
35744
|
-
if (this.forceBurnDanmaku || Config.bilibili.burnDanmaku)
|
|
36201
|
+
if (this.forceBurnDanmaku || Config.bilibili.burnDanmaku) {
|
|
35745
36202
|
const cid = iddata.p ? infoData.data.data.pages[iddata.p - 1]?.cid ?? infoData.data.data.cid : infoData.data.data.cid;
|
|
35746
36203
|
const duration = iddata.p ? infoData.data.data.pages[iddata.p - 1]?.duration ?? infoData.data.data.duration : infoData.data.data.duration;
|
|
35747
|
-
|
|
35748
|
-
logger.debug(`视频时长: ${duration}秒, 需要获取 ${segmentCount} 个弹幕分段`);
|
|
35749
|
-
const danmakuPromises = Array.from({ length: segmentCount }, (_, i) => this.amagi.bilibili.fetcher.fetchVideoDanmaku({
|
|
35750
|
-
cid,
|
|
35751
|
-
segment_index: i + 1,
|
|
35752
|
-
typeMode: "strict"
|
|
35753
|
-
}).then((res) => res.data?.data?.elems || []).catch(() => []));
|
|
35754
|
-
danmakuList = (await Promise.all(danmakuPromises)).flat();
|
|
35755
|
-
logger.debug(`获取到 ${danmakuList.length} 条弹幕(${segmentCount} 个分段)`);
|
|
35756
|
-
} catch (err) {
|
|
35757
|
-
logger.warn("获取弹幕失败,将不烧录弹幕", err);
|
|
36204
|
+
danmakuList = await this.fetchVideoDanmakuList(cid, duration);
|
|
35758
36205
|
}
|
|
35759
36206
|
await this.getvideo(Config.bilibili.videoQuality !== 0 && Config.bilibili.videoQuality < 64 ? {
|
|
35760
36207
|
playUrlData: nockData.data,
|
|
@@ -36422,6 +36869,29 @@ var Bilibili = class extends Base {
|
|
|
36422
36869
|
default: break;
|
|
36423
36870
|
}
|
|
36424
36871
|
}
|
|
36872
|
+
/**
|
|
36873
|
+
* 获取视频弹幕列表(按每 6 分钟一段并行拉取所有分段)
|
|
36874
|
+
* @param cid 视频分P的 cid
|
|
36875
|
+
* @param duration 视频时长(秒)
|
|
36876
|
+
* @returns 合并后的弹幕列表
|
|
36877
|
+
*/
|
|
36878
|
+
async fetchVideoDanmakuList(cid, duration) {
|
|
36879
|
+
try {
|
|
36880
|
+
const segmentCount = Math.ceil(duration / 360);
|
|
36881
|
+
logger.debug(`视频时长: ${duration}秒, 需要获取 ${segmentCount} 个弹幕分段`);
|
|
36882
|
+
const danmakuPromises = Array.from({ length: segmentCount }, (_, i) => this.amagi.bilibili.fetcher.fetchVideoDanmaku({
|
|
36883
|
+
cid,
|
|
36884
|
+
segment_index: i + 1,
|
|
36885
|
+
typeMode: "strict"
|
|
36886
|
+
}).then((res) => res.data?.data?.elems || []).catch(() => []));
|
|
36887
|
+
const danmakuList = (await Promise.all(danmakuPromises)).flat();
|
|
36888
|
+
logger.debug(`获取到 ${danmakuList.length} 条弹幕(${segmentCount} 个分段)`);
|
|
36889
|
+
return danmakuList;
|
|
36890
|
+
} catch (err) {
|
|
36891
|
+
logger.warn("获取弹幕失败", err);
|
|
36892
|
+
return [];
|
|
36893
|
+
}
|
|
36894
|
+
}
|
|
36425
36895
|
async getvideo({ infoData, playUrlData, danmakuList = [] }) {
|
|
36426
36896
|
/** 获取视频 => FFmpeg合成 */
|
|
36427
36897
|
logger.debug("是否登录:", this.islogin);
|
|
@@ -38493,7 +38963,7 @@ var extractSearchTokens = (textExtra, text) => {
|
|
|
38493
38963
|
* 抖音评论正文里通常只保留 `@昵称` 文本,稳定用户 ID 在 `text_extra` 里。
|
|
38494
38964
|
* 这里先把 ID 转成 `@昵称 + userId`,后续解析时才能把普通文本切成 mention 节点。
|
|
38495
38965
|
*/
|
|
38496
|
-
var resolveMentionTokens = async (userIds) => {
|
|
38966
|
+
var resolveMentionTokens$1 = async (userIds) => {
|
|
38497
38967
|
if (!userIds || userIds.length === 0) return [];
|
|
38498
38968
|
const uniqueUserIds = [...new Set(userIds)];
|
|
38499
38969
|
return (await Promise.all(uniqueUserIds.map(async (secUid) => {
|
|
@@ -38523,7 +38993,7 @@ var resolveMentionTokens = async (userIds) => {
|
|
|
38523
38993
|
* - @ 用户转成 mention 节点,template 侧只负责套样式。
|
|
38524
38994
|
*/
|
|
38525
38995
|
var buildDouyinRichText = async (text, emojiData, mentionUserIds, searchTokens = []) => {
|
|
38526
|
-
const mentionTokens = await resolveMentionTokens(mentionUserIds);
|
|
38996
|
+
const mentionTokens = await resolveMentionTokens$1(mentionUserIds);
|
|
38527
38997
|
const emojiTokens = emojiData.filter((item) => Boolean(item?.name) && Boolean(item?.url)).sort((a, b) => b.name.length - a.name.length);
|
|
38528
38998
|
const nodes = [];
|
|
38529
38999
|
let buffer = "";
|
|
@@ -40204,168 +40674,665 @@ async function processFavoriteList(contentList, sec_uid, userinfo, item, targets
|
|
|
40204
40674
|
return result;
|
|
40205
40675
|
}
|
|
40206
40676
|
//#endregion
|
|
40207
|
-
//#region src/platform/douyin/push/live.ts
|
|
40677
|
+
//#region src/platform/douyin/push/live.ts
|
|
40678
|
+
/**
|
|
40679
|
+
* 处理直播推送
|
|
40680
|
+
* 检测用户是否开播,如果开播则推送
|
|
40681
|
+
* @returns 返回需要推送的直播项(如果有)
|
|
40682
|
+
*/
|
|
40683
|
+
async function processLiveStream(sec_uid, userinfo, item, targets, amagi) {
|
|
40684
|
+
const pushType = "live";
|
|
40685
|
+
const liveStatus = await douyinDBInstance.getLiveStatus(sec_uid);
|
|
40686
|
+
if (userinfo.data.user.live_status === 1) {
|
|
40687
|
+
const UserInfoData = await amagi.douyin.fetcher.fetchUserProfile({
|
|
40688
|
+
sec_uid: userinfo.data.user.sec_uid,
|
|
40689
|
+
typeMode: "strict"
|
|
40690
|
+
});
|
|
40691
|
+
if (!UserInfoData.data.user?.live_status || UserInfoData.data.user.live_status !== 1) {
|
|
40692
|
+
logger.error((UserInfoData?.data?.user?.nickname ?? "用户") + "当前未在直播");
|
|
40693
|
+
return null;
|
|
40694
|
+
}
|
|
40695
|
+
if (!UserInfoData.data.user.room_data) {
|
|
40696
|
+
logger.error("未获取到直播间信息!");
|
|
40697
|
+
return null;
|
|
40698
|
+
}
|
|
40699
|
+
const room_data = JSON.parse(UserInfoData.data.user.room_data);
|
|
40700
|
+
const liveInfo = await amagi.douyin.fetcher.fetchLiveRoomInfo({
|
|
40701
|
+
room_id: UserInfoData.data.user.room_id_str,
|
|
40702
|
+
web_rid: room_data.owner.web_rid,
|
|
40703
|
+
typeMode: "strict"
|
|
40704
|
+
});
|
|
40705
|
+
if (!liveStatus.living) {
|
|
40706
|
+
logger.info(`用户 ${item.remark ?? sec_uid} 开播了`);
|
|
40707
|
+
return {
|
|
40708
|
+
remark: item.remark,
|
|
40709
|
+
sec_uid,
|
|
40710
|
+
create_time: Date.now(),
|
|
40711
|
+
targets,
|
|
40712
|
+
pushType,
|
|
40713
|
+
Detail_Data: {
|
|
40714
|
+
user_info: userinfo,
|
|
40715
|
+
room_data: JSON.parse(userinfo.data.user.room_data),
|
|
40716
|
+
live_data: liveInfo,
|
|
40717
|
+
liveStatus: {
|
|
40718
|
+
liveStatus: "open",
|
|
40719
|
+
isChanged: true,
|
|
40720
|
+
isliving: true
|
|
40721
|
+
}
|
|
40722
|
+
},
|
|
40723
|
+
avatar_img: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + userinfo.data.user.avatar_larger.uri,
|
|
40724
|
+
living: true
|
|
40725
|
+
};
|
|
40726
|
+
}
|
|
40727
|
+
} else if (liveStatus.living) {
|
|
40728
|
+
await douyinDBInstance.updateLiveStatus(sec_uid, false);
|
|
40729
|
+
logger.info(`用户 ${item.remark ?? sec_uid} 已关播,更新直播状态`);
|
|
40730
|
+
}
|
|
40731
|
+
return null;
|
|
40732
|
+
}
|
|
40733
|
+
//#endregion
|
|
40734
|
+
//#region src/platform/douyin/push/post.ts
|
|
40735
|
+
/**
|
|
40736
|
+
* 处理作品列表推送
|
|
40737
|
+
* 按照作品发布时间进行过滤,只推送24小时内的作品
|
|
40738
|
+
* @returns 返回需要推送的作品项数组
|
|
40739
|
+
*/
|
|
40740
|
+
async function processPostList(contentList, sec_uid, userinfo, item, targets) {
|
|
40741
|
+
const pushType = "post";
|
|
40742
|
+
const listName = "作品列表";
|
|
40743
|
+
const result = [];
|
|
40744
|
+
for (const aweme of contentList) {
|
|
40745
|
+
const nowSeconds = Math.floor(Date.now() / 1e3);
|
|
40746
|
+
const createTime = aweme.create_time;
|
|
40747
|
+
const timeDifference = nowSeconds - createTime;
|
|
40748
|
+
const is_top = aweme.is_top === 1;
|
|
40749
|
+
const timeDiffHours = Math.round(timeDifference / 3600 * 100) / 100;
|
|
40750
|
+
logger.trace(`
|
|
40751
|
+
前期获取该作品基本信息:
|
|
40752
|
+
推送类型:${pushType}(${listName})
|
|
40753
|
+
作者:${aweme.author.nickname}
|
|
40754
|
+
作品ID:${aweme.aweme_id}
|
|
40755
|
+
发布时间:${format(fromUnixTime(aweme.create_time), "yyyy-MM-dd HH:mm")}
|
|
40756
|
+
发布时间戳(s):${createTime}
|
|
40757
|
+
当前时间戳(s):${nowSeconds}
|
|
40758
|
+
时间差(s):${timeDifference}s (${timeDiffHours}h)
|
|
40759
|
+
是否置顶:${is_top}
|
|
40760
|
+
是否在一天内:${timeDifference < 86400 ? logger.green("true") : logger.red("false")}
|
|
40761
|
+
`);
|
|
40762
|
+
if (is_top && timeDifference < 86400 || timeDifference < 86400 && !is_top) {
|
|
40763
|
+
const validTargets = [];
|
|
40764
|
+
for (const target of targets) if (!await douyinDBInstance.isAwemePushed(aweme.aweme_id, sec_uid, target.groupId, pushType)) validTargets.push(target);
|
|
40765
|
+
if (validTargets.length > 0) result.push({
|
|
40766
|
+
remark: item.remark,
|
|
40767
|
+
sec_uid,
|
|
40768
|
+
create_time: aweme.create_time,
|
|
40769
|
+
targets: validTargets,
|
|
40770
|
+
pushType,
|
|
40771
|
+
Detail_Data: {
|
|
40772
|
+
...aweme,
|
|
40773
|
+
user_info: userinfo
|
|
40774
|
+
},
|
|
40775
|
+
avatar_img: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + userinfo.data.user.avatar_larger.uri,
|
|
40776
|
+
living: false
|
|
40777
|
+
});
|
|
40778
|
+
}
|
|
40779
|
+
}
|
|
40780
|
+
return result;
|
|
40781
|
+
}
|
|
40782
|
+
//#endregion
|
|
40783
|
+
//#region src/platform/douyin/push/recommend.ts
|
|
40784
|
+
/**
|
|
40785
|
+
* 处理推荐列表推送
|
|
40786
|
+
* 通过对比aweme_id判断是否有新增的推荐作品
|
|
40787
|
+
* @returns 返回需要推送的作品项数组
|
|
40788
|
+
*/
|
|
40789
|
+
async function processRecommendList(contentList, sec_uid, userinfo, item, targets, force = false) {
|
|
40790
|
+
const pushType = "recommend";
|
|
40791
|
+
const listName = "推荐列表";
|
|
40792
|
+
const result = [];
|
|
40793
|
+
const groupHistoryStatus = /* @__PURE__ */ new Map();
|
|
40794
|
+
for (const target of targets) {
|
|
40795
|
+
const hasHistory = await douyinDBInstance.hasHistory(sec_uid, target.groupId, pushType);
|
|
40796
|
+
groupHistoryStatus.set(target.groupId, hasHistory);
|
|
40797
|
+
}
|
|
40798
|
+
for (const [index, aweme] of contentList.entries()) {
|
|
40799
|
+
const validTargets = [];
|
|
40800
|
+
for (const target of targets) if (!await douyinDBInstance.isAwemePushed(aweme.aweme_id, sec_uid, target.groupId, pushType)) {
|
|
40801
|
+
const hasHistory = groupHistoryStatus.get(target.groupId);
|
|
40802
|
+
if (force || hasHistory || index === 0) validTargets.push(target);
|
|
40803
|
+
else {
|
|
40804
|
+
await douyinDBInstance.addAwemeCache(aweme.aweme_id, sec_uid, target.groupId, pushType);
|
|
40805
|
+
logger.debug(`新订阅群组 ${target.groupId} 跳过旧作品 ${aweme.aweme_id} 并已标记为已读`);
|
|
40806
|
+
}
|
|
40807
|
+
}
|
|
40808
|
+
if (validTargets.length === 0) continue;
|
|
40809
|
+
let authorUserInfo;
|
|
40810
|
+
try {
|
|
40811
|
+
if (aweme.author?.sec_uid) {
|
|
40812
|
+
authorUserInfo = await douyinFetcher.fetchUserProfile({
|
|
40813
|
+
sec_uid: aweme.author.sec_uid,
|
|
40814
|
+
typeMode: "strict"
|
|
40815
|
+
});
|
|
40816
|
+
logger.debug(`获取作品作者 ${aweme.author.nickname} 的用户信息成功`);
|
|
40817
|
+
}
|
|
40818
|
+
} catch (error) {
|
|
40819
|
+
logger.warn(`获取作品作者用户信息失败: ${error}`);
|
|
40820
|
+
}
|
|
40821
|
+
result.push({
|
|
40822
|
+
remark: item.remark,
|
|
40823
|
+
sec_uid,
|
|
40824
|
+
create_time: aweme.create_time,
|
|
40825
|
+
targets: validTargets,
|
|
40826
|
+
pushType,
|
|
40827
|
+
Detail_Data: {
|
|
40828
|
+
...aweme,
|
|
40829
|
+
user_info: userinfo,
|
|
40830
|
+
author_user_info: authorUserInfo
|
|
40831
|
+
},
|
|
40832
|
+
avatar_img: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + userinfo.data.user.avatar_larger.uri,
|
|
40833
|
+
living: false
|
|
40834
|
+
});
|
|
40835
|
+
logger.debug(`发现新${listName}作品:${aweme.aweme_id}`);
|
|
40836
|
+
}
|
|
40837
|
+
await douyinDBInstance.updateListSnapshot(sec_uid, pushType, contentList.map((a) => a.aweme_id));
|
|
40838
|
+
return result;
|
|
40839
|
+
}
|
|
40840
|
+
//#endregion
|
|
40841
|
+
//#region src/platform/douyin/push/render.ts
|
|
40208
40842
|
/**
|
|
40209
|
-
*
|
|
40210
|
-
*
|
|
40211
|
-
* @returns
|
|
40843
|
+
* 处理作品描述
|
|
40844
|
+
* @param Desc - 作品原始描述文本
|
|
40845
|
+
* @returns 如果描述为空则返回默认提示,否则返回原文
|
|
40212
40846
|
*/
|
|
40213
|
-
|
|
40214
|
-
|
|
40215
|
-
const liveStatus = await douyinDBInstance.getLiveStatus(sec_uid);
|
|
40216
|
-
if (userinfo.data.user.live_status === 1) {
|
|
40217
|
-
const UserInfoData = await amagi.douyin.fetcher.fetchUserProfile({
|
|
40218
|
-
sec_uid: userinfo.data.user.sec_uid,
|
|
40219
|
-
typeMode: "strict"
|
|
40220
|
-
});
|
|
40221
|
-
if (!UserInfoData.data.user?.live_status || UserInfoData.data.user.live_status !== 1) {
|
|
40222
|
-
logger.error((UserInfoData?.data?.user?.nickname ?? "用户") + "当前未在直播");
|
|
40223
|
-
return null;
|
|
40224
|
-
}
|
|
40225
|
-
if (!UserInfoData.data.user.room_data) {
|
|
40226
|
-
logger.error("未获取到直播间信息!");
|
|
40227
|
-
return null;
|
|
40228
|
-
}
|
|
40229
|
-
const room_data = JSON.parse(UserInfoData.data.user.room_data);
|
|
40230
|
-
const liveInfo = await amagi.douyin.fetcher.fetchLiveRoomInfo({
|
|
40231
|
-
room_id: UserInfoData.data.user.room_id_str,
|
|
40232
|
-
web_rid: room_data.owner.web_rid,
|
|
40233
|
-
typeMode: "strict"
|
|
40234
|
-
});
|
|
40235
|
-
if (!liveStatus.living) {
|
|
40236
|
-
logger.info(`用户 ${item.remark ?? sec_uid} 开播了`);
|
|
40237
|
-
return {
|
|
40238
|
-
remark: item.remark,
|
|
40239
|
-
sec_uid,
|
|
40240
|
-
create_time: Date.now(),
|
|
40241
|
-
targets,
|
|
40242
|
-
pushType,
|
|
40243
|
-
Detail_Data: {
|
|
40244
|
-
user_info: userinfo,
|
|
40245
|
-
room_data: JSON.parse(userinfo.data.user.room_data),
|
|
40246
|
-
live_data: liveInfo,
|
|
40247
|
-
liveStatus: {
|
|
40248
|
-
liveStatus: "open",
|
|
40249
|
-
isChanged: true,
|
|
40250
|
-
isliving: true
|
|
40251
|
-
}
|
|
40252
|
-
},
|
|
40253
|
-
avatar_img: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + userinfo.data.user.avatar_larger.uri,
|
|
40254
|
-
living: true
|
|
40255
|
-
};
|
|
40256
|
-
}
|
|
40257
|
-
} else if (liveStatus.living) {
|
|
40258
|
-
await douyinDBInstance.updateLiveStatus(sec_uid, false);
|
|
40259
|
-
logger.info(`用户 ${item.remark ?? sec_uid} 已关播,更新直播状态`);
|
|
40260
|
-
}
|
|
40261
|
-
return null;
|
|
40847
|
+
function desc(Desc) {
|
|
40848
|
+
return Desc === "" ? "该作品没有描述" : Desc;
|
|
40262
40849
|
}
|
|
40263
|
-
//#endregion
|
|
40264
|
-
//#region src/platform/douyin/push/post.ts
|
|
40265
40850
|
/**
|
|
40266
|
-
*
|
|
40267
|
-
*
|
|
40268
|
-
* @
|
|
40851
|
+
* 构建合作信息数据
|
|
40852
|
+
* 从作品详情中提取创作者合作信息,包括合作者列表和订阅者角色
|
|
40853
|
+
* @param Detail_Data - 作品详情数据,包含 cooperation_info、user_info、author 等字段
|
|
40854
|
+
* @returns 合作信息对象,如果不存在则返回 undefined
|
|
40855
|
+
*/
|
|
40856
|
+
function buildCooperationInfo(Detail_Data) {
|
|
40857
|
+
const raw = Detail_Data.cooperation_info;
|
|
40858
|
+
if (!raw) return void 0;
|
|
40859
|
+
const rawCreators = Array.isArray(raw.co_creators) ? raw.co_creators : [];
|
|
40860
|
+
const subscriberUid = Detail_Data.user_info.data.user.uid;
|
|
40861
|
+
const subscriberSecUid = Detail_Data.user_info.data.user.sec_uid;
|
|
40862
|
+
const subscriberInCreators = rawCreators.find((c) => subscriberUid && c.uid && c.uid === subscriberUid || subscriberSecUid && c.sec_uid && c.sec_uid === subscriberSecUid);
|
|
40863
|
+
const co_creators = rawCreators.map((c) => {
|
|
40864
|
+
return {
|
|
40865
|
+
avatar_url: c.avatar_thumb?.url_list?.[0] ?? (c.avatar_thumb?.uri ? `https://p3.douyinpic.com/${c.avatar_thumb.uri}` : void 0),
|
|
40866
|
+
nickname: c.nickname,
|
|
40867
|
+
role_title: c.role_title
|
|
40868
|
+
};
|
|
40869
|
+
});
|
|
40870
|
+
if (Detail_Data.author && !rawCreators.some((c) => Detail_Data.author?.uid && c.uid && c.uid === Detail_Data.author.uid || Detail_Data.author?.sec_uid && c.sec_uid && c.sec_uid === Detail_Data.author.sec_uid || Detail_Data.author?.nickname && c.nickname && c.nickname === Detail_Data.author.nickname)) co_creators.unshift({
|
|
40871
|
+
avatar_url: Detail_Data.author.avatar_thumb?.url_list?.[0] ?? (Detail_Data.author.avatar_thumb?.uri ? `https://p3.douyinpic.com/${Detail_Data.author.avatar_thumb.uri}` : void 0),
|
|
40872
|
+
nickname: Detail_Data.author.nickname,
|
|
40873
|
+
role_title: "作者"
|
|
40874
|
+
});
|
|
40875
|
+
return {
|
|
40876
|
+
co_creator_nums: Math.max(Number(raw.co_creator_nums || 0), co_creators.length),
|
|
40877
|
+
co_creators,
|
|
40878
|
+
subscriber_role: subscriberInCreators?.role_title ?? (subscriberUid && Detail_Data.author?.uid && subscriberUid === Detail_Data.author.uid || subscriberSecUid && Detail_Data.author?.sec_uid && subscriberSecUid === Detail_Data.author.sec_uid || Detail_Data.user_info.data.user.nickname && Detail_Data.author?.nickname && Detail_Data.user_info.data.user.nickname === Detail_Data.author.nickname ? "作者" : void 0)
|
|
40879
|
+
};
|
|
40880
|
+
}
|
|
40881
|
+
/**
|
|
40882
|
+
* 构建 Douyin CDN 头像 URL
|
|
40883
|
+
* @param uri - 头像资源的 URI 标识
|
|
40884
|
+
* @returns 完整的 1080x1080 分辨率头像 CDN 地址
|
|
40269
40885
|
*/
|
|
40270
|
-
|
|
40271
|
-
|
|
40272
|
-
|
|
40273
|
-
|
|
40274
|
-
|
|
40275
|
-
|
|
40276
|
-
|
|
40277
|
-
|
|
40278
|
-
|
|
40279
|
-
|
|
40280
|
-
|
|
40281
|
-
|
|
40282
|
-
|
|
40283
|
-
|
|
40284
|
-
|
|
40285
|
-
|
|
40286
|
-
发布时间戳(s):${createTime}
|
|
40287
|
-
当前时间戳(s):${nowSeconds}
|
|
40288
|
-
时间差(s):${timeDifference}s (${timeDiffHours}h)
|
|
40289
|
-
是否置顶:${is_top}
|
|
40290
|
-
是否在一天内:${timeDifference < 86400 ? logger.green("true") : logger.red("false")}
|
|
40291
|
-
`);
|
|
40292
|
-
if (is_top && timeDifference < 86400 || timeDifference < 86400 && !is_top) {
|
|
40293
|
-
const validTargets = [];
|
|
40294
|
-
for (const target of targets) if (!await douyinDBInstance.isAwemePushed(aweme.aweme_id, sec_uid, target.groupId, pushType)) validTargets.push(target);
|
|
40295
|
-
if (validTargets.length > 0) result.push({
|
|
40296
|
-
remark: item.remark,
|
|
40297
|
-
sec_uid,
|
|
40298
|
-
create_time: aweme.create_time,
|
|
40299
|
-
targets: validTargets,
|
|
40300
|
-
pushType,
|
|
40301
|
-
Detail_Data: {
|
|
40302
|
-
...aweme,
|
|
40303
|
-
user_info: userinfo
|
|
40304
|
-
},
|
|
40305
|
-
avatar_img: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + userinfo.data.user.avatar_larger.uri,
|
|
40306
|
-
living: false
|
|
40307
|
-
});
|
|
40308
|
-
}
|
|
40886
|
+
function cdnAvatar(uri) {
|
|
40887
|
+
return "https://p3-pc.douyinpic.com/aweme/1080x1080/" + uri;
|
|
40888
|
+
}
|
|
40889
|
+
/**
|
|
40890
|
+
* 解析图文/合辑中单张图片的媒体类型。
|
|
40891
|
+
* clip_type 规则参考普通解析逻辑:2/空为静态图,5 为实况动图,4 为短片。
|
|
40892
|
+
* @param image - 抖音 images 数组中的单项
|
|
40893
|
+
* @returns 模板可识别的媒体类型
|
|
40894
|
+
*/
|
|
40895
|
+
function getImageMediaType(image) {
|
|
40896
|
+
switch (image?.clip_type) {
|
|
40897
|
+
case 4: return "clip";
|
|
40898
|
+
case 5: return "live";
|
|
40899
|
+
case 2:
|
|
40900
|
+
case void 0:
|
|
40901
|
+
default: return "static";
|
|
40309
40902
|
}
|
|
40310
|
-
return result;
|
|
40311
40903
|
}
|
|
40312
|
-
//#endregion
|
|
40313
|
-
//#region src/platform/douyin/push/recommend.ts
|
|
40314
40904
|
/**
|
|
40315
|
-
*
|
|
40316
|
-
*
|
|
40317
|
-
* @
|
|
40905
|
+
* 构建图文作品图片列表。
|
|
40906
|
+
* 第一项为封面,后续最多保留 2 张预览图,并在每项上携带媒体类型。
|
|
40907
|
+
* @param images - 作品原始图片数组,每项包含 url_list(多分辨率 URL)
|
|
40908
|
+
* @param fallbackCover - images 缺失时使用的兜底封面
|
|
40909
|
+
* @returns 图片列表数据
|
|
40910
|
+
*/
|
|
40911
|
+
function buildImageList(images, fallbackCover) {
|
|
40912
|
+
if (!images || images.length === 0) return {
|
|
40913
|
+
images: fallbackCover ? [{
|
|
40914
|
+
url: fallbackCover,
|
|
40915
|
+
media_type: "static"
|
|
40916
|
+
}] : [],
|
|
40917
|
+
total_count: fallbackCover ? 1 : 0
|
|
40918
|
+
};
|
|
40919
|
+
const usedUrls = /* @__PURE__ */ new Set();
|
|
40920
|
+
return {
|
|
40921
|
+
images: images.map((img, index) => ({
|
|
40922
|
+
url: index === 0 ? img.url_list[2] ?? img.url_list[1] ?? img.url_list[0] ?? fallbackCover : img.url_list[1] ?? img.url_list[0] ?? img.url_list[2] ?? "",
|
|
40923
|
+
media_type: getImageMediaType(img)
|
|
40924
|
+
})).filter((item) => {
|
|
40925
|
+
if (!item.url) return false;
|
|
40926
|
+
const key = normalizeImageUrl(item.url);
|
|
40927
|
+
if (usedUrls.has(key)) return false;
|
|
40928
|
+
usedUrls.add(key);
|
|
40929
|
+
return true;
|
|
40930
|
+
}).slice(0, 3),
|
|
40931
|
+
total_count: images.length
|
|
40932
|
+
};
|
|
40933
|
+
}
|
|
40934
|
+
/**
|
|
40935
|
+
* 去掉签名参数,避免同一张图因 CDN 查询参数不同被重复放入预览列表。
|
|
40936
|
+
* @param url - 原始图片 URL
|
|
40937
|
+
* @returns 用于去重的稳定 URL key
|
|
40318
40938
|
*/
|
|
40319
|
-
|
|
40320
|
-
|
|
40321
|
-
|
|
40322
|
-
|
|
40323
|
-
|
|
40324
|
-
|
|
40325
|
-
const hasHistory = await douyinDBInstance.hasHistory(sec_uid, target.groupId, pushType);
|
|
40326
|
-
groupHistoryStatus.set(target.groupId, hasHistory);
|
|
40939
|
+
function normalizeImageUrl(url) {
|
|
40940
|
+
try {
|
|
40941
|
+
const parsed = new URL(url);
|
|
40942
|
+
return `${parsed.host}${parsed.pathname}`;
|
|
40943
|
+
} catch {
|
|
40944
|
+
return url.split("?")[0];
|
|
40327
40945
|
}
|
|
40328
|
-
|
|
40329
|
-
|
|
40330
|
-
|
|
40331
|
-
|
|
40332
|
-
|
|
40333
|
-
|
|
40334
|
-
|
|
40335
|
-
|
|
40336
|
-
|
|
40337
|
-
|
|
40338
|
-
|
|
40339
|
-
|
|
40946
|
+
}
|
|
40947
|
+
/**
|
|
40948
|
+
* 将作品描述按首句句号/感叹号/问号拆分为标题和正文
|
|
40949
|
+
* @param desc - 原始描述文本
|
|
40950
|
+
* @returns `{ title, body }`,若无句点分隔符则 title 为空字符串
|
|
40951
|
+
*/
|
|
40952
|
+
function splitTitleAndBody(desc) {
|
|
40953
|
+
const match = desc.match(/^[^。!?!?\n]*[。!?!?]/);
|
|
40954
|
+
if (!match) return {
|
|
40955
|
+
title: "",
|
|
40956
|
+
body: desc
|
|
40957
|
+
};
|
|
40958
|
+
return {
|
|
40959
|
+
title: match[0].replace(/[。!?!?]$/, ""),
|
|
40960
|
+
body: desc.slice(match[0].length)
|
|
40961
|
+
};
|
|
40962
|
+
}
|
|
40963
|
+
/**
|
|
40964
|
+
* 根据抖音作品描述和 text_extra 构建富文本文档
|
|
40965
|
+
* 普通正文走 text 节点,换行走 lineBreak 节点,hashtag 与有效 @ 用户走高亮节点。
|
|
40966
|
+
* @param body - 需要编排的文本片段
|
|
40967
|
+
* @param textExtra - 抖音作品 text_extra 数组
|
|
40968
|
+
* @param titleOffset - 当前片段在原始 desc 中的起始偏移字符数
|
|
40969
|
+
* @param mentionCache - 本次渲染内复用的 @ 校验结果,避免重复请求同一个用户主页
|
|
40970
|
+
* @returns 构建好的 RichTextDocument
|
|
40971
|
+
*/
|
|
40972
|
+
async function buildDescRichText(text, textExtra, titleOffset = 0, mentionCache = /* @__PURE__ */ new Map()) {
|
|
40973
|
+
if (!text) return createRichTextDocument([], { platform: "douyin" });
|
|
40974
|
+
const tokens = [...extractHashtagTokens(text, textExtra, titleOffset), ...(await resolveMentionTokens(text, textExtra, titleOffset, mentionCache)).map((item) => ({
|
|
40975
|
+
start: item.start,
|
|
40976
|
+
end: item.end,
|
|
40977
|
+
kind: "mention",
|
|
40978
|
+
text: item.text,
|
|
40979
|
+
userId: item.userId
|
|
40980
|
+
}))].sort((a, b) => a.start - b.start || b.end - b.start - (a.end - a.start));
|
|
40981
|
+
const nodes = [];
|
|
40982
|
+
let cursor = 0;
|
|
40983
|
+
for (const token of tokens) {
|
|
40984
|
+
if (token.start < cursor) continue;
|
|
40985
|
+
appendTextSegments(text.slice(cursor, token.start), nodes);
|
|
40986
|
+
if (token.kind === "hashtag") nodes.push(createHashtagNode(token.text));
|
|
40987
|
+
else nodes.push(createMentionNode(token.text, token.userId));
|
|
40988
|
+
cursor = token.end;
|
|
40989
|
+
}
|
|
40990
|
+
appendTextSegments(text.slice(cursor), nodes);
|
|
40991
|
+
return createRichTextDocument(nodes, { platform: "douyin" });
|
|
40992
|
+
}
|
|
40993
|
+
function extractHashtagTokens(body, textExtra, titleOffset = 0) {
|
|
40994
|
+
return (textExtra ?? []).filter((item) => item.type === 1 && !!item.hashtag_name && typeof item.start === "number" && typeof item.end === "number").map((item) => ({
|
|
40995
|
+
start: item.start - titleOffset,
|
|
40996
|
+
end: item.end - titleOffset,
|
|
40997
|
+
kind: "hashtag",
|
|
40998
|
+
text: "#" + item.hashtag_name
|
|
40999
|
+
})).filter((item) => item.start >= 0 && item.end > item.start && item.end <= body.length).filter((item) => body.slice(item.start, item.end) === item.text);
|
|
41000
|
+
}
|
|
41001
|
+
/**
|
|
41002
|
+
* 根据 text_extra 中的 sec_uid 反查当前昵称,并只在原文片段完全等于 @昵称 时生成 mention。
|
|
41003
|
+
* 这样可以过滤掉失效、改名或 text_extra 范围异常的 @。
|
|
41004
|
+
*/
|
|
41005
|
+
async function resolveMentionTokens(text, textExtra, titleOffset, mentionCache) {
|
|
41006
|
+
const candidates = (textExtra ?? []).filter((item) => item.type === 0 && typeof item.start === "number" && typeof item.end === "number" && typeof item.sec_uid === "string" && item.sec_uid.length > 0).map((item) => ({
|
|
41007
|
+
start: item.start - titleOffset,
|
|
41008
|
+
end: item.end - titleOffset,
|
|
41009
|
+
sec_uid: item.sec_uid
|
|
41010
|
+
})).filter((item) => item.start >= 0 && item.end > item.start && item.end <= text.length);
|
|
41011
|
+
if (candidates.length === 0) return [];
|
|
41012
|
+
const uniqueSecUids = [...new Set(candidates.map((item) => item.sec_uid))];
|
|
41013
|
+
await Promise.all(uniqueSecUids.map(async (secUid) => {
|
|
41014
|
+
if (mentionCache.has(secUid)) return;
|
|
40340
41015
|
try {
|
|
40341
|
-
|
|
40342
|
-
|
|
40343
|
-
|
|
40344
|
-
|
|
40345
|
-
|
|
40346
|
-
|
|
40347
|
-
|
|
40348
|
-
|
|
40349
|
-
logger.warn(`获取作品作者用户信息失败: ${error}`);
|
|
41016
|
+
const user = (await douyinFetcher.fetchUserProfile({
|
|
41017
|
+
sec_uid: secUid,
|
|
41018
|
+
typeMode: "strict"
|
|
41019
|
+
})).data.user;
|
|
41020
|
+
const nickname = user.nickname?.trim();
|
|
41021
|
+
mentionCache.set(secUid, user.sec_uid === secUid && nickname ? `@${nickname}` : null);
|
|
41022
|
+
} catch {
|
|
41023
|
+
mentionCache.set(secUid, null);
|
|
40350
41024
|
}
|
|
40351
|
-
|
|
40352
|
-
|
|
40353
|
-
|
|
40354
|
-
|
|
40355
|
-
|
|
40356
|
-
|
|
40357
|
-
|
|
40358
|
-
|
|
40359
|
-
|
|
40360
|
-
|
|
40361
|
-
|
|
40362
|
-
|
|
40363
|
-
|
|
40364
|
-
|
|
40365
|
-
|
|
41025
|
+
}));
|
|
41026
|
+
return candidates.flatMap((item) => {
|
|
41027
|
+
const mentionText = mentionCache.get(item.sec_uid);
|
|
41028
|
+
if (!mentionText) return [];
|
|
41029
|
+
if (text.slice(item.start, item.end) !== mentionText) return [];
|
|
41030
|
+
return [{
|
|
41031
|
+
start: item.start,
|
|
41032
|
+
end: item.end,
|
|
41033
|
+
text: mentionText,
|
|
41034
|
+
userId: item.sec_uid
|
|
41035
|
+
}];
|
|
41036
|
+
});
|
|
41037
|
+
}
|
|
41038
|
+
/**
|
|
41039
|
+
* 将文本按换行拆分为 text 节点和 lineBreak 节点并推入目标数组
|
|
41040
|
+
*/
|
|
41041
|
+
function appendTextSegments(text, target) {
|
|
41042
|
+
if (!text) return;
|
|
41043
|
+
const parts = text.split(/(\r?\n)/);
|
|
41044
|
+
for (const part of parts) if (part === "\r\n" || part === "\n") target.push(createLineBreakNode());
|
|
41045
|
+
else if (part) target.push(createTextNode(part));
|
|
41046
|
+
}
|
|
41047
|
+
/**
|
|
41048
|
+
* 提取博主 IP 属地
|
|
41049
|
+
* @param Detail_Data - 作品详情数据
|
|
41050
|
+
* @returns IP 属地文本(如 "重庆"),不存在时返回 undefined
|
|
41051
|
+
*/
|
|
41052
|
+
function extractIpLocation(Detail_Data) {
|
|
41053
|
+
let raw = Detail_Data.user_info?.data?.user?.ip_location;
|
|
41054
|
+
if (!raw) raw = Detail_Data.ip_location;
|
|
41055
|
+
if (!raw || typeof raw !== "string") return void 0;
|
|
41056
|
+
return raw.replace(/^IP属地[::]?\s*/, "").trim() || void 0;
|
|
41057
|
+
}
|
|
41058
|
+
/**
|
|
41059
|
+
* 从 suggest_words 中随机选择一条热点词
|
|
41060
|
+
* @param Detail_Data - 作品详情数据
|
|
41061
|
+
* @returns `{ hint_text, word }` 或 undefined
|
|
41062
|
+
*/
|
|
41063
|
+
function extractSuggestWord(Detail_Data) {
|
|
41064
|
+
const groups = Detail_Data.suggest_words?.suggest_words;
|
|
41065
|
+
if (!Array.isArray(groups) || groups.length === 0) return void 0;
|
|
41066
|
+
const group = groups[0];
|
|
41067
|
+
const words = Array.isArray(group?.words) ? group.words : [];
|
|
41068
|
+
if (words.length === 0) return void 0;
|
|
41069
|
+
const pick = words[Math.floor(Math.random() * words.length)];
|
|
41070
|
+
if (!pick?.word) return void 0;
|
|
41071
|
+
return {
|
|
41072
|
+
hint_text: group.hint_text ?? "大家都在搜:",
|
|
41073
|
+
word: pick.word
|
|
41074
|
+
};
|
|
41075
|
+
}
|
|
41076
|
+
/**
|
|
41077
|
+
* 从抖音图片对象中提取第一个可用 URL。
|
|
41078
|
+
* @param images - 可能存在的多种封面对象
|
|
41079
|
+
* @returns 可直接渲染的图片 URL,不存在时返回 undefined
|
|
41080
|
+
*/
|
|
41081
|
+
function pickImageUrl(...images) {
|
|
41082
|
+
for (const image of images) {
|
|
41083
|
+
const url = image?.url_list?.find((item) => typeof item === "string" && item.length > 0);
|
|
41084
|
+
if (url) return url;
|
|
40366
41085
|
}
|
|
40367
|
-
|
|
40368
|
-
|
|
41086
|
+
}
|
|
41087
|
+
/**
|
|
41088
|
+
* 安全解析 music.extra JSON。
|
|
41089
|
+
* @param extra - 抖音 music.extra 原始字符串
|
|
41090
|
+
* @returns 解析后的对象,解析失败时返回空对象
|
|
41091
|
+
*/
|
|
41092
|
+
function parseMusicExtra(extra) {
|
|
41093
|
+
if (typeof extra !== "string" || extra.length === 0) return {};
|
|
41094
|
+
try {
|
|
41095
|
+
return JSON.parse(extra);
|
|
41096
|
+
} catch {
|
|
41097
|
+
return {};
|
|
41098
|
+
}
|
|
41099
|
+
}
|
|
41100
|
+
/**
|
|
41101
|
+
* 构建图文作品 BGM 展示信息。
|
|
41102
|
+
* 优先使用 matched_pgc_sound 的标准曲目信息,再回退到原声/作者字段和 extra 中的映射标题。
|
|
41103
|
+
* @param music - 抖音作品 music 字段
|
|
41104
|
+
* @returns 可传给模板的音乐信息;无有效音乐数据时返回 undefined
|
|
41105
|
+
*/
|
|
41106
|
+
function buildMusicInfo(music) {
|
|
41107
|
+
if (!music || typeof music !== "object") return void 0;
|
|
41108
|
+
const extra = parseMusicExtra(music.extra);
|
|
41109
|
+
const matched = music.matched_pgc_sound;
|
|
41110
|
+
const title = matched?.title || matched?.mixed_title || extra.music_display_mapping_title || music.title;
|
|
41111
|
+
const author = matched?.author || matched?.mixed_author || music.author || music.owner_nickname;
|
|
41112
|
+
const cover = pickImageUrl(matched?.cover_medium, music.cover_hd, music.cover_large, music.cover_medium, music.cover_thumb, music.avatar_large, music.avatar_medium, music.avatar_thumb);
|
|
41113
|
+
if (!title && !author && !cover) return void 0;
|
|
41114
|
+
return {
|
|
41115
|
+
title: title || "未知音乐",
|
|
41116
|
+
author: author || "未知作者",
|
|
41117
|
+
cover
|
|
41118
|
+
};
|
|
41119
|
+
}
|
|
41120
|
+
/**
|
|
41121
|
+
* 获取用户抖音号
|
|
41122
|
+
* @param user - 用户对象,包含 unique_id 和 short_id
|
|
41123
|
+
* @returns 优先返回抖音号(unique_id),为空则返回短 ID
|
|
41124
|
+
*/
|
|
41125
|
+
function douyinId(user) {
|
|
41126
|
+
return user.unique_id === "" ? user.short_id : user.unique_id;
|
|
41127
|
+
}
|
|
41128
|
+
/**
|
|
41129
|
+
* 根据作品类型计算默认推送标签
|
|
41130
|
+
* @param workTypeInfo - 作品类型信息
|
|
41131
|
+
* @returns 视频/图文/合辑/文章/直播 之一的推送标签
|
|
41132
|
+
*/
|
|
41133
|
+
function getDefaultPushLabel(workTypeInfo) {
|
|
41134
|
+
if (workTypeInfo.isVideo) return "视频作品推送";
|
|
41135
|
+
if (workTypeInfo.isArticle) return "文章作品推送";
|
|
41136
|
+
if (workTypeInfo.isCollection) return "合辑作品推送";
|
|
41137
|
+
if (workTypeInfo.isImage) return "图文作品推送";
|
|
41138
|
+
if (workTypeInfo.isLive) return "直播动态推送";
|
|
41139
|
+
return "作品动态推送";
|
|
41140
|
+
}
|
|
41141
|
+
/**
|
|
41142
|
+
* 渲染作品推送图片
|
|
41143
|
+
* 根据作品类型(文章/视频/图文/合辑)自动选择对应模板进行渲染
|
|
41144
|
+
* 推送类型标签按优先级:调用方显式传入 → 根据作品主/子类型自动计算
|
|
41145
|
+
* @param options - 渲染参数
|
|
41146
|
+
* @returns 渲染后的图片元素数组
|
|
41147
|
+
*/
|
|
41148
|
+
async function renderWorkImage(options) {
|
|
41149
|
+
const { e, Detail_Data, create_time, shareLink, skipWatermark = false } = options;
|
|
41150
|
+
const workTypeInfo = getWorkTypeInfo(Detail_Data);
|
|
41151
|
+
const dynamicTypeLabel = options.dynamicTypeLabel ?? getDefaultPushLabel(workTypeInfo);
|
|
41152
|
+
const coverUrl = getWorkCoverUrl(workTypeInfo, Detail_Data);
|
|
41153
|
+
const formatTime = format(fromUnixTime(create_time), "yyyy-MM-dd HH:mm");
|
|
41154
|
+
const user = Detail_Data.user_info.data.user;
|
|
41155
|
+
const userDouyinId = douyinId(user);
|
|
41156
|
+
const avatarUrl = cdnAvatar(user.avatar_larger.uri);
|
|
41157
|
+
const authorNickname = Detail_Data.author?.nickname ?? user.nickname;
|
|
41158
|
+
const cooperationInfo = buildCooperationInfo(Detail_Data);
|
|
41159
|
+
const mentionCache = /* @__PURE__ */ new Map();
|
|
41160
|
+
const renderOpts = skipWatermark ? { skipWatermark: true } : void 0;
|
|
41161
|
+
switch (workTypeInfo.mainType) {
|
|
41162
|
+
case DouyinWorkMainType.ARTICLE: {
|
|
41163
|
+
const content = JSON.parse(Detail_Data.article_info.article_content);
|
|
41164
|
+
const fe_data = JSON.parse(Detail_Data.article_info.fe_data);
|
|
41165
|
+
return await Render(e, "douyin/article-work", {
|
|
41166
|
+
title: Detail_Data.article_info.article_title,
|
|
41167
|
+
markdown: content.markdown,
|
|
41168
|
+
images: fe_data.image_list || [],
|
|
41169
|
+
read_time: fe_data.read_time || 0,
|
|
41170
|
+
dianzan: Count(Detail_Data.statistics.digg_count),
|
|
41171
|
+
pinglun: Count(Detail_Data.statistics.comment_count),
|
|
41172
|
+
shouchang: Count(Detail_Data.statistics.collect_count),
|
|
41173
|
+
share: Count(Detail_Data.statistics.share_count),
|
|
41174
|
+
create_time: formatTime,
|
|
41175
|
+
avater_url: avatarUrl,
|
|
41176
|
+
username: authorNickname,
|
|
41177
|
+
抖音号: userDouyinId,
|
|
41178
|
+
获赞: Count(user.total_favorited),
|
|
41179
|
+
关注: Count(user.following_count),
|
|
41180
|
+
粉丝: Count(user.follower_count),
|
|
41181
|
+
share_url: Detail_Data.share_url
|
|
41182
|
+
}, renderOpts);
|
|
41183
|
+
}
|
|
41184
|
+
case DouyinWorkMainType.VIDEO: return await Render(e, "douyin/video-work", {
|
|
41185
|
+
image_url: coverUrl,
|
|
41186
|
+
title: await buildDescRichText(desc(Detail_Data.desc ?? ""), Detail_Data.text_extra, 0, mentionCache),
|
|
41187
|
+
desc: createRichTextDocument([], { platform: "douyin" }),
|
|
41188
|
+
ip_location: extractIpLocation(Detail_Data),
|
|
41189
|
+
suggest_word: extractSuggestWord(Detail_Data),
|
|
41190
|
+
music: buildMusicInfo(Detail_Data.music),
|
|
41191
|
+
duration: Detail_Data.duration,
|
|
41192
|
+
dianzan: Count(Detail_Data.statistics.digg_count),
|
|
41193
|
+
pinglun: Count(Detail_Data.statistics.comment_count),
|
|
41194
|
+
share: Count(Detail_Data.statistics.share_count),
|
|
41195
|
+
shouchang: Count(Detail_Data.statistics.collect_count),
|
|
41196
|
+
create_time,
|
|
41197
|
+
avater_url: avatarUrl,
|
|
41198
|
+
share_url: shareLink,
|
|
41199
|
+
username: user.nickname,
|
|
41200
|
+
抖音号: userDouyinId,
|
|
41201
|
+
粉丝: Count(user.follower_count),
|
|
41202
|
+
获赞: Count(user.total_favorited),
|
|
41203
|
+
关注: Count(user.following_count),
|
|
41204
|
+
dynamicTYPE: dynamicTypeLabel,
|
|
41205
|
+
cooperation_info: cooperationInfo
|
|
41206
|
+
}, renderOpts);
|
|
41207
|
+
case DouyinWorkMainType.IMAGE: {
|
|
41208
|
+
const cover = Detail_Data.images?.[0]?.url_list[2] ?? Detail_Data.images?.[0]?.url_list[1] ?? coverUrl;
|
|
41209
|
+
const rawDesc = Detail_Data.desc ?? "";
|
|
41210
|
+
const splitDesc = splitTitleAndBody(rawDesc);
|
|
41211
|
+
const titleOffset = rawDesc.length - splitDesc.body.length;
|
|
41212
|
+
const title = splitDesc.title ? await buildDescRichText(splitDesc.title, Detail_Data.text_extra, 0, mentionCache) : void 0;
|
|
41213
|
+
const richDesc = await buildDescRichText(splitDesc.title && !splitDesc.body ? "" : desc(splitDesc.body), Detail_Data.text_extra, titleOffset, mentionCache);
|
|
41214
|
+
return await Render(e, "douyin/image-work", {
|
|
41215
|
+
image_list: buildImageList(Detail_Data.images, cover),
|
|
41216
|
+
title,
|
|
41217
|
+
desc: richDesc,
|
|
41218
|
+
ip_location: extractIpLocation(Detail_Data),
|
|
41219
|
+
suggest_word: extractSuggestWord(Detail_Data),
|
|
41220
|
+
music: buildMusicInfo(Detail_Data.music),
|
|
41221
|
+
dianzan: Count(Detail_Data.statistics.digg_count),
|
|
41222
|
+
pinglun: Count(Detail_Data.statistics.comment_count),
|
|
41223
|
+
share: Count(Detail_Data.statistics.share_count),
|
|
41224
|
+
shouchang: Count(Detail_Data.statistics.collect_count),
|
|
41225
|
+
create_time,
|
|
41226
|
+
avater_url: avatarUrl,
|
|
41227
|
+
share_url: shareLink,
|
|
41228
|
+
username: user.nickname,
|
|
41229
|
+
抖音号: userDouyinId,
|
|
41230
|
+
粉丝: Count(user.follower_count),
|
|
41231
|
+
获赞: Count(user.total_favorited),
|
|
41232
|
+
关注: Count(user.following_count),
|
|
41233
|
+
dynamicTYPE: dynamicTypeLabel,
|
|
41234
|
+
cooperation_info: cooperationInfo
|
|
41235
|
+
}, renderOpts);
|
|
41236
|
+
}
|
|
41237
|
+
default: return [];
|
|
41238
|
+
}
|
|
41239
|
+
}
|
|
41240
|
+
/**
|
|
41241
|
+
* 渲染喜欢列表推送图片
|
|
41242
|
+
* 展示用户喜欢的作品,同时显示点赞者和作品原作者的信息
|
|
41243
|
+
* @param options - 渲染参数
|
|
41244
|
+
* @returns 渲染后的图片元素数组
|
|
41245
|
+
*/
|
|
41246
|
+
async function renderFavoriteImage(options) {
|
|
41247
|
+
const { e, Detail_Data, create_time, shareLink, remark, skipWatermark = false } = options;
|
|
41248
|
+
const coverUrl = getWorkCoverUrl(getWorkTypeInfo(Detail_Data), Detail_Data);
|
|
41249
|
+
const authorUserInfo = Detail_Data.author_user_info;
|
|
41250
|
+
const subscriberUser = Detail_Data.user_info.data.user;
|
|
41251
|
+
return await Render(e, "douyin/favorite-list", {
|
|
41252
|
+
image_url: coverUrl,
|
|
41253
|
+
desc: desc(Detail_Data.desc),
|
|
41254
|
+
dianzan: Count(Detail_Data.statistics.digg_count),
|
|
41255
|
+
pinglun: Count(Detail_Data.statistics.comment_count),
|
|
41256
|
+
share: Count(Detail_Data.statistics.share_count),
|
|
41257
|
+
shouchang: Count(Detail_Data.statistics.collect_count),
|
|
41258
|
+
tuijian: Count(Detail_Data.statistics.recommend_count),
|
|
41259
|
+
create_time: format(fromUnixTime(create_time), "yyyy-MM-dd HH:mm"),
|
|
41260
|
+
liker_username: remark,
|
|
41261
|
+
liker_avatar: cdnAvatar(subscriberUser.avatar_larger.uri),
|
|
41262
|
+
liker_douyin_id: douyinId(subscriberUser),
|
|
41263
|
+
author_username: Detail_Data.author.nickname,
|
|
41264
|
+
author_avatar: authorUserInfo ? cdnAvatar(authorUserInfo.data.user.avatar_larger.uri) : Detail_Data.author.avatar_thumb.url_list[0],
|
|
41265
|
+
author_douyin_id: authorUserInfo ? douyinId(authorUserInfo.data.user) : douyinId(Detail_Data.author),
|
|
41266
|
+
share_url: shareLink
|
|
41267
|
+
}, skipWatermark ? { skipWatermark: true } : void 0);
|
|
41268
|
+
}
|
|
41269
|
+
/**
|
|
41270
|
+
* 渲染推荐列表推送图片
|
|
41271
|
+
* 展示用户推荐的作品,同时显示推荐者和作品原作者的信息
|
|
41272
|
+
* @param options - 渲染参数
|
|
41273
|
+
* @returns 渲染后的图片元素数组
|
|
41274
|
+
*/
|
|
41275
|
+
async function renderRecommendImage(options) {
|
|
41276
|
+
const { e, Detail_Data, create_time, shareLink, remark, skipWatermark = false } = options;
|
|
41277
|
+
const coverUrl = getWorkCoverUrl(getWorkTypeInfo(Detail_Data), Detail_Data);
|
|
41278
|
+
const authorUserInfo = Detail_Data.author_user_info;
|
|
41279
|
+
const recommenderUser = Detail_Data.user_info.data.user;
|
|
41280
|
+
return await Render(e, "douyin/recommend-list", {
|
|
41281
|
+
image_url: coverUrl,
|
|
41282
|
+
desc: desc(Detail_Data.desc),
|
|
41283
|
+
dianzan: Count(Detail_Data.statistics.digg_count),
|
|
41284
|
+
pinglun: Count(Detail_Data.statistics.comment_count),
|
|
41285
|
+
share: Count(Detail_Data.statistics.share_count),
|
|
41286
|
+
shouchang: Count(Detail_Data.statistics.collect_count),
|
|
41287
|
+
tuijian: Count(Detail_Data.statistics.recommend_count),
|
|
41288
|
+
create_time: format(fromUnixTime(create_time), "yyyy-MM-dd HH:mm"),
|
|
41289
|
+
recommender_username: remark,
|
|
41290
|
+
recommender_avatar: cdnAvatar(recommenderUser.avatar_larger.uri),
|
|
41291
|
+
recommender_douyin_id: douyinId(recommenderUser),
|
|
41292
|
+
author_username: Detail_Data.author.nickname,
|
|
41293
|
+
author_avatar: authorUserInfo ? cdnAvatar(authorUserInfo.data.user.avatar_larger.uri) : Detail_Data.author.avatar_thumb.url_list[0],
|
|
41294
|
+
author_douyin_id: authorUserInfo ? douyinId(authorUserInfo.data.user) : douyinId(Detail_Data.author),
|
|
41295
|
+
share_url: shareLink
|
|
41296
|
+
}, skipWatermark ? { skipWatermark: true } : void 0);
|
|
41297
|
+
}
|
|
41298
|
+
/**
|
|
41299
|
+
* 渲染直播状态推送图片
|
|
41300
|
+
* 展示直播间封面、主播信息、在线人数、分区等数据
|
|
41301
|
+
* 如果 room_data 或 live_data 缺失则返回空数组
|
|
41302
|
+
* @param options - 渲染参数
|
|
41303
|
+
* @returns 渲染后的图片元素数组
|
|
41304
|
+
*/
|
|
41305
|
+
async function renderLiveImage(options) {
|
|
41306
|
+
const { e, Detail_Data, skipWatermark = false } = options;
|
|
41307
|
+
const dynamicTypeLabel = options.dynamicTypeLabel ?? "直播动态推送";
|
|
41308
|
+
const user = Detail_Data.user_info.data.user;
|
|
41309
|
+
if (!Detail_Data.room_data || !Detail_Data.live_data) return [];
|
|
41310
|
+
const liveItem = Detail_Data.live_data.data.data.data[0];
|
|
41311
|
+
const room_data = Detail_Data.room_data;
|
|
41312
|
+
const streamExtra = liveItem.stream_url?.extra;
|
|
41313
|
+
const resolution = streamExtra ? `${streamExtra.width}x${streamExtra.height}` : liveItem.stream_url?.default_resolution;
|
|
41314
|
+
return await Render(e, "douyin/live", {
|
|
41315
|
+
image_url: liveItem.cover?.url_list[0],
|
|
41316
|
+
text: liveItem.title,
|
|
41317
|
+
partition_title: Detail_Data.live_data.data.data.partition_road_map?.partition?.title || "未知分区",
|
|
41318
|
+
room_id: room_data.owner.web_rid,
|
|
41319
|
+
online_viewers: Count(Number(liveItem.room_view_stats?.display_value)),
|
|
41320
|
+
total_viewers: liveItem.stats?.total_user_str || "",
|
|
41321
|
+
username: user.nickname,
|
|
41322
|
+
avater_url: cdnAvatar(user.avatar_larger.uri),
|
|
41323
|
+
fans: Count(user.follower_count),
|
|
41324
|
+
share_url: "https://live.douyin.com/" + room_data.owner.web_rid,
|
|
41325
|
+
dynamicTYPE: dynamicTypeLabel,
|
|
41326
|
+
like_count: Count(Number(liveItem.like_count || 0)),
|
|
41327
|
+
user_count_str: liveItem.user_count_str || "",
|
|
41328
|
+
resolution,
|
|
41329
|
+
signature: user.signature || "",
|
|
41330
|
+
city: user.city || "",
|
|
41331
|
+
aweme_count: Count(user.aweme_count || 0),
|
|
41332
|
+
following_count: Count(user.following_count || 0),
|
|
41333
|
+
total_favorited: Count(user.total_favorited || 0),
|
|
41334
|
+
has_commerce_goods: liveItem.has_commerce_goods || false
|
|
41335
|
+
}, skipWatermark ? { skipWatermark: true } : void 0);
|
|
40369
41336
|
}
|
|
40370
41337
|
//#endregion
|
|
40371
41338
|
//#region src/platform/douyin/push.ts
|
|
@@ -40483,13 +41450,30 @@ var DouYinpush = class extends Base {
|
|
|
40483
41450
|
for (const awemeId in data) {
|
|
40484
41451
|
const pushItem = data[awemeId];
|
|
40485
41452
|
const actualAwemeId = awemeId.replace(/^(post|favorite|recommend|live)_/, "");
|
|
40486
|
-
const
|
|
41453
|
+
const shareUrl = pushItem.Detail_Data.share_url ?? `https://live.douyin.com/${pushItem.Detail_Data.room_data?.owner.web_rid}`;
|
|
41454
|
+
let pushTypeLabel;
|
|
41455
|
+
switch (pushItem.pushType) {
|
|
41456
|
+
case "post":
|
|
41457
|
+
pushTypeLabel = "作品列表";
|
|
41458
|
+
break;
|
|
41459
|
+
case "favorite":
|
|
41460
|
+
pushTypeLabel = "喜欢列表";
|
|
41461
|
+
break;
|
|
41462
|
+
case "recommend":
|
|
41463
|
+
pushTypeLabel = "推荐列表";
|
|
41464
|
+
break;
|
|
41465
|
+
default:
|
|
41466
|
+
pushTypeLabel = "直播";
|
|
41467
|
+
break;
|
|
41468
|
+
}
|
|
40487
41469
|
logger.mark(`
|
|
40488
41470
|
${logger.blue("开始处理并渲染抖音动态图片")}
|
|
40489
41471
|
${logger.blue("博主")}: ${logger.green(pushItem.remark)}
|
|
40490
41472
|
${logger.blue("推送类型")}: ${logger.magenta(pushTypeLabel)}
|
|
40491
41473
|
${logger.cyan("作品id")}:${logger.yellow(actualAwemeId)}
|
|
40492
|
-
${logger.cyan("访问地址")}:${logger.green("https://www.douyin.com/video/" + actualAwemeId)}
|
|
41474
|
+
${logger.cyan("访问地址")}:${logger.green("https://www.douyin.com/video/" + actualAwemeId)}
|
|
41475
|
+
${logger.cyan("分享链接")}: ${logger.green(shareUrl)}
|
|
41476
|
+
`);
|
|
40493
41477
|
const Detail_Data = pushItem.Detail_Data;
|
|
40494
41478
|
const skip = await skipDynamic(pushItem);
|
|
40495
41479
|
skip && logger.warn(`作品 https://www.douyin.com/video/${actualAwemeId} 已被处理,跳过`);
|
|
@@ -40497,34 +41481,8 @@ var DouYinpush = class extends Base {
|
|
|
40497
41481
|
let iddata = { type: "one_work" };
|
|
40498
41482
|
this.injectBotToEventForRender(pushItem.targets);
|
|
40499
41483
|
if (!skip) iddata = await getDouyinID(this.e, Detail_Data.share_url ?? "https://live.douyin.com/" + Detail_Data.room_data?.owner.web_rid, false);
|
|
40500
|
-
if (!skip)
|
|
40501
|
-
const
|
|
40502
|
-
const streamExtra = liveItem.stream_url.extra;
|
|
40503
|
-
const resolution = streamExtra ? `${streamExtra.width}x${streamExtra.height}` : liveItem.stream_url.default_resolution;
|
|
40504
|
-
img = await Render(this.e, "douyin/live", {
|
|
40505
|
-
image_url: liveItem.cover.url_list[0],
|
|
40506
|
-
text: liveItem.title,
|
|
40507
|
-
partition_title: Detail_Data.live_data.data.data.partition_road_map?.partition?.title || "未知分区",
|
|
40508
|
-
room_id: Detail_Data.room_data.owner.web_rid,
|
|
40509
|
-
online_viewers: this.count(liveItem.room_view_stats.display_value),
|
|
40510
|
-
total_viewers: liveItem.stats.total_user_str,
|
|
40511
|
-
username: Detail_Data.user_info.data.user.nickname,
|
|
40512
|
-
avater_url: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + Detail_Data.user_info.data.user.avatar_larger.uri,
|
|
40513
|
-
fans: this.count(Detail_Data.user_info.data.user.follower_count),
|
|
40514
|
-
share_url: "https://live.douyin.com/" + Detail_Data.room_data.owner.web_rid,
|
|
40515
|
-
dynamicTYPE: "直播动态推送",
|
|
40516
|
-
like_count: this.count(liveItem.like_count),
|
|
40517
|
-
user_count_str: liveItem.user_count_str,
|
|
40518
|
-
resolution,
|
|
40519
|
-
signature: Detail_Data.user_info.data.user.signature,
|
|
40520
|
-
city: Detail_Data.user_info.data.user.city,
|
|
40521
|
-
aweme_count: this.count(Detail_Data.user_info.data.user.aweme_count),
|
|
40522
|
-
following_count: this.count(Detail_Data.user_info.data.user.following_count),
|
|
40523
|
-
total_favorited: this.count(Detail_Data.user_info.data.user.total_favorited),
|
|
40524
|
-
has_commerce_goods: liveItem.has_commerce_goods
|
|
40525
|
-
}, { skipWatermark: true });
|
|
40526
|
-
} else {
|
|
40527
|
-
const realUrl = Config.douyin.push.shareType === "web" && await new Network({
|
|
41484
|
+
if (!skip) {
|
|
41485
|
+
const realUrl = pushItem.pushType !== "live" && Config.douyin.push.shareType === "web" && await new Network({
|
|
40528
41486
|
url: Detail_Data.share_url,
|
|
40529
41487
|
headers: {
|
|
40530
41488
|
"User-Agent": "Apifox/1.0.0 (https://apifox.com)",
|
|
@@ -40533,114 +41491,51 @@ var DouYinpush = class extends Base {
|
|
|
40533
41491
|
Connection: "keep-alive"
|
|
40534
41492
|
}
|
|
40535
41493
|
}).getLocation();
|
|
40536
|
-
|
|
40537
|
-
|
|
40538
|
-
|
|
40539
|
-
|
|
40540
|
-
|
|
40541
|
-
|
|
40542
|
-
|
|
40543
|
-
|
|
40544
|
-
|
|
40545
|
-
|
|
40546
|
-
|
|
40547
|
-
|
|
40548
|
-
|
|
40549
|
-
|
|
40550
|
-
|
|
40551
|
-
|
|
40552
|
-
|
|
40553
|
-
|
|
40554
|
-
|
|
40555
|
-
|
|
40556
|
-
|
|
40557
|
-
|
|
40558
|
-
|
|
40559
|
-
|
|
40560
|
-
|
|
40561
|
-
|
|
40562
|
-
|
|
40563
|
-
|
|
40564
|
-
|
|
40565
|
-
|
|
40566
|
-
|
|
40567
|
-
|
|
40568
|
-
|
|
40569
|
-
|
|
40570
|
-
|
|
40571
|
-
|
|
40572
|
-
|
|
40573
|
-
|
|
40574
|
-
|
|
40575
|
-
|
|
40576
|
-
|
|
40577
|
-
|
|
40578
|
-
|
|
40579
|
-
|
|
40580
|
-
|
|
40581
|
-
const content = JSON.parse(Detail_Data.article_info.article_content);
|
|
40582
|
-
const fe_data = JSON.parse(Detail_Data.article_info.fe_data);
|
|
40583
|
-
img = await Render(this.e, "douyin/article-work", {
|
|
40584
|
-
title: Detail_Data.article_info.article_title,
|
|
40585
|
-
markdown: content.markdown,
|
|
40586
|
-
images: fe_data.image_list || [],
|
|
40587
|
-
read_time: fe_data.read_time || 0,
|
|
40588
|
-
dianzan: this.count(Detail_Data.statistics.digg_count),
|
|
40589
|
-
pinglun: this.count(Detail_Data.statistics.comment_count),
|
|
40590
|
-
shouchang: this.count(Detail_Data.statistics.collect_count),
|
|
40591
|
-
share: this.count(Detail_Data.statistics.share_count),
|
|
40592
|
-
create_time: format(fromUnixTime(pushItem.create_time), "yyyy-MM-dd HH:mm"),
|
|
40593
|
-
avater_url: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + Detail_Data.user_info.data.user.avatar_larger.uri,
|
|
40594
|
-
username: Detail_Data.author.nickname,
|
|
40595
|
-
抖音号: Detail_Data.user_info.data.user.unique_id === "" ? Detail_Data.user_info.data.user.short_id : Detail_Data.user_info.data.user.unique_id,
|
|
40596
|
-
获赞: this.count(Detail_Data.user_info.data.user.total_favorited),
|
|
40597
|
-
关注: this.count(Detail_Data.user_info.data.user.following_count),
|
|
40598
|
-
粉丝: this.count(Detail_Data.user_info.data.user.follower_count),
|
|
40599
|
-
share_url: Detail_Data.share_url,
|
|
40600
|
-
useDarkTheme: false
|
|
40601
|
-
}, { skipWatermark: true });
|
|
40602
|
-
} else img = await Render(this.e, workTypeInfo.templatePath, {
|
|
40603
|
-
image_url: coverUrl,
|
|
40604
|
-
desc: this.desc(Detail_Data, Detail_Data.desc),
|
|
40605
|
-
dianzan: this.count(Detail_Data.statistics.digg_count),
|
|
40606
|
-
pinglun: this.count(Detail_Data.statistics.comment_count),
|
|
40607
|
-
share: this.count(Detail_Data.statistics.share_count),
|
|
40608
|
-
shouchang: this.count(Detail_Data.statistics.collect_count),
|
|
40609
|
-
create_time: format(fromUnixTime(pushItem.create_time), "yyyy-MM-dd HH:mm"),
|
|
40610
|
-
avater_url: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + Detail_Data.user_info.data.user.avatar_larger.uri,
|
|
40611
|
-
share_url: Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`,
|
|
40612
|
-
username: Detail_Data.user_info.data.user.nickname,
|
|
40613
|
-
抖音号: Detail_Data.user_info.data.user.unique_id === "" ? Detail_Data.user_info.data.user.short_id : Detail_Data.user_info.data.user.unique_id,
|
|
40614
|
-
粉丝: this.count(Detail_Data.user_info.data.user.follower_count),
|
|
40615
|
-
获赞: this.count(Detail_Data.user_info.data.user.total_favorited),
|
|
40616
|
-
关注: this.count(Detail_Data.user_info.data.user.following_count),
|
|
40617
|
-
dynamicTYPE: dynamicTypeLabel,
|
|
40618
|
-
cooperation_info: (() => {
|
|
40619
|
-
const raw = Detail_Data.cooperation_info;
|
|
40620
|
-
if (!raw) return void 0;
|
|
40621
|
-
const rawCreators = Array.isArray(raw.co_creators) ? raw.co_creators : [];
|
|
40622
|
-
const subscriberUid = Detail_Data.user_info.data.user.uid;
|
|
40623
|
-
const subscriberSecUid = Detail_Data.user_info.data.user.sec_uid;
|
|
40624
|
-
const subscriberInCreators = rawCreators.find((c) => subscriberUid && c.uid && c.uid === subscriberUid || subscriberSecUid && c.sec_uid && c.sec_uid === subscriberSecUid);
|
|
40625
|
-
const co_creators = rawCreators.map((c) => {
|
|
40626
|
-
return {
|
|
40627
|
-
avatar_url: c.avatar_thumb?.url_list?.[0] ?? (c.avatar_thumb?.uri ? `https://p3.douyinpic.com/${c.avatar_thumb.uri}` : void 0),
|
|
40628
|
-
nickname: c.nickname,
|
|
40629
|
-
role_title: c.role_title
|
|
40630
|
-
};
|
|
40631
|
-
});
|
|
40632
|
-
if (Detail_Data.author && !rawCreators.some((c) => Detail_Data.author?.uid && c.uid && c.uid === Detail_Data.author.uid || Detail_Data.author?.sec_uid && c.sec_uid && c.sec_uid === Detail_Data.author.sec_uid || Detail_Data.author?.nickname && c.nickname && c.nickname === Detail_Data.author.nickname)) co_creators.unshift({
|
|
40633
|
-
avatar_url: Detail_Data.author.avatar_thumb?.url_list?.[0] ?? (Detail_Data.author.avatar_thumb?.uri ? `https://p3.douyinpic.com/${Detail_Data.author.avatar_thumb.uri}` : void 0),
|
|
40634
|
-
nickname: Detail_Data.author.nickname,
|
|
40635
|
-
role_title: "作者"
|
|
40636
|
-
});
|
|
40637
|
-
return {
|
|
40638
|
-
co_creator_nums: Math.max(Number(raw.co_creator_nums || 0), co_creators.length),
|
|
40639
|
-
co_creators,
|
|
40640
|
-
subscriber_role: subscriberInCreators?.role_title ?? (subscriberUid && Detail_Data.author?.uid && subscriberUid === Detail_Data.author.uid || subscriberSecUid && Detail_Data.author?.sec_uid && subscriberSecUid === Detail_Data.author.sec_uid || Detail_Data.user_info.data.user.nickname && Detail_Data.author?.nickname && Detail_Data.user_info.data.user.nickname === Detail_Data.author.nickname ? "作者" : void 0)
|
|
40641
|
-
};
|
|
40642
|
-
})()
|
|
40643
|
-
}, { skipWatermark: true });
|
|
41494
|
+
switch (pushItem.pushType) {
|
|
41495
|
+
case "live":
|
|
41496
|
+
if (!("room_data" in pushItem.Detail_Data && Detail_Data.live_data)) break;
|
|
41497
|
+
img = await renderLiveImage({
|
|
41498
|
+
e: this.e,
|
|
41499
|
+
Detail_Data,
|
|
41500
|
+
skipWatermark: true,
|
|
41501
|
+
dynamicTypeLabel: "直播动态推送"
|
|
41502
|
+
});
|
|
41503
|
+
break;
|
|
41504
|
+
case "favorite": {
|
|
41505
|
+
const shareLink = Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`;
|
|
41506
|
+
img = await renderFavoriteImage({
|
|
41507
|
+
e: this.e,
|
|
41508
|
+
Detail_Data,
|
|
41509
|
+
create_time: pushItem.create_time,
|
|
41510
|
+
shareLink,
|
|
41511
|
+
remark: pushItem.remark,
|
|
41512
|
+
skipWatermark: true
|
|
41513
|
+
});
|
|
41514
|
+
break;
|
|
41515
|
+
}
|
|
41516
|
+
case "recommend": {
|
|
41517
|
+
const shareLink = Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`;
|
|
41518
|
+
img = await renderRecommendImage({
|
|
41519
|
+
e: this.e,
|
|
41520
|
+
Detail_Data,
|
|
41521
|
+
create_time: pushItem.create_time,
|
|
41522
|
+
shareLink,
|
|
41523
|
+
remark: pushItem.remark,
|
|
41524
|
+
skipWatermark: true
|
|
41525
|
+
});
|
|
41526
|
+
break;
|
|
41527
|
+
}
|
|
41528
|
+
default: {
|
|
41529
|
+
const shareLink = Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`;
|
|
41530
|
+
img = await renderWorkImage({
|
|
41531
|
+
e: this.e,
|
|
41532
|
+
Detail_Data,
|
|
41533
|
+
create_time: pushItem.create_time,
|
|
41534
|
+
shareLink,
|
|
41535
|
+
skipWatermark: true
|
|
41536
|
+
});
|
|
41537
|
+
break;
|
|
41538
|
+
}
|
|
40644
41539
|
}
|
|
40645
41540
|
}
|
|
40646
41541
|
for (const target of pushItem.targets) {
|
|
@@ -41236,13 +42131,6 @@ var DouYinpush = class extends Base {
|
|
|
41236
42131
|
return false;
|
|
41237
42132
|
}
|
|
41238
42133
|
/**
|
|
41239
|
-
* 处理作品描述
|
|
41240
|
-
*/
|
|
41241
|
-
desc(Detail_Data, desc) {
|
|
41242
|
-
if (desc === "") return "该作品没有描述";
|
|
41243
|
-
return desc;
|
|
41244
|
-
}
|
|
41245
|
-
/**
|
|
41246
42134
|
* 格式化数字
|
|
41247
42135
|
*/
|
|
41248
42136
|
count(num) {
|
|
@@ -42992,6 +43880,216 @@ var globalStatistics = karin$1.command(/^#?kkk全局解析统计$/, handleGlobal
|
|
|
42992
43880
|
perm: "master"
|
|
42993
43881
|
});
|
|
42994
43882
|
//#endregion
|
|
43883
|
+
//#region src/apps/testPush.ts
|
|
43884
|
+
/**
|
|
43885
|
+
* 测试抖音推送命令处理器
|
|
43886
|
+
* 支持四种推送类型的预览渲染,无数据库交互,仅用于调试和验证推送卡片效果
|
|
43887
|
+
*
|
|
43888
|
+
* 命令格式:
|
|
43889
|
+
* - #测试抖音作品推送 <作品链接>
|
|
43890
|
+
* - #测试抖音喜欢列表推送 <用户主页链接>
|
|
43891
|
+
* - #测试抖音推荐列表推送 <用户主页链接>
|
|
43892
|
+
* - #测试抖音直播状态推送 <用户主页链接>
|
|
43893
|
+
*/
|
|
43894
|
+
var handleTestPush = wrapWithErrorHandler(async (e) => {
|
|
43895
|
+
const match = e.msg.match(/^#测试抖音(作品|喜欢列表|推荐列表|直播状态)推送/);
|
|
43896
|
+
if (!match) {
|
|
43897
|
+
e.reply("支持的命令:\n#测试抖音作品推送 <作品链接>\n#测试抖音喜欢列表推送 <用户主页链接>\n#测试抖音推荐列表推送 <用户主页链接>\n#测试抖音直播状态推送 <用户主页链接>");
|
|
43898
|
+
return true;
|
|
43899
|
+
}
|
|
43900
|
+
/** 提取推送类型和链接 */
|
|
43901
|
+
const pushType = match[1];
|
|
43902
|
+
const urlMatch = e.msg.replace(match[0], "").trim().match(/(https?:\/\/[^\s]+)/i);
|
|
43903
|
+
if (!urlMatch) {
|
|
43904
|
+
e.reply(`请在命令后提供对应的${pushType === "作品" ? "作品" : "用户主页"}链接`);
|
|
43905
|
+
return true;
|
|
43906
|
+
}
|
|
43907
|
+
const url = urlMatch[1];
|
|
43908
|
+
const iddata = await getDouyinID(e, url, false);
|
|
43909
|
+
let images = [];
|
|
43910
|
+
switch (pushType) {
|
|
43911
|
+
/** 作品推送:作品链接 → parseWork → 渲染 */
|
|
43912
|
+
case "作品": {
|
|
43913
|
+
if (iddata.type !== "one_work" || !iddata.aweme_id) {
|
|
43914
|
+
e.reply("该链接不是作品链接,请提供视频/图集/文章链接");
|
|
43915
|
+
return true;
|
|
43916
|
+
}
|
|
43917
|
+
logger.mark(`[测试抖音推送] 开始解析作品: ${iddata.aweme_id}`);
|
|
43918
|
+
const workData = await douyinFetcher.parseWork({
|
|
43919
|
+
aweme_id: iddata.aweme_id,
|
|
43920
|
+
typeMode: "strict"
|
|
43921
|
+
});
|
|
43922
|
+
if (!workData.data.aweme_detail) {
|
|
43923
|
+
e.reply("获取作品详情失败,作品可能已被删除或设为私密");
|
|
43924
|
+
return true;
|
|
43925
|
+
}
|
|
43926
|
+
const aweme = workData.data.aweme_detail;
|
|
43927
|
+
const userinfo = await douyinFetcher.fetchUserProfile({
|
|
43928
|
+
sec_uid: aweme.author.sec_uid,
|
|
43929
|
+
typeMode: "strict"
|
|
43930
|
+
});
|
|
43931
|
+
const Detail_Data = {
|
|
43932
|
+
...aweme,
|
|
43933
|
+
user_info: userinfo
|
|
43934
|
+
};
|
|
43935
|
+
const shareLink = Detail_Data.video?.play_addr?.uri ? `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0` : Detail_Data.share_url || url;
|
|
43936
|
+
images = await renderWorkImage({
|
|
43937
|
+
e,
|
|
43938
|
+
Detail_Data,
|
|
43939
|
+
create_time: aweme.create_time,
|
|
43940
|
+
shareLink
|
|
43941
|
+
});
|
|
43942
|
+
if (images.length === 0) {
|
|
43943
|
+
e.reply("未能识别该作品类型,无法渲染推送图片");
|
|
43944
|
+
return true;
|
|
43945
|
+
}
|
|
43946
|
+
break;
|
|
43947
|
+
}
|
|
43948
|
+
/** 喜欢列表:用户主页 → fetchUserFavoriteList[0] → 渲染 */
|
|
43949
|
+
case "喜欢列表": {
|
|
43950
|
+
if (iddata.type !== "user_dynamic" || !iddata.sec_uid) {
|
|
43951
|
+
e.reply("需要用户主页链接以获取喜欢列表");
|
|
43952
|
+
return true;
|
|
43953
|
+
}
|
|
43954
|
+
logger.mark(`[测试抖音推送] 开始获取喜欢列表: sec_uid=${iddata.sec_uid}`);
|
|
43955
|
+
const userinfo = await douyinFetcher.fetchUserProfile({
|
|
43956
|
+
sec_uid: iddata.sec_uid,
|
|
43957
|
+
typeMode: "strict"
|
|
43958
|
+
});
|
|
43959
|
+
const favoriteData = await douyinFetcher.fetchUserFavoriteList({
|
|
43960
|
+
sec_uid: iddata.sec_uid,
|
|
43961
|
+
number: 1,
|
|
43962
|
+
typeMode: "strict"
|
|
43963
|
+
});
|
|
43964
|
+
if (!favoriteData.data.aweme_list?.length) {
|
|
43965
|
+
e.reply("该用户的喜欢列表为空或未公开");
|
|
43966
|
+
return true;
|
|
43967
|
+
}
|
|
43968
|
+
const aweme = favoriteData.data.aweme_list[0];
|
|
43969
|
+
let authorUserInfo;
|
|
43970
|
+
try {
|
|
43971
|
+
authorUserInfo = await douyinFetcher.fetchUserProfile({
|
|
43972
|
+
sec_uid: aweme.author.sec_uid,
|
|
43973
|
+
typeMode: "strict"
|
|
43974
|
+
});
|
|
43975
|
+
} catch {}
|
|
43976
|
+
const Detail_Data = {
|
|
43977
|
+
...aweme,
|
|
43978
|
+
user_info: userinfo,
|
|
43979
|
+
author_user_info: authorUserInfo
|
|
43980
|
+
};
|
|
43981
|
+
const shareLink = Detail_Data.video?.play_addr?.uri ? `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0` : aweme.share_url;
|
|
43982
|
+
images = await renderFavoriteImage({
|
|
43983
|
+
e,
|
|
43984
|
+
Detail_Data,
|
|
43985
|
+
create_time: aweme.create_time,
|
|
43986
|
+
shareLink,
|
|
43987
|
+
remark: userinfo.data.user.nickname
|
|
43988
|
+
});
|
|
43989
|
+
if (!images.length) {
|
|
43990
|
+
e.reply("渲染喜欢列表推送图片失败");
|
|
43991
|
+
return true;
|
|
43992
|
+
}
|
|
43993
|
+
break;
|
|
43994
|
+
}
|
|
43995
|
+
/** 推荐列表:用户主页 → fetchUserRecommendList[0] → 渲染 */
|
|
43996
|
+
case "推荐列表": {
|
|
43997
|
+
if (iddata.type !== "user_dynamic" || !iddata.sec_uid) {
|
|
43998
|
+
e.reply("需要用户主页链接以获取推荐列表");
|
|
43999
|
+
return true;
|
|
44000
|
+
}
|
|
44001
|
+
logger.mark(`[测试抖音推送] 开始获取推荐列表: sec_uid=${iddata.sec_uid}`);
|
|
44002
|
+
const userinfo = await douyinFetcher.fetchUserProfile({
|
|
44003
|
+
sec_uid: iddata.sec_uid,
|
|
44004
|
+
typeMode: "strict"
|
|
44005
|
+
});
|
|
44006
|
+
const recommendData = await douyinFetcher.fetchUserRecommendList({
|
|
44007
|
+
sec_uid: iddata.sec_uid,
|
|
44008
|
+
number: 1,
|
|
44009
|
+
typeMode: "strict"
|
|
44010
|
+
});
|
|
44011
|
+
if (!recommendData.data.aweme_list?.length) {
|
|
44012
|
+
e.reply("该用户的推荐列表为空或未公开");
|
|
44013
|
+
return true;
|
|
44014
|
+
}
|
|
44015
|
+
const aweme = recommendData.data.aweme_list[0];
|
|
44016
|
+
let authorUserInfo;
|
|
44017
|
+
try {
|
|
44018
|
+
authorUserInfo = await douyinFetcher.fetchUserProfile({
|
|
44019
|
+
sec_uid: aweme.author.sec_uid,
|
|
44020
|
+
typeMode: "strict"
|
|
44021
|
+
});
|
|
44022
|
+
} catch {}
|
|
44023
|
+
const Detail_Data = {
|
|
44024
|
+
...aweme,
|
|
44025
|
+
user_info: userinfo,
|
|
44026
|
+
author_user_info: authorUserInfo
|
|
44027
|
+
};
|
|
44028
|
+
const shareLink = Detail_Data.video?.play_addr?.uri ? `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0` : aweme.share_url;
|
|
44029
|
+
images = await renderRecommendImage({
|
|
44030
|
+
e,
|
|
44031
|
+
Detail_Data,
|
|
44032
|
+
create_time: aweme.create_time,
|
|
44033
|
+
shareLink,
|
|
44034
|
+
remark: userinfo.data.user.nickname
|
|
44035
|
+
});
|
|
44036
|
+
if (!images.length) {
|
|
44037
|
+
e.reply("渲染推荐列表推送图片失败");
|
|
44038
|
+
return true;
|
|
44039
|
+
}
|
|
44040
|
+
break;
|
|
44041
|
+
}
|
|
44042
|
+
/** 直播状态:用户主页 → 检查 live_status → fetchLiveRoomInfo → 渲染 */
|
|
44043
|
+
case "直播状态": {
|
|
44044
|
+
if (iddata.type !== "user_dynamic" || !iddata.sec_uid) {
|
|
44045
|
+
e.reply("需要用户主页链接以检查直播状态");
|
|
44046
|
+
return true;
|
|
44047
|
+
}
|
|
44048
|
+
const sec_uid = iddata.sec_uid;
|
|
44049
|
+
logger.mark(`[测试抖音推送] 开始检查直播状态: sec_uid=${sec_uid}`);
|
|
44050
|
+
const userinfo = await douyinFetcher.fetchUserProfile({
|
|
44051
|
+
sec_uid,
|
|
44052
|
+
typeMode: "strict"
|
|
44053
|
+
});
|
|
44054
|
+
const user = userinfo.data.user;
|
|
44055
|
+
if (user.live_status !== 1) {
|
|
44056
|
+
e.reply(`${user.nickname} 当前未在直播`);
|
|
44057
|
+
return true;
|
|
44058
|
+
}
|
|
44059
|
+
if (!user.room_data) {
|
|
44060
|
+
e.reply("未获取到直播间信息");
|
|
44061
|
+
return true;
|
|
44062
|
+
}
|
|
44063
|
+
const room_data = JSON.parse(user.room_data);
|
|
44064
|
+
images = await renderLiveImage({
|
|
44065
|
+
e,
|
|
44066
|
+
Detail_Data: {
|
|
44067
|
+
user_info: userinfo,
|
|
44068
|
+
room_data,
|
|
44069
|
+
live_data: await douyinFetcher.fetchLiveRoomInfo({
|
|
44070
|
+
room_id: user.room_id_str,
|
|
44071
|
+
web_rid: room_data.owner.web_rid,
|
|
44072
|
+
typeMode: "strict"
|
|
44073
|
+
})
|
|
44074
|
+
}
|
|
44075
|
+
});
|
|
44076
|
+
if (!images.length) {
|
|
44077
|
+
e.reply("渲染直播状态推送图片失败");
|
|
44078
|
+
return true;
|
|
44079
|
+
}
|
|
44080
|
+
break;
|
|
44081
|
+
}
|
|
44082
|
+
}
|
|
44083
|
+
e.reply([...images, segment.markdown("[跳转](mqqapi://forward/url?version=1&src_type=web&url_prefix=" + encodeURIComponent("https://www.douyin.com"))]);
|
|
44084
|
+
logger.mark(`[测试抖音推送] ${pushType}推送渲染完成`);
|
|
44085
|
+
return true;
|
|
44086
|
+
}, { businessName: "测试抖音推送" });
|
|
44087
|
+
/** 注册测试推送命令 */
|
|
44088
|
+
var testPush = Config.douyin.switch && karin$1.command(/^#测试抖音(作品|喜欢列表|推荐列表|直播状态)推送/, handleTestPush, {
|
|
44089
|
+
name: "kkk-测试抖音推送",
|
|
44090
|
+
perm: "master"
|
|
44091
|
+
});
|
|
44092
|
+
//#endregion
|
|
42995
44093
|
//#region src/apps/tools.ts
|
|
42996
44094
|
var reg = {
|
|
42997
44095
|
douyin: /(https?:\/\/)?(www|v|jx|m|jingxuan)\.(douyin|iesdouyin)\.com/i,
|
|
@@ -43000,13 +44098,13 @@ var reg = {
|
|
|
43000
44098
|
kuaishou: /(快手.*快手|v\.kuaishou\.com|kuaishou\.com)/,
|
|
43001
44099
|
xiaohongshu: /(xiaohongshu\.com|xhslink\.com)/
|
|
43002
44100
|
};
|
|
43003
|
-
var handleDouyin = wrapWithErrorHandler(async (e) => {
|
|
43004
|
-
if (e.msg.startsWith("#测试")) return
|
|
44101
|
+
var handleDouyin = wrapWithErrorHandler(async (e, next) => {
|
|
44102
|
+
if (e.msg.startsWith("#测试")) return next();
|
|
43005
44103
|
const forceBurnDanmaku = /^#?弹幕解析/.test(e.msg);
|
|
43006
44104
|
const urlMatch = e.msg.match(/(https?:\/\/[^\s]*\.(douyin|iesdouyin)\.com[^\s]*)/gi);
|
|
43007
44105
|
if (!urlMatch) {
|
|
43008
44106
|
logger.warn(`未能在消息中找到有效的抖音链接: ${e.msg}`);
|
|
43009
|
-
return
|
|
44107
|
+
return next();
|
|
43010
44108
|
}
|
|
43011
44109
|
const iddata = await getDouyinID(e, String(urlMatch[0]));
|
|
43012
44110
|
await new DouYin(e, iddata, { forceBurnDanmaku }).DouyinHandler(iddata);
|
|
@@ -43017,9 +44115,8 @@ var handleDouyin = wrapWithErrorHandler(async (e) => {
|
|
|
43017
44115
|
} catch (error) {
|
|
43018
44116
|
logger.debug("[统计] 记录抖音解析统计失败:", error);
|
|
43019
44117
|
}
|
|
43020
|
-
return true;
|
|
43021
44118
|
}, { businessName: "抖音视频解析" });
|
|
43022
|
-
var handleBilibili = wrapWithErrorHandler(async (e) => {
|
|
44119
|
+
var handleBilibili = wrapWithErrorHandler(async (e, next) => {
|
|
43023
44120
|
e.msg = e.msg.replace(/\\/g, "");
|
|
43024
44121
|
const forceBurnDanmaku = /^#?弹幕解析/.test(e.msg);
|
|
43025
44122
|
const urlRegex = /(https?:\/\/(?:(?:www\.|m\.|t\.)?bilibili\.com|b23\.tv|bili2233\.cn)\/[a-zA-Z0-9_\-.~:\/?#[\]@!$&'()*+,;=]+)/;
|
|
@@ -43032,7 +44129,7 @@ var handleBilibili = wrapWithErrorHandler(async (e) => {
|
|
|
43032
44129
|
else if (avRegex.test(e.msg)) url = `https://www.bilibili.com/video/${e.msg}`;
|
|
43033
44130
|
if (!url) {
|
|
43034
44131
|
logger.warn(`未能在消息中找到有效的B站分享链接、BV号或AV号: ${e.msg}`);
|
|
43035
|
-
return
|
|
44132
|
+
return next();
|
|
43036
44133
|
}
|
|
43037
44134
|
const iddata = await getBilibiliID(url);
|
|
43038
44135
|
await new Bilibili(e, iddata, { forceBurnDanmaku }).BilibiliHandler(iddata);
|
|
@@ -43043,7 +44140,6 @@ var handleBilibili = wrapWithErrorHandler(async (e) => {
|
|
|
43043
44140
|
} catch (error) {
|
|
43044
44141
|
logger.debug("[统计] 记录B站解析统计失败:", error);
|
|
43045
44142
|
}
|
|
43046
|
-
return true;
|
|
43047
44143
|
}, { businessName: "B站视频解析" });
|
|
43048
44144
|
var handleKuaishou = wrapWithErrorHandler(async (e) => {
|
|
43049
44145
|
const kuaishouUrl = e.msg.replaceAll("\\", "").match(/(https:\/\/v\.kuaishou\.com\/\w+|https:\/\/www\.kuaishou\.com\/f\/[a-zA-Z0-9]+)/g);
|
|
@@ -43058,11 +44154,11 @@ var handleKuaishou = wrapWithErrorHandler(async (e) => {
|
|
|
43058
44154
|
logger.debug("[统计] 记录快手解析统计失败:", error);
|
|
43059
44155
|
}
|
|
43060
44156
|
}, { businessName: "快手视频解析" });
|
|
43061
|
-
var handleXiaohongshu = wrapWithErrorHandler(async (e) => {
|
|
44157
|
+
var handleXiaohongshu = wrapWithErrorHandler(async (e, next) => {
|
|
43062
44158
|
const url = e.msg.replaceAll("\\", "").match(/https?:\/\/[^\s"'<>]+/)?.[0];
|
|
43063
44159
|
if (!url) {
|
|
43064
44160
|
logger.warn(`未能在消息中找到有效链接: ${e.msg}`);
|
|
43065
|
-
return
|
|
44161
|
+
return next();
|
|
43066
44162
|
}
|
|
43067
44163
|
const iddata = await getXiaohongshuID(url);
|
|
43068
44164
|
await new Xiaohongshu(e, iddata).XiaohongshuHandler(iddata);
|
|
@@ -43073,7 +44169,6 @@ var handleXiaohongshu = wrapWithErrorHandler(async (e) => {
|
|
|
43073
44169
|
} catch (error) {
|
|
43074
44170
|
logger.debug("[统计] 记录小红书解析统计失败:", error);
|
|
43075
44171
|
}
|
|
43076
|
-
return true;
|
|
43077
44172
|
}, { businessName: "小红书视频解析" });
|
|
43078
44173
|
var handlePrefix = wrapWithErrorHandler(async (e, next) => {
|
|
43079
44174
|
const originalMsg = e.msg;
|
|
@@ -47020,4 +48115,4 @@ mkdirSync(`${karinPathBase}/${Root.pluginName}/data`);
|
|
|
47020
48115
|
mkdirSync(Common.tempDri.images);
|
|
47021
48116
|
mkdirSync(Common.tempDri.video);
|
|
47022
48117
|
//#endregion
|
|
47023
|
-
export {
|
|
48118
|
+
export { createLineBreakNode as $, xiaohongshuApiUrls as $n, emitLog as $r, MajorType as $t, template_default as A, fetchResponse as An, BilibiliBangumiStreamParamsSchema as Ar, DouyinMethodMapping as At, DouyinDBBase as B, createBoundDouyinFetcher as Bn, BilibiliMethodRoutes as Br, DouyinFetcherMethods as Bt, help as C, bv2av as Cn, DouyinWorkParamsSchema as Cr, softFetch as Ct, removeOldFiles as D, logMiddleware as Dn, BilibiliArticleParamsSchema as Dr, BilibiliApiRoutes as Dt, dylogin as E, initLogger as En, BilibiliArticleInfoParamsSchema as Er, amagiClient$1 as Et, getBilibiliDB as F, createBoundKuaishouFetcher as Fn, BilibiliDanmakuParamsSchema as Fr, getApiRoute as Ft, createAtNode as G, createErrorResponse as Gn, BilibiliValidationSchemas as Gr, KuaishouMethodToFetcher as Gt, reactServerRender as H, douyinSign as Hn, BilibiliQrcodeStatusParamsSchema as Hr, DouyinMethodToFetcher as Ht, getDouyinDB as I, kuaishouFetcher$1 as In, BilibiliDynamicParamsSchema as Ir, getEnglishMethodName as It, createEmojiNode as J, validateDouyinParams as Jn, amagiEvents as Jr, XiaohongshuInternalMethods as Jt, createBlockquoteNode as K, createSuccessResponse$1 as Kn, BilibiliVideoDownloadParamsSchema as Kr, MethodMaps as Kt, getStatisticsDB as L, kuaishouSign as Ln, BilibiliEmojiParamsSchema as Lr, BilibiliFetcherMethods as Lt, bilibiliDBInstance as M, isNetworkErrorResult as Mn, BilibiliColumnInfoParamsSchema as Mr, KuaishouMethodMapping as Mt, cleanOldDynamicCache as N, createBoundXiaohongshuFetcher as Nn, BilibiliCommentParamsSchema as Nr, XiaohongshuApiRoutes as Nt, task as O, logger$2 as On, BilibiliAv2BvParamsSchema as Or, BilibiliMethodMapping as Ot, douyinDBInstance as P, xiaohongshuFetcher$1 as Pn, BilibiliCommentReplyParamsSchema as Pr, XiaohongshuMethodMapping as Pt, createImageNode as Q, XiaohongshuValidationSchemas as Qn, emitHttpResponse as Qr, AdditionalType as Qt, initAllDatabases as R, kuaishouApiUrls as Rn, BilibiliLiveParamsSchema as Rr, BilibiliInternalMethods as Rt, setdyPush as S, av2bv as Sn, DouyinValidationSchemas as Sr, reloadAmagiConfig as St, biLogin as T, httpLogger as Tn, BilibiliArticleCardParamsSchema as Tr, amagi as Tt, renderVideoPreviewPage as U, bilibiliFetcher$1 as Un, BilibiliUserParamsSchema as Ur, KuaishouFetcherMethods as Ut, BilibiliDBBase as V, douyinApiUrls as Vn, BilibiliQrcodeParamsSchema as Vr, DouyinInternalMethods as Vt, renderRichTextToReact as W, createBoundBilibiliFetcher as Wn, BilibiliValidateCaptchaParamsSchema as Wr, KuaishouInternalMethods as Wt, createHeadingNode as X, validateXiaohongshuParams as Xn, emitApiSuccess as Xr, toFetcherMethod as Xt, createHashtagNode as Y, validateKuaishouParams as Yn, emitApiError as Yr, XiaohongshuMethodToFetcher as Yt, createHorizontalRuleNode as Z, XiaohongshuMethodRoutes as Zn, emitHttpRequest as Zr, DynamicType as Zt, douyinPush as _, ValidationError as _n, DouyinMusicParamsSchema as _r, SOFT_ERROR_CODES as _t, bilibiliAPP as a, emitNetworkError as ai, xiaohongshu$1 as an, KuaishouUserProfileParamsSchema as ar, createParagraphNode as at, globalIgnore as b, wbi_sign as bn, DouyinUserListParamsSchema as br, douyinFetcher as bt, prefix as c, createBoundBilibiliApi as ci, createBoundKuaishouApi as cn, KuaishouVideoParamsSchema as cr, createTextNode as ct, globalStatistics as d, getDouyinData as di, createDouyinRoutes as dn, DouyinDanmakuParamsSchema as dr, createVoteNode as dt, emitLogDebug as ei, CommentType as en, xiaohongshuSign as er, createLinkCardNode as et, groupStatistics as f, getKuaishouData as fi, createBoundDouyinApi as fn, DouyinEmojiListParamsSchema as fr, createWebLinkNode as ft, changeBotID as g, ApiError as gn, DouyinMethodRoutes as gr, AmagiError as gt, bilibiliPushList as h, createBilibiliRoutes as hn, DouyinLiveRoomParamsSchema as hr, AmagiBase as ht, update as i, emitLogWarn as ii, createBoundXiaohongshuApi as in, KuaishouMethodRoutes as ir, createMentionNode as it, webConfig as j, getHeadersAndData as jn, BilibiliBv2AvParamsSchema as jr, KuaishouApiRoutes as jt, testWrapWithErrorHandler as k, fetchData as kn, BilibiliBangumiInfoParamsSchema as kr, DouyinApiRoutes as kt, xiaohongshuAPP as l, bilibiliApiUrls as li, kuaishou$1 as ln, DouyinCommentParamsSchema as lr, createTopicNode as lt, bilibiliPush as m, bilibiliUtils as mn, DouyinHotWordsParamsSchema as mr, normalizeRichTextNodes as mt, kkkUpdateCommand as n, emitLogInfo as ni, xiaohongshuUtils as nn, KuaishouEmojiParamsSchema as nr, createListNode as nt, douyinAPP as o, emitNetworkRetry as oi, kuaishouUtils as on, KuaishouUserWorkListParamsSchema as or, createRichTextDocument as ot, qrLogin as p, Root as pi, douyin$1 as pn, DouyinEmojiProParamsSchema as pr, extractRichTextPlainText as pt, createCodeBlockNode as q, validateBilibiliParams as qn, BilibiliVideoParamsSchema as qr, XiaohongshuFetcherMethods as qt, kkkUpdateTest as r, emitLogMark as ri, createXiaohongshuRoutes as rn, KuaishouLiveRoomInfoParamsSchema as rr, createLotteryNode as rt, kuaishouAPP as s, bilibili$1 as si, createKuaishouRoutes as sn, KuaishouValidationSchemas as sr, createSearchKeywordNode as st, kkkUpdate as t, emitLogError as ti, createAmagiClient as tn, KuaishouCommentParamsSchema as tr, createListItemNode as tt, testPush as u, getBilibiliData as ui, douyinUtils as un, DouyinCommentReplyParamsSchema as ur, createViewPictureNode as ut, douyinPushList as v, handleError as vn, DouyinQrcodeParamsSchema as vr, amagiClient as vt, version as w, qtparam as wn, BilibiliApplyCaptchaParamsSchema as wr, CreateApp as wt, setbiliPush as x, parseDmSegMobileReply as xn, DouyinUserParamsSchema as xr, kuaishouFetcher as xt, forcePush as y, bilibiliErrorCodeMap as yn, DouyinSearchParamsSchema as yr, bilibiliFetcher as yt, StatisticsDBBase as z, douyinFetcher$1 as zn, BilibiliLoginParamsSchema as zr, BilibiliMethodToFetcher as zt };
|