karin-plugin-kkk 2.2.0 → 2.3.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/config/default_config/douyin.yaml +7 -1
  3. package/lib/apps/admin.js +2 -2
  4. package/lib/apps/help.js +2 -2
  5. package/lib/apps/push.js +30 -4
  6. package/lib/apps/tools.js +2 -2
  7. package/lib/core_chunk/{db-CaO_rOgi.js → db-DfNMk-Qd.js} +1 -1
  8. package/lib/core_chunk/{main-KPfnncok.js → main-CGW1iGhl.js} +76 -22
  9. package/lib/core_chunk/template.d.ts +11 -0
  10. package/lib/core_chunk/template.js +110 -33
  11. package/lib/index.js +4 -4
  12. package/lib/karin-plugin-kkk.css +64 -0
  13. package/lib/web.config.js +1 -1
  14. package/lib/web_chunk/assets/Combination-D5z6jy1Y.js +46 -0
  15. package/lib/web_chunk/assets/avatar-D_afNP80.js +9 -0
  16. package/lib/web_chunk/assets/{eye-BZi90UQt.js → eye-DLInyL4G.js} +1 -1
  17. package/lib/web_chunk/assets/index-Dnv5PtSP.js +487 -0
  18. package/lib/web_chunk/assets/index-TZAB3P5s.js +6 -0
  19. package/lib/web_chunk/assets/page-BBfx6QaG.js +11 -0
  20. package/lib/web_chunk/assets/page-BHTknkgx.js +113 -0
  21. package/lib/web_chunk/assets/page-CMmWq9fE.js +45 -0
  22. package/lib/web_chunk/assets/page-CzIhFa_l.js +16 -0
  23. package/lib/web_chunk/assets/page-vWafup7Y.js +31 -0
  24. package/lib/web_chunk/assets/request-Cc8-yIdp.js +19 -0
  25. package/lib/web_chunk/assets/select-BoplBOso.js +16 -0
  26. package/lib/web_chunk/assets/separator-DakeTVyQ.js +1 -0
  27. package/lib/web_chunk/index.html +1 -1
  28. package/lib/web_chunk/sw.js +1 -1
  29. package/package.json +3 -2
  30. package/lib/web_chunk/assets/Combination-C0-xsDvD.js +0 -46
  31. package/lib/web_chunk/assets/avatar-eqoldj7B.js +0 -9
  32. package/lib/web_chunk/assets/index--QukLuhl.js +0 -6
  33. package/lib/web_chunk/assets/index-Ba20OJsR.js +0 -487
  34. package/lib/web_chunk/assets/page-913c6Tgt.js +0 -11
  35. package/lib/web_chunk/assets/page-B47nv8Le.js +0 -16
  36. package/lib/web_chunk/assets/page-Bu3krn56.js +0 -114
  37. package/lib/web_chunk/assets/page-BvMMvlEp.js +0 -45
  38. package/lib/web_chunk/assets/page-DkGhIa1W.js +0 -31
  39. package/lib/web_chunk/assets/request-DPcu9HkG.js +0 -19
  40. package/lib/web_chunk/assets/select-DuWcKGA5.js +0 -16
  41. package/lib/web_chunk/assets/separator-CXA6e35_.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,86 @@
1
1
  # 变更日志
2
2
 
3
+ ## [2.3.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.2.1...v2.3.0) (2025-10-10)
4
+
5
+
6
+ ### ✨ 新功能
7
+
8
+ * **douyin:** 添加共创信息展示功能并优化视频画质选择 ([88295a1](https://github.com/ikenxuan/karin-plugin-kkk/commit/88295a1a319ec2006b2e74c70ef67bcae774a779))
9
+
10
+
11
+ ### 🐛 错误修复
12
+
13
+ * release ([1e864f3](https://github.com/ikenxuan/karin-plugin-kkk/commit/1e864f3fb206dbb4bd6c0b941845e60e7699d2ad))
14
+ * 私聊不进行表情回复 close [#162](https://github.com/ikenxuan/karin-plugin-kkk/issues/162) ([da82635](https://github.com/ikenxuan/karin-plugin-kkk/commit/da826359e95b77cbe9705e6c84708b4a775b8786))
15
+
16
+ ## [2.2.1](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.2.0...v2.2.1) (2025-10-08)
17
+
18
+
19
+ ### 🐛 错误修复
20
+
21
+ * 1 ([3779329](https://github.com/ikenxuan/karin-plugin-kkk/commit/377932988b92d4221d3a0726f7214bdb7c613f60))
22
+
23
+
24
+ ### 🔧 其他更新
25
+
26
+ * release main ([#158](https://github.com/ikenxuan/karin-plugin-kkk/issues/158)) ([1b8dda5](https://github.com/ikenxuan/karin-plugin-kkk/commit/1b8dda52ebef23b59ccf51685b9fbc0f6bf04ae3))
27
+
28
+ ## [2.2.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/core-v2.1.0...core-v2.2.0) (2025-10-08)
29
+
30
+
31
+ ### ✨ 新功能
32
+
33
+ * add textMode option for direct text output instead of rendering images ([#151](https://github.com/ikenxuan/karin-plugin-kkk/issues/151)) ([bb6582b](https://github.com/ikenxuan/karin-plugin-kkk/commit/bb6582bf4cf58178cbcf4a2b6025c63562f8ca12))
34
+ * **bilibili/douyin:** 新增视频信息展示模式配置选项,支持文本和图片两种模式 ([0f7c055](https://github.com/ikenxuan/karin-plugin-kkk/commit/0f7c0553cd21a0e49e740e991462bce768130d52))
35
+ * **bilibili/douyin:** 添加视频信息内容自定义选项,可选择显示封面、标题、作者和统计数据 ([0f7c055](https://github.com/ikenxuan/karin-plugin-kkk/commit/0f7c0553cd21a0e49e740e991462bce768130d52))
36
+ * **bilibili:** B站评论组件支持显示置顶和UP主标识 ([0f7c055](https://github.com/ikenxuan/karin-plugin-kkk/commit/0f7c0553cd21a0e49e740e991462bce768130d52))
37
+ * **core:** 添加图文动态图片布局配置选项 ([786e75c](https://github.com/ikenxuan/karin-plugin-kkk/commit/786e75c3129def58419a8c8f79db7e2a083f4104))
38
+ * **douyin:** 添加视频画质偏好设置和自动选择功能 ([a08eb13](https://github.com/ikenxuan/karin-plugin-kkk/commit/a08eb131ba5a0ccde661f5e77178eb9c08288e49))
39
+ * **render:** 添加分页渲染配置 ([544ed23](https://github.com/ikenxuan/karin-plugin-kkk/commit/544ed2302dfddab0016245826b84bd21305ce681))
40
+ * **template:** 优化动态图片布局 ([777befc](https://github.com/ikenxuan/karin-plugin-kkk/commit/777befcea468e699c2eb23023ab454909cfba90e))
41
+ * **template:** 新增B站二维码登录组件并优化登录流程 ([a6f93f3](https://github.com/ikenxuan/karin-plugin-kkk/commit/a6f93f3faf2f30b57c42d67da66712348ccf8078))
42
+ * 添加错误日志接收配置并优化错误处理组件 ([3c0d462](https://github.com/ikenxuan/karin-plugin-kkk/commit/3c0d462fdffea0a73551e23312547de3174e718e))
43
+
44
+
45
+ ### 🐛 错误修复
46
+
47
+ * 1 ([3779329](https://github.com/ikenxuan/karin-plugin-kkk/commit/377932988b92d4221d3a0726f7214bdb7c613f60))
48
+ * **bilibili:** 修复动态图片转发时未处理空值的问题 ([d2c67cc](https://github.com/ikenxuan/karin-plugin-kkk/commit/d2c67cc8ffdeca51488160d712787a96972c6418))
49
+ * **bilibili:** 修正视频大小计算和清晰度选择逻辑 ([d107d79](https://github.com/ikenxuan/karin-plugin-kkk/commit/d107d79ae7516d13beedafb3a637283b0192e114))
50
+ * **douyin:** 修复直播推送中可选字段的处理逻辑 ([1f13fd8](https://github.com/ikenxuan/karin-plugin-kkk/commit/1f13fd85e32a1ce9319c1885233c95879efaf5bb))
51
+ * mkdir-db ([#141](https://github.com/ikenxuan/karin-plugin-kkk/issues/141)) ([7cde0a2](https://github.com/ikenxuan/karin-plugin-kkk/commit/7cde0a2f154e3b2a7bca26f75d91130410a0e63c))
52
+ * SQLITE_CONSTRAINT error when changing push bot ID ([#147](https://github.com/ikenxuan/karin-plugin-kkk/issues/147)) ([f1ceef2](https://github.com/ikenxuan/karin-plugin-kkk/commit/f1ceef294632fe001bfe1c590898d19113288187))
53
+ * 优化配置说明 close [#153](https://github.com/ikenxuan/karin-plugin-kkk/issues/153) ([c946824](https://github.com/ikenxuan/karin-plugin-kkk/commit/c94682434a57d9444ef41da68d63a610a6b1f82c))
54
+ * 修复B站直播数据路径问题 ([b9f7226](https://github.com/ikenxuan/karin-plugin-kkk/commit/b9f7226f4385100ccb6ecd35fb6db37756d008f7))
55
+
56
+
57
+ ### 📝 文档更新
58
+
59
+ * 更新配置注释和默认值 ([3c0d462](https://github.com/ikenxuan/karin-plugin-kkk/commit/3c0d462fdffea0a73551e23312547de3174e718e))
60
+
61
+
62
+ ### 🎨 代码样式
63
+
64
+ * **bilibili/douyin:** 优化视频信息展示和评论组件 ([0f7c055](https://github.com/ikenxuan/karin-plugin-kkk/commit/0f7c0553cd21a0e49e740e991462bce768130d52))
65
+ * 调整错误处理组件样式和布局 ([3c0d462](https://github.com/ikenxuan/karin-plugin-kkk/commit/3c0d462fdffea0a73551e23312547de3174e718e))
66
+
67
+
68
+ ### 🔧 其他更新
69
+
70
+ * release main ([#127](https://github.com/ikenxuan/karin-plugin-kkk/issues/127)) ([c1ab61f](https://github.com/ikenxuan/karin-plugin-kkk/commit/c1ab61f487a124380a5fec6c1df64afddc8bf16f))
71
+ * release main ([#144](https://github.com/ikenxuan/karin-plugin-kkk/issues/144)) ([a534b25](https://github.com/ikenxuan/karin-plugin-kkk/commit/a534b258c0b35ed6e8b5f5f0ffda714e71464955))
72
+ * release main ([#145](https://github.com/ikenxuan/karin-plugin-kkk/issues/145)) ([1e391bf](https://github.com/ikenxuan/karin-plugin-kkk/commit/1e391bf43a8a32b22d23292eb085d8b289d6472e))
73
+ * release main ([#148](https://github.com/ikenxuan/karin-plugin-kkk/issues/148)) ([4f4f064](https://github.com/ikenxuan/karin-plugin-kkk/commit/4f4f064b5283db1e5ca794d57c50d95d0c7d1559))
74
+ * release main ([#149](https://github.com/ikenxuan/karin-plugin-kkk/issues/149)) ([7a703e1](https://github.com/ikenxuan/karin-plugin-kkk/commit/7a703e18ee1bf718517e4f0b0bcd245bcd329f0b))
75
+ * release main ([#155](https://github.com/ikenxuan/karin-plugin-kkk/issues/155)) ([84ac24f](https://github.com/ikenxuan/karin-plugin-kkk/commit/84ac24f3ec4702bcf248acba01bfdb17a17389b2))
76
+
77
+
78
+ ### ♻️ 代码重构
79
+
80
+ * **core:** 重构模板系统并迁移静态资源 ([ec25300](https://github.com/ikenxuan/karin-plugin-kkk/commit/ec25300e90e239f64f5b1efeb1ab9a8125281dfe))
81
+ * **template:** 重构模板项目结构并优化类型定义 ([#142](https://github.com/ikenxuan/karin-plugin-kkk/issues/142)) ([2fb3b06](https://github.com/ikenxuan/karin-plugin-kkk/commit/2fb3b06ca8d55a9f38785e59bc508b8ce9578900))
82
+ * 重构错误处理逻辑使用新配置 ([3c0d462](https://github.com/ikenxuan/karin-plugin-kkk/commit/3c0d462fdffea0a73551e23312547de3174e718e))
83
+
3
84
  ## [2.2.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.1.0...v2.2.0) (2025-10-08)
4
85
 
5
86
 
@@ -53,4 +53,10 @@ push:
53
53
  # 是否打印日志
54
54
  log: true
55
55
  # 分享链接二维码的类型,web为跳转到抖音网页,download为视频下载直链
56
- shareType: 'web'
56
+ shareType: 'web'
57
+ # 推送解析时视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质
58
+ # 可选值:'adapt'、'540p'、'720p'、'1080p'、'2k'、'4k'
59
+ videoQuality: '4k'
60
+
61
+ # 推送解析时视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效
62
+ maxAutoVideoSize: 50
package/lib/apps/admin.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import fs from "node:fs";
2
2
  import karin, { logger } from "node-karin";
3
3
  import require$$1 from "path";
4
- import "../core_chunk/db-CaO_rOgi.js";
4
+ import "../core_chunk/db-DfNMk-Qd.js";
5
5
  import "../root.js";
6
6
  import "../core_chunk/vendor-JPHpCiyC.js";
7
- import { C as Config, m as Common, n as bilibiliLogin } from "../core_chunk/main-KPfnncok.js";
7
+ import { C as Config, m as Common, n as bilibiliLogin } from "../core_chunk/main-CGW1iGhl.js";
8
8
  import "node-karin/axios";
9
9
  import "stream/promises";
10
10
  import "node:path";
package/lib/apps/help.js CHANGED
@@ -2,10 +2,10 @@ import fs from "node:fs";
2
2
  import { markdown } from "@karinjs/md-html";
3
3
  import karin, { logs, mkdirSync, render, segment } from "node-karin";
4
4
  import { karinPathTemp } from "node-karin/root";
5
- import "../core_chunk/db-CaO_rOgi.js";
5
+ import "../core_chunk/db-DfNMk-Qd.js";
6
6
  import { Root } from "../root.js";
7
7
  import "../core_chunk/vendor-JPHpCiyC.js";
8
- import { R as Render, m as Common } from "../core_chunk/main-KPfnncok.js";
8
+ import { R as Render, m as Common } from "../core_chunk/main-CGW1iGhl.js";
9
9
  import "node-karin/axios";
10
10
  import "stream/promises";
11
11
  const help = karin.command(/^#?kkk帮助$/, async (e) => {
package/lib/apps/push.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { a as getDouyinData, g as getBilibiliData, ag as amagi } from "../core_chunk/vendor-JPHpCiyC.js";
2
2
  import karin, { logger } from "node-karin";
3
- import { douyinDBInstance, bilibiliDBInstance } from "../core_chunk/db-CaO_rOgi.js";
3
+ import { douyinDBInstance, bilibiliDBInstance } from "../core_chunk/db-DfNMk-Qd.js";
4
4
  import "../root.js";
5
5
  import "node:fs";
6
- import { C as Config, o as wrapWithErrorHandler, B as Bilibilipush, D as DouYinpush, p as getDouyinID, N as Networks, R as Render, m as Common } from "../core_chunk/main-KPfnncok.js";
6
+ import { C as Config, o as wrapWithErrorHandler, B as Bilibilipush, D as DouYinpush, p as getDouyinID, N as Networks, R as Render, m as Common } from "../core_chunk/main-CGW1iGhl.js";
7
7
  import "node-karin/axios";
8
8
  const handleDouyinPush = wrapWithErrorHandler(async () => {
9
9
  await new DouYinpush().action();
@@ -126,14 +126,40 @@ const handleTestDouyinPush = wrapWithErrorHandler(async (e) => {
126
126
  pinglun: Common.count(workInfo.data.aweme_detail.statistics.comment_count),
127
127
  share: Common.count(workInfo.data.aweme_detail.statistics.share_count),
128
128
  shouchang: Common.count(workInfo.data.aweme_detail.statistics.collect_count),
129
- create_time: Common.convertTimestampToDateTime(workInfo.data.aweme_detail.create_time / 1e3),
129
+ create_time: Common.convertTimestampToDateTime(workInfo.data.aweme_detail.create_time),
130
130
  avater_url: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + userProfile.data.user.avatar_larger.uri,
131
131
  share_url: Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${workInfo.data.aweme_detail.video.play_addr.uri}&ratio=1080p&line=0`,
132
132
  username: workInfo.data.aweme_detail.author.nickname,
133
133
  抖音号: userProfile.data.user.unique_id === "" ? userProfile.data.user.short_id : userProfile.data.user.unique_id,
134
134
  粉丝: Common.count(userProfile.data.user.follower_count),
135
135
  获赞: Common.count(userProfile.data.user.total_favorited),
136
- 关注: Common.count(userProfile.data.user.following_count)
136
+ 关注: Common.count(userProfile.data.user.following_count),
137
+ cooperation_info: (() => {
138
+ const raw = workInfo.data.aweme_detail.cooperation_info;
139
+ if (!raw) return void 0;
140
+ const rawCreators = Array.isArray(raw.co_creators) ? raw.co_creators : [];
141
+ const author = workInfo.data.aweme_detail.author;
142
+ const authorUid = author?.uid;
143
+ const authorSecUid = author?.sec_uid;
144
+ const authorNickname = author?.nickname;
145
+ const authorInCreators = rawCreators.some(
146
+ (c) => authorUid && c.uid && c.uid === authorUid || authorSecUid && c.sec_uid && c.sec_uid === authorSecUid || authorNickname && c.nickname && c.nickname === authorNickname
147
+ );
148
+ const co_creators = rawCreators.map((c) => {
149
+ const firstUrl = c.avatar_thumb?.url_list?.[0] ?? (c.avatar_thumb?.uri ? `https://p3.douyinpic.com/${c.avatar_thumb.uri}` : void 0);
150
+ return {
151
+ avatar_thumb: firstUrl ? { url_list: [firstUrl] } : void 0,
152
+ nickname: c.nickname,
153
+ role_title: c.role_title
154
+ };
155
+ });
156
+ const baseCount = Math.max(Number(raw.co_creator_nums || 0), co_creators.length);
157
+ const teamCount = baseCount + (authorInCreators ? 0 : 1);
158
+ return {
159
+ co_creator_nums: teamCount,
160
+ co_creators
161
+ };
162
+ })()
137
163
  });
138
164
  e.reply(img);
139
165
  return true;
package/lib/apps/tools.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import karin, { logger } from "node-karin";
2
- import "../core_chunk/db-CaO_rOgi.js";
2
+ import "../core_chunk/db-DfNMk-Qd.js";
3
3
  import "../root.js";
4
4
  import "node:fs";
5
5
  import "../core_chunk/vendor-JPHpCiyC.js";
6
- import { o as wrapWithErrorHandler, C as Config, p as getDouyinID, q as DouYin, r as getBilibiliID, t as Bilibili, u as getKuaishouID, x as fetchKuaishouData, K as Kuaishou, m as Common } from "../core_chunk/main-KPfnncok.js";
6
+ import { o as wrapWithErrorHandler, C as Config, p as getDouyinID, q as DouYin, r as getBilibiliID, t as Bilibili, u as getKuaishouID, x as fetchKuaishouData, K as Kuaishou, m as Common } from "../core_chunk/main-CGW1iGhl.js";
7
7
  import "node-karin/axios";
8
8
  import "stream/promises";
9
9
  import "node:path";
@@ -5,7 +5,7 @@ import { karinPathBase } from "node-karin/root";
5
5
  import sqlite3 from "node-karin/sqlite3";
6
6
  import { Root } from "../root.js";
7
7
  import { D as DynamicType } from "./vendor-JPHpCiyC.js";
8
- import { C as Config } from "./main-KPfnncok.js";
8
+ import { C as Config } from "./main-CGW1iGhl.js";
9
9
  import "node-karin/axios";
10
10
  import "stream/promises";
11
11
  import "./template.js";
@@ -6,7 +6,7 @@ import axios, { AxiosError } from "node-karin/axios";
6
6
  import { pipeline } from "stream/promises";
7
7
  import path, { join } from "node:path";
8
8
  import reactServerRender from "./template.js";
9
- import { getDouyinDB, getBilibiliDB, cleanOldDynamicCache, bilibiliDBInstance, douyinDBInstance } from "./db-CaO_rOgi.js";
9
+ import { getDouyinDB, getBilibiliDB, cleanOldDynamicCache, bilibiliDBInstance, douyinDBInstance } from "./db-DfNMk-Qd.js";
10
10
  import template from "node-karin/template";
11
11
  import crypto from "node:crypto";
12
12
  import os from "node:os";
@@ -3810,12 +3810,6 @@ const webConfig = defineConfig({
3810
3810
  defaultSelected: all.douyin.realCommentCount,
3811
3811
  isDisabled: !all.douyin.sendContent.includes("comment") || !all.douyin.switch
3812
3812
  }),
3813
- components.switch.create("autoResolution", {
3814
- label: "自动分辨率",
3815
- description: "根据「视频拦截阈值」自动选择合适的分辨率,关闭后默认选择最大分辨率进行下载",
3816
- defaultSelected: all.douyin.autoResolution,
3817
- isDisabled: !all.douyin.switch
3818
- }),
3819
3813
  components.radio.group("videoQuality", {
3820
3814
  label: "画质偏好",
3821
3815
  description: "解析视频的分辨率偏好。",
@@ -4004,6 +3998,47 @@ const webConfig = defineConfig({
4004
3998
  value: "download"
4005
3999
  })
4006
4000
  ]
4001
+ }),
4002
+ components.radio.group("videoQuality", {
4003
+ label: "画质偏好",
4004
+ description: "推送解析时解析视频的分辨率偏好。",
4005
+ orientation: "horizontal",
4006
+ defaultValue: all.douyin.push.videoQuality.toString(),
4007
+ isDisabled: !all.douyin.push.switch,
4008
+ radio: [
4009
+ components.radio.create("videoQuality:radio-1", {
4010
+ label: "自动选择",
4011
+ value: "adapt",
4012
+ description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
4013
+ }),
4014
+ components.radio.create("videoQuality:radio-2", {
4015
+ label: "标清 540p",
4016
+ value: "540p"
4017
+ }),
4018
+ components.radio.create("videoQuality:radio-3", {
4019
+ label: "高清 720p",
4020
+ value: "720p"
4021
+ }),
4022
+ components.radio.create("videoQuality:radio-4", {
4023
+ label: "高清 1080p",
4024
+ value: "1080p"
4025
+ }),
4026
+ components.radio.create("videoQuality:radio-5", {
4027
+ label: "超清 2k",
4028
+ value: "2k"
4029
+ }),
4030
+ components.radio.create("videoQuality:radio-6", {
4031
+ label: "超清 4k",
4032
+ value: "4k"
4033
+ })
4034
+ ]
4035
+ }),
4036
+ components.input.number("maxAutoVideoSize", {
4037
+ label: "视频体积上限(MB)",
4038
+ description: '推送解析时根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效',
4039
+ defaultValue: all.douyin.push.maxAutoVideoSize.toString(),
4040
+ isDisabled: all.douyin.push.videoQuality !== "adapt" || !all.douyin.push.switch,
4041
+ rules: [{ min: 1, max: 2e4 }]
4007
4042
  })
4008
4043
  ]
4009
4044
  })
@@ -5128,7 +5163,7 @@ class DouYin extends Base {
5128
5163
  this.is_slides = false;
5129
5164
  }
5130
5165
  async RESOURCES(data) {
5131
- Config.app.EmojiReply && await this.e.bot.setMsgReaction(this.e.contact, this.e.messageId, Config.app.EmojiReplyID, true);
5166
+ Config.app.EmojiReply && !this.e.isPrivate && await this.e.bot.setMsgReaction(this.e.contact, this.e.messageId, Config.app.EmojiReplyID, true);
5132
5167
  if (Config.douyin.tip) this.e.reply("检测到抖音链接,开始解析");
5133
5168
  switch (this.type) {
5134
5169
  case "one_work": {
@@ -5771,7 +5806,33 @@ class DouYinpush extends Base {
5771
5806
  抖音号: Detail_Data.user_info.data.user.unique_id === "" ? Detail_Data.user_info.data.user.short_id : Detail_Data.user_info.data.user.unique_id,
5772
5807
  粉丝: this.count(Detail_Data.user_info.data.user.follower_count),
5773
5808
  获赞: this.count(Detail_Data.user_info.data.user.total_favorited),
5774
- 关注: this.count(Detail_Data.user_info.data.user.following_count)
5809
+ 关注: this.count(Detail_Data.user_info.data.user.following_count),
5810
+ cooperation_info: (() => {
5811
+ const raw = Detail_Data.cooperation_info;
5812
+ if (!raw) return void 0;
5813
+ const rawCreators = Array.isArray(raw.co_creators) ? raw.co_creators : [];
5814
+ const author = Detail_Data.author;
5815
+ const authorUid = author?.uid;
5816
+ const authorSecUid = author?.sec_uid;
5817
+ const authorNickname = author?.nickname;
5818
+ const authorInCreators = rawCreators.some(
5819
+ (c) => authorUid && c.uid && c.uid === authorUid || authorSecUid && c.sec_uid && c.sec_uid === authorSecUid || authorNickname && c.nickname && c.nickname === authorNickname
5820
+ );
5821
+ const co_creators = rawCreators.map((c) => {
5822
+ const firstUrl = c.avatar_thumb?.url_list?.[0] ?? (c.avatar_thumb?.uri ? `https://p3.douyinpic.com/${c.avatar_thumb.uri}` : void 0);
5823
+ return {
5824
+ avatar_thumb: firstUrl ? { url_list: [firstUrl] } : void 0,
5825
+ nickname: c.nickname,
5826
+ role_title: c.role_title
5827
+ };
5828
+ });
5829
+ const baseCount = Math.max(Number(raw.co_creator_nums || 0), co_creators.length);
5830
+ const teamCount = baseCount + (authorInCreators ? 0 : 1);
5831
+ return {
5832
+ co_creator_nums: teamCount,
5833
+ co_creators
5834
+ };
5835
+ })()
5775
5836
  });
5776
5837
  }
5777
5838
  }
@@ -5793,8 +5854,7 @@ class DouYinpush extends Base {
5793
5854
  if (iddata.is_mp4) {
5794
5855
  try {
5795
5856
  let downloadUrl = `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`;
5796
- if (Config.douyin.autoResolution) {
5797
- logger.debug(`开始排除不符合条件的视频分辨率;
5857
+ logger.debug(`开始排除不符合条件的视频分辨率;
5798
5858
 
5799
5859
  共拥有${logger.yellow(Detail_Data.video.bit_rate.length)}个视频源
5800
5860
 
@@ -5802,17 +5862,11 @@ class DouYinpush extends Base {
5802
5862
 
5803
5863
  分享链接:${logger.green(Detail_Data.share_url)}
5804
5864
  `);
5805
- const videoObj = douyinProcessVideos(Detail_Data.video.bit_rate, Config.upload.filelimit);
5806
- downloadUrl = await new Networks({
5807
- url: videoObj[0].play_addr.url_list[0],
5808
- headers: douyinBaseHeaders
5809
- }).getLongLink();
5810
- } else {
5811
- downloadUrl = await new Networks({
5812
- url: Detail_Data.video.bit_rate[0].play_addr.url_list[0] ?? Detail_Data.video.play_addr_h264.url_list[0] ?? Detail_Data.video.play_addr_h264.url_list[0],
5813
- headers: douyinBaseHeaders
5814
- }).getLongLink();
5815
- }
5865
+ const videoObj = douyinProcessVideos(Detail_Data.video.bit_rate, Config.douyin.videoQuality);
5866
+ downloadUrl = await new Networks({
5867
+ url: videoObj[0].play_addr.url_list[0],
5868
+ headers: douyinBaseHeaders
5869
+ }).getLongLink();
5816
5870
  await downloadVideo(this.e, {
5817
5871
  video_url: downloadUrl,
5818
5872
  title: { timestampTitle: `tmp_${Date.now()}.mp4`, originTitle: `${Detail_Data.desc}.mp4` }
@@ -851,6 +851,17 @@ interface DouyinDynamicProps extends BaseComponentProps {
851
851
  粉丝: string;
852
852
  /** 分享链接 */
853
853
  share_url: string;
854
+ /** 合作信息 */
855
+ cooperation_info?: {
856
+ co_creator_nums: number;
857
+ co_creators: Array<{
858
+ avatar_thumb: {
859
+ url_list: string[];
860
+ };
861
+ nickname: string;
862
+ role_title: string;
863
+ }>;
864
+ };
854
865
  };
855
866
  /** 预生成的二维码数据URL */
856
867
  qrCodeDataUrl: string;
@@ -1,6 +1,6 @@
1
1
  import fs, { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import path from "node:path";
3
- import { c as Chalk, s as server_browserExports, d as browserExports, r as reactExports, j as jsxRuntimeExports, H as HeroUIProvider, e as clsx, f as CircleCheckBig, T as TriangleAlert, I as Info, i as Code, Z as Zap, k as MessageCircle, m as Heart, Q as QrCode, B as Bookmark, S as Share2, n as Clock, o as Hash, E as Eye, U as Users, p as Music, q as UserPlus, t as Star, u as TrendingUp, v as chip_default, x as button_default, y as ExternalLink, z as ThumbsUp, A as ThumbsDown, F as Shield, G as Crown, J as code_default, P as Play, K as Calendar, L as Coins, R as Radio, N as Send, O as CircleAlert, V as Terminal, W as FileText, X as Sparkles, Y as Palette, _ as Monitor, $ as Globe, a0 as Bug, a1 as Layers, a2 as RefreshCw, a3 as TestTube, a4 as Package, a5 as GitBranch, a6 as Settings, a7 as card_default, a8 as card_body_default } from "./vendor-JPHpCiyC.js";
3
+ import { c as Chalk, s as server_browserExports, d as browserExports, r as reactExports, j as jsxRuntimeExports, H as HeroUIProvider, e as clsx, f as CircleCheckBig, T as TriangleAlert, I as Info, i as Code, Z as Zap, k as MessageCircle, m as Heart, Q as QrCode, B as Bookmark, S as Share2, n as Clock, U as Users, o as Hash, E as Eye, p as Music, q as UserPlus, t as Star, u as TrendingUp, v as chip_default, x as button_default, y as ExternalLink, z as ThumbsUp, A as ThumbsDown, F as Shield, G as Crown, J as code_default, P as Play, K as Calendar, L as Coins, R as Radio, N as Send, O as CircleAlert, V as Terminal, W as FileText, X as Sparkles, Y as Palette, _ as Monitor, $ as Globe, a0 as Bug, a1 as Layers, a2 as RefreshCw, a3 as TestTube, a4 as Package, a5 as GitBranch, a6 as Settings, a7 as card_default, a8 as card_body_default } from "./vendor-JPHpCiyC.js";
4
4
  var PlatformType = /* @__PURE__ */ ((PlatformType2) => {
5
5
  PlatformType2["DOUYIN"] = "douyin";
6
6
  PlatformType2["BILIBILI"] = "bilibili";
@@ -1456,19 +1456,32 @@ const UserInfoSection$1 = ({
1456
1456
  douyinId,
1457
1457
  likes,
1458
1458
  following,
1459
- followers
1459
+ followers,
1460
+ coCreatorCount
1460
1461
  }) => {
1461
1462
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col pl-16", children: [
1462
1463
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mb-6", children: [
1463
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1464
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center items-center mr-7 bg-white rounded-full w-54 h-54", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1464
1465
  "img",
1465
1466
  {
1466
1467
  src: avater_url,
1467
1468
  alt: "头像",
1468
- className: "w-[200px] h-[200px] rounded-full mr-7 shadow-large"
1469
+ className: "rounded-full w-51 h-51 shadow-large"
1469
1470
  }
1470
- ),
1471
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[80px] font-bold text-foreground-700 select-text", children: username }) })
1471
+ ) }),
1472
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
1473
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[80px] font-bold text-foreground-700 select-text", children: [
1474
+ "@",
1475
+ username
1476
+ ] }),
1477
+ coCreatorCount && coCreatorCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "gap-2 mt-3 inline-flex items-center rounded-[20px] bg-foreground-200 text-foreground-700 px-6 py-3 self-start", children: [
1478
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Users, { className: "w-8 h-8" }),
1479
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[34px] leading-none select-text text-foreground-700", children: [
1480
+ coCreatorCount,
1481
+ "人共创"
1482
+ ] })
1483
+ ] })
1484
+ ] })
1472
1485
  ] }),
1473
1486
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
1474
1487
  "div",
@@ -1510,11 +1523,7 @@ const UserInfoSection$1 = ({
1510
1523
  ] });
1511
1524
  };
1512
1525
  const QRCodeSection$3 = ({ qrCodeDataUrl }) => {
1513
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col-reverse items-center -mb-12 mr-18", children: [
1514
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-[45px] text-right mt-5 text-foreground-500 select-text", children: [
1515
- /* @__PURE__ */ jsxRuntimeExports.jsx(QrCode, { className: "w-11 h-11" }),
1516
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "作品直链:永久有效" })
1517
- ] }),
1526
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center w-[420px] mr-18", children: [
1518
1527
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-2.5 rounded-sm border-[7px] border-dashed border-divider", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1519
1528
  "img",
1520
1529
  {
@@ -1522,11 +1531,76 @@ const QRCodeSection$3 = ({ qrCodeDataUrl }) => {
1522
1531
  alt: "二维码",
1523
1532
  className: "w-[350px] h-[350px]"
1524
1533
  }
1525
- ) })
1534
+ ) }),
1535
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 text-[40px] text-foreground-500 mt-5 select-text", children: [
1536
+ /* @__PURE__ */ jsxRuntimeExports.jsx(QrCode, { className: "w-10 h-10" }),
1537
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "whitespace-nowrap", children: "作品直链:永久有效" })
1538
+ ] })
1526
1539
  ] });
1527
1540
  };
1541
+ const CoCreatorsInfo = ({ info }) => {
1542
+ const creators = info?.co_creators ?? [];
1543
+ if (creators.length === 0) return null;
1544
+ const items = creators.slice(0, 50);
1545
+ const listRef = reactExports.useRef(null);
1546
+ const [visibleCount, setVisibleCount] = reactExports.useState(items.length);
1547
+ reactExports.useEffect(() => {
1548
+ const calc = () => {
1549
+ const el = listRef.current;
1550
+ if (!el) return;
1551
+ const containerWidth = el.offsetWidth;
1552
+ const ITEM_W = 120;
1553
+ const GAP = 32;
1554
+ const PAD_R = 8;
1555
+ const capacity = Math.floor((containerWidth - PAD_R) / (ITEM_W + GAP));
1556
+ const needEllipsis = items.length > capacity;
1557
+ const nextVisible = needEllipsis ? Math.max(0, capacity - 1) : items.length;
1558
+ setVisibleCount(nextVisible);
1559
+ };
1560
+ calc();
1561
+ window.addEventListener("resize", calc);
1562
+ return () => window.removeEventListener("resize", calc);
1563
+ }, [items.length]);
1564
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col pl-16 w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1565
+ "div",
1566
+ {
1567
+ ref: listRef,
1568
+ className: "flex overflow-hidden gap-8 py-1 pr-2 w-full",
1569
+ style: { scrollbarWidth: "thin" },
1570
+ children: [
1571
+ items.slice(0, visibleCount).map((c, idx) => {
1572
+ const avatar = c.avatar_thumb?.url_list[0];
1573
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1574
+ "div",
1575
+ {
1576
+ className: "flex flex-col items-center min-w-[120px] w-[120px] flex-shrink-0",
1577
+ children: [
1578
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center items-center bg-white rounded-full h-21 w-21", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1579
+ "img",
1580
+ {
1581
+ src: avatar,
1582
+ alt: "共创者头像",
1583
+ className: "object-cover w-20 h-20 rounded-full"
1584
+ }
1585
+ ) }),
1586
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-[30px] font-medium text-foreground-700 text-center leading-tight w-full overflow-hidden whitespace-nowrap truncate select-text", children: c.nickname || "未提供" }),
1587
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[26px] text-foreground-600 text-center leading-tight w-full overflow-hidden whitespace-nowrap truncate select-text", children: c.role_title || "未提供" })
1588
+ ]
1589
+ },
1590
+ `${c.nickname || "creator"}-${idx}`
1591
+ );
1592
+ }),
1593
+ items.length > visibleCount && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center min-w-[120px] w-[120px] flex-shrink-0", children: [
1594
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center items-center bg-white rounded-full h-21 w-21", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[42px] leading-none text-foreground-500", children: "···" }) }),
1595
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-[26px] text-foreground-600 text-center leading-tight w-full overflow-hidden whitespace-nowrap truncate select-text", children: `还有${items.length - visibleCount}人` })
1596
+ ] })
1597
+ ]
1598
+ }
1599
+ ) });
1600
+ };
1528
1601
  const DouyinDynamic = (props) => {
1529
1602
  const { data, qrCodeDataUrl } = props;
1603
+ const coCreatorCount = data.cooperation_info?.co_creator_nums ?? (data.cooperation_info?.co_creators?.length ?? void 0);
1530
1604
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultLayout, { ...props, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
1531
1605
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[60px]" }),
1532
1606
  /* @__PURE__ */ jsxRuntimeExports.jsx(DouyinHeader$1, { useDarkTheme: data.useDarkTheme }),
@@ -1546,27 +1620,30 @@ const DouyinDynamic = (props) => {
1546
1620
  }
1547
1621
  ),
1548
1622
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-[100px]" }),
1549
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[70px] text-right mr-21 -mb-11 z-[-1] text-foreground-400 select-text", children: "抖音作品推送" }),
1550
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center px-0 pt-25", children: [
1551
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1552
- UserInfoSection$1,
1553
- {
1554
- avater_url: data.avater_url,
1555
- username: data.username,
1556
- douyinId: data.抖音号,
1557
- likes: data.获赞,
1558
- following: data.关注,
1559
- followers: data.粉丝,
1560
- useDarkTheme: data.useDarkTheme
1561
- }
1562
- ),
1563
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1564
- QRCodeSection$3,
1565
- {
1566
- qrCodeDataUrl,
1567
- useDarkTheme: data.useDarkTheme
1568
- }
1569
- )
1623
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-10 px-0 pt-25", children: [
1624
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CoCreatorsInfo, { info: data.cooperation_info }) }),
1625
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-start", children: [
1626
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-8 items-start w-[960px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1627
+ UserInfoSection$1,
1628
+ {
1629
+ avater_url: data.avater_url,
1630
+ username: data.username,
1631
+ douyinId: data.抖音号,
1632
+ likes: data.获赞,
1633
+ following: data.关注,
1634
+ followers: data.粉丝,
1635
+ useDarkTheme: data.useDarkTheme,
1636
+ coCreatorCount
1637
+ }
1638
+ ) }),
1639
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1640
+ QRCodeSection$3,
1641
+ {
1642
+ qrCodeDataUrl,
1643
+ useDarkTheme: data.useDarkTheme
1644
+ }
1645
+ )
1646
+ ] })
1570
1647
  ] })
1571
1648
  ] }) });
1572
1649
  };
package/lib/index.js CHANGED
@@ -3,15 +3,15 @@ import { a9 as libExports, aa as distExports, ab as logMiddleware, ac as createB
3
3
  import { authMiddleware, app as app$1, mkdirSync, logger as logger$1 } from "node-karin";
4
4
  import express from "node-karin/express";
5
5
  import { karinPathBase } from "node-karin/root";
6
- import "./core_chunk/db-CaO_rOgi.js";
6
+ import "./core_chunk/db-DfNMk-Qd.js";
7
7
  import { Root } from "./root.js";
8
8
  import "node:fs";
9
- import { C as Config, v as videoStreamRouter, g as getVideoRouter, s as signatureVerificationMiddleware, a as getLongLinkRouter, b as getDouyinDataRouter, c as getBilibiliDataRouter, d as getKuaishouDataRouter, e as getDouyinContentRouter, f as getBilibiliContentRouter, h as getGroupsRouter, i as getAuthorsRouter, j as addDouyinContentRouter, k as addBilibiliContentRouter, l as deleteContentRouter, m as Common } from "./core_chunk/main-KPfnncok.js";
10
- import { w } from "./core_chunk/main-KPfnncok.js";
9
+ import { C as Config, v as videoStreamRouter, g as getVideoRouter, s as signatureVerificationMiddleware, a as getLongLinkRouter, b as getDouyinDataRouter, c as getBilibiliDataRouter, d as getKuaishouDataRouter, e as getDouyinContentRouter, f as getBilibiliContentRouter, h as getGroupsRouter, i as getAuthorsRouter, j as addDouyinContentRouter, k as addBilibiliContentRouter, l as deleteContentRouter, m as Common } from "./core_chunk/main-CGW1iGhl.js";
10
+ import { w } from "./core_chunk/main-CGW1iGhl.js";
11
11
  import "node-karin/axios";
12
12
  import "stream/promises";
13
13
  import "./core_chunk/template.js";
14
- const { initAllDatabases } = await import("./core_chunk/db-CaO_rOgi.js");
14
+ const { initAllDatabases } = await import("./core_chunk/db-DfNMk-Qd.js");
15
15
  await initAllDatabases();
16
16
  const server = express();
17
17
  const proxyOptions = {