karin-plugin-kkk 2.3.0 → 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 +7 -0
- package/config/default_config/cookies.yaml +4 -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 +3 -3
- package/lib/apps/tools.js +28 -5
- package/lib/core_chunk/{db-DfNMk-Qd.js → db-BQZ7FLWw.js} +2 -2
- package/lib/core_chunk/{main-CGW1iGhl.js → main-PJBwqzbd.js} +602 -20
- package/lib/core_chunk/template.d.ts +188 -1
- package/lib/core_chunk/template.js +544 -88
- package/lib/core_chunk/{vendor-JPHpCiyC.js → vendor-ClxefV4m.js} +9666 -6259
- package/lib/index.js +5 -5
- package/lib/karin-plugin-kkk.css +166 -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-DLInyL4G.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 +1 -1
- package/resources/image/logo.png +0 -0
- package/resources/image/xiaohongshu/logo.png +0 -0
- package/lib/web_chunk/assets/Combination-D5z6jy1Y.js +0 -46
- package/lib/web_chunk/assets/avatar-D_afNP80.js +0 -9
- package/lib/web_chunk/assets/index-Dnv5PtSP.js +0 -487
- package/lib/web_chunk/assets/index-TZAB3P5s.js +0 -6
- package/lib/web_chunk/assets/page-BBfx6QaG.js +0 -11
- package/lib/web_chunk/assets/page-BHTknkgx.js +0 -113
- package/lib/web_chunk/assets/page-CMmWq9fE.js +0 -45
- package/lib/web_chunk/assets/page-CzIhFa_l.js +0 -16
- package/lib/web_chunk/assets/page-vWafup7Y.js +0 -31
- package/lib/web_chunk/assets/request-Cc8-yIdp.js +0 -19
- package/lib/web_chunk/assets/select-BoplBOso.js +0 -16
- package/lib/web_chunk/assets/separator-DakeTVyQ.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## [2.3.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.2.1...v2.3.0) (2025-10-10)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -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();
|
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";
|