karin-plugin-kkk 2.2.1 → 2.4.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 +20 -0
- package/config/default_config/cookies.yaml +4 -1
- package/config/default_config/douyin.yaml +7 -1
- package/config/default_config/xiaohongshu.yaml +21 -0
- package/lib/apps/admin.js +3 -3
- package/lib/apps/help.js +3 -3
- package/lib/apps/push.js +31 -5
- package/lib/apps/tools.js +28 -5
- package/lib/core_chunk/{db-CaO_rOgi.js → db-BQZ7FLWw.js} +2 -2
- package/lib/core_chunk/{main-KPfnncok.js → main-PJBwqzbd.js} +677 -41
- package/lib/core_chunk/template.d.ts +199 -1
- package/lib/core_chunk/template.js +652 -119
- package/lib/core_chunk/{vendor-JPHpCiyC.js → vendor-ClxefV4m.js} +9666 -6259
- package/lib/index.js +5 -5
- package/lib/karin-plugin-kkk.css +230 -100
- package/lib/web.config.js +1 -1
- package/lib/web_chunk/assets/Combination-D_5Ir4bk.js +46 -0
- package/lib/web_chunk/assets/avatar-B6bodyNx.js +9 -0
- package/lib/web_chunk/assets/{eye-BxeT5HFs.js → eye-C5LXx-QQ.js} +2 -2
- package/lib/web_chunk/assets/{index-DJP3w2Qn.css → index-B1B6YwEy.css} +1 -1
- package/lib/web_chunk/assets/index-C4TKq9eG.js +487 -0
- package/lib/web_chunk/assets/index-Hi9W4UQy.js +6 -0
- package/lib/web_chunk/assets/page-BWD5DRhn.js +45 -0
- package/lib/web_chunk/assets/page-BenUenxb.js +31 -0
- package/lib/web_chunk/assets/page-Blcu1-_e.js +16 -0
- package/lib/web_chunk/assets/page-CQQ9mzE-.js +114 -0
- package/lib/web_chunk/assets/page-D8sJPU-r.js +11 -0
- package/lib/web_chunk/assets/request-BW_hZUK3.js +19 -0
- package/lib/web_chunk/assets/select-BUvKOwyZ.js +16 -0
- package/lib/web_chunk/assets/separator-DgC6OX8V.js +1 -0
- package/lib/web_chunk/index.html +2 -2
- package/lib/web_chunk/sw.js +1 -1
- package/package.json +2 -2
- package/resources/image/logo.png +0 -0
- package/resources/image/xiaohongshu/logo.png +0 -0
- package/lib/web_chunk/assets/Combination-BCnLQi9v.js +0 -46
- package/lib/web_chunk/assets/avatar-BvjzRasU.js +0 -9
- package/lib/web_chunk/assets/index-BQ2cc-r7.js +0 -6
- package/lib/web_chunk/assets/index-Y4gvUbtc.js +0 -487
- package/lib/web_chunk/assets/page--RU98vg4.js +0 -45
- package/lib/web_chunk/assets/page-8Yq60PN7.js +0 -114
- package/lib/web_chunk/assets/page-BRBM7hxv.js +0 -11
- package/lib/web_chunk/assets/page-C5UdAH-t.js +0 -16
- package/lib/web_chunk/assets/page-CstfGsHQ.js +0 -31
- package/lib/web_chunk/assets/request-B24HulFR.js +0 -19
- package/lib/web_chunk/assets/select-DoB-rxPN.js +0 -16
- package/lib/web_chunk/assets/separator-BwB3hcig.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# 变更日志
|
|
2
2
|
|
|
3
|
+
## [2.4.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.3.0...v2.4.0) (2025-10-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ✨ 新功能
|
|
7
|
+
|
|
8
|
+
* **core:** 新增小红书解析 ([#166](https://github.com/ikenxuan/karin-plugin-kkk/issues/166)) ([7c7e05e](https://github.com/ikenxuan/karin-plugin-kkk/commit/7c7e05e5765cff1f14030f3ab0f1fdd45c5032e3))
|
|
9
|
+
|
|
10
|
+
## [2.3.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.2.1...v2.3.0) (2025-10-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ✨ 新功能
|
|
14
|
+
|
|
15
|
+
* **douyin:** 添加共创信息展示功能并优化视频画质选择 ([88295a1](https://github.com/ikenxuan/karin-plugin-kkk/commit/88295a1a319ec2006b2e74c70ef67bcae774a779))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### 🐛 错误修复
|
|
19
|
+
|
|
20
|
+
* release ([1e864f3](https://github.com/ikenxuan/karin-plugin-kkk/commit/1e864f3fb206dbb4bd6c0b941845e60e7699d2ad))
|
|
21
|
+
* 私聊不进行表情回复 close [#162](https://github.com/ikenxuan/karin-plugin-kkk/issues/162) ([da82635](https://github.com/ikenxuan/karin-plugin-kkk/commit/da826359e95b77cbe9705e6c84708b4a775b8786))
|
|
22
|
+
|
|
3
23
|
## [2.2.1](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.2.0...v2.2.1) (2025-10-08)
|
|
4
24
|
|
|
5
25
|
|
|
@@ -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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 小红书解析开关,单独开关,受「总开关」影响
|
|
2
|
+
switch: true
|
|
3
|
+
|
|
4
|
+
# 小红书解析提示,发送提示信息:"检测到小红书链接,开始解析"
|
|
5
|
+
tip: true
|
|
6
|
+
|
|
7
|
+
# 解析时发送的内容,可选值:'info'(笔记、视频信息)、'comment'(评论图片)、'image'(笔记图片)、'video'(视频文件)
|
|
8
|
+
sendContent:
|
|
9
|
+
- 'info'
|
|
10
|
+
- 'comment'
|
|
11
|
+
- 'image'
|
|
12
|
+
- 'video'
|
|
13
|
+
|
|
14
|
+
# 小红书评论数量(预留)
|
|
15
|
+
numcomment: 10
|
|
16
|
+
|
|
17
|
+
# 视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质
|
|
18
|
+
videoQuality: 'adapt'
|
|
19
|
+
|
|
20
|
+
# 视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效
|
|
21
|
+
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-
|
|
4
|
+
import "../core_chunk/db-BQZ7FLWw.js";
|
|
5
5
|
import "../root.js";
|
|
6
|
-
import "../core_chunk/vendor-
|
|
7
|
-
import { C as Config, m as Common, n as bilibiliLogin } from "../core_chunk/main-
|
|
6
|
+
import "../core_chunk/vendor-ClxefV4m.js";
|
|
7
|
+
import { C as Config, m as Common, n as bilibiliLogin } from "../core_chunk/main-PJBwqzbd.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-
|
|
5
|
+
import "../core_chunk/db-BQZ7FLWw.js";
|
|
6
6
|
import { Root } from "../root.js";
|
|
7
|
-
import "../core_chunk/vendor-
|
|
8
|
-
import { R as Render, m as Common } from "../core_chunk/main-
|
|
7
|
+
import "../core_chunk/vendor-ClxefV4m.js";
|
|
8
|
+
import { R as Render, m as Common } from "../core_chunk/main-PJBwqzbd.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
|
-
import { a as getDouyinData, g as getBilibiliData,
|
|
1
|
+
import { a as getDouyinData, g as getBilibiliData, ah as amagi } from "../core_chunk/vendor-ClxefV4m.js";
|
|
2
2
|
import karin, { logger } from "node-karin";
|
|
3
|
-
import { douyinDBInstance, bilibiliDBInstance } from "../core_chunk/db-
|
|
3
|
+
import { douyinDBInstance, bilibiliDBInstance } from "../core_chunk/db-BQZ7FLWw.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-
|
|
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-PJBwqzbd.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
|
|
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-
|
|
2
|
+
import "../core_chunk/db-BQZ7FLWw.js";
|
|
3
3
|
import "../root.js";
|
|
4
4
|
import "node:fs";
|
|
5
|
-
import "../core_chunk/vendor-
|
|
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-
|
|
5
|
+
import "../core_chunk/vendor-ClxefV4m.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, y as getXiaohongshuID, X as Xiaohongshu, m as Common } from "../core_chunk/main-PJBwqzbd.js";
|
|
7
7
|
import "node-karin/axios";
|
|
8
8
|
import "stream/promises";
|
|
9
9
|
import "node:path";
|
|
@@ -11,7 +11,8 @@ import "../core_chunk/template.js";
|
|
|
11
11
|
const reg = {
|
|
12
12
|
douyin: /^.*((www|v|jx|m)\.(douyin|iesdouyin)\.com|douyin\.com\/(video|note)).*/,
|
|
13
13
|
bilibili: /(bilibili.com|b23.tv|t.bilibili.com|bili2233.cn|BV[a-zA-Z0-9]{10,})/,
|
|
14
|
-
kuaishou: /^((.*)快手(.*)快手(.*)|(.*)v\.kuaishou(.*)|(.*)kuaishou\.com\/f\/[a-zA-Z0-9]+.*)
|
|
14
|
+
kuaishou: /^((.*)快手(.*)快手(.*)|(.*)v\.kuaishou(.*)|(.*)kuaishou\.com\/f\/[a-zA-Z0-9]+.*)$/,
|
|
15
|
+
xiaohongshu: /(xiaohongshu\.com|xhslink\.com)/
|
|
15
16
|
};
|
|
16
17
|
const handleDouyin = wrapWithErrorHandler(async (e) => {
|
|
17
18
|
const url = String(e.msg.match(/(http|https):\/\/.*\.(douyin|iesdouyin)\.com\/[^ ]+/g));
|
|
@@ -50,6 +51,20 @@ const handleKuaishou = wrapWithErrorHandler(async (e) => {
|
|
|
50
51
|
}, {
|
|
51
52
|
businessName: "快手视频解析"
|
|
52
53
|
});
|
|
54
|
+
const handleXiaohongshu = wrapWithErrorHandler(async (e) => {
|
|
55
|
+
const cleaned = e.msg.replaceAll("\\", "");
|
|
56
|
+
const m = cleaned.match(/https?:\/\/[^\s"'<>]+/);
|
|
57
|
+
const url = m?.[0];
|
|
58
|
+
if (!url) {
|
|
59
|
+
logger.warn(`未能在消息中找到有效链接: ${e.msg}`);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
const iddata = await getXiaohongshuID(url);
|
|
63
|
+
await new Xiaohongshu(e, iddata).RESOURCES(iddata);
|
|
64
|
+
return true;
|
|
65
|
+
}, {
|
|
66
|
+
businessName: "小红书视频解析"
|
|
67
|
+
});
|
|
53
68
|
const handlePrefix = wrapWithErrorHandler(async (e) => {
|
|
54
69
|
e.msg = await Common.getReplyMessage(e);
|
|
55
70
|
if (reg.douyin.test(e.msg)) {
|
|
@@ -58,6 +73,8 @@ const handlePrefix = wrapWithErrorHandler(async (e) => {
|
|
|
58
73
|
return await handleBilibili(e);
|
|
59
74
|
} else if (reg.kuaishou.test(e.msg)) {
|
|
60
75
|
return await handleKuaishou(e);
|
|
76
|
+
} else if (reg.xiaohongshu.test(e.msg)) {
|
|
77
|
+
return await handleXiaohongshu(e);
|
|
61
78
|
}
|
|
62
79
|
}, {
|
|
63
80
|
businessName: "引用解析"
|
|
@@ -74,15 +91,21 @@ const kuaishou = karin.command(reg.kuaishou, handleKuaishou, {
|
|
|
74
91
|
name: "kkk-视频功能-快手",
|
|
75
92
|
priority: Config.app.videoTool ? -Infinity : 800
|
|
76
93
|
});
|
|
94
|
+
const xiaohongshu = karin.command(reg.xiaohongshu, handleXiaohongshu, {
|
|
95
|
+
name: "kkk-视频功能-小红书",
|
|
96
|
+
priority: Config.app.videoTool ? -Infinity : 800
|
|
97
|
+
});
|
|
77
98
|
const prefix = karin.command(/^#?(解析|kkk解析)/, handlePrefix, {
|
|
78
99
|
name: "kkk-视频功能-引用解析"
|
|
79
100
|
});
|
|
80
101
|
const douyinAPP = Config.douyin.switch && douyin;
|
|
81
102
|
const bilibiliAPP = Config.bilibili.switch && bilibili;
|
|
82
103
|
const kuaishouAPP = Config.kuaishou.switch && kuaishou;
|
|
104
|
+
const xiaohongshuAPP = Config.xiaohongshu.switch && xiaohongshu;
|
|
83
105
|
export {
|
|
84
106
|
bilibiliAPP,
|
|
85
107
|
douyinAPP,
|
|
86
108
|
kuaishouAPP,
|
|
87
|
-
prefix
|
|
109
|
+
prefix,
|
|
110
|
+
xiaohongshuAPP
|
|
88
111
|
};
|
|
@@ -4,8 +4,8 @@ import { logger } from "node-karin";
|
|
|
4
4
|
import { karinPathBase } from "node-karin/root";
|
|
5
5
|
import sqlite3 from "node-karin/sqlite3";
|
|
6
6
|
import { Root } from "../root.js";
|
|
7
|
-
import { D as DynamicType } from "./vendor-
|
|
8
|
-
import { C as Config } from "./main-
|
|
7
|
+
import { D as DynamicType } from "./vendor-ClxefV4m.js";
|
|
8
|
+
import { C as Config } from "./main-PJBwqzbd.js";
|
|
9
9
|
import "node-karin/axios";
|
|
10
10
|
import "stream/promises";
|
|
11
11
|
import "./template.js";
|