karin-plugin-kkk 1.6.6 → 1.6.8
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 +16 -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 +3 -3
- package/lib/chunk/{db-DtVxNKzM.js → db-C5Yqa6MH.js} +2 -2
- package/lib/chunk/{main-bbR-e0ov.js → main-BAO84QDi.js} +50 -23
- package/lib/chunk/{vendor-CmoJNPr7.js → vendor-FI9gb_Rv.js} +7779 -2931
- package/lib/index.js +4 -4
- package/lib/web.config.js +1 -1
- package/package.json +1 -1
- package/resources/template/bilibili/css/dynamic/DYNAMIC_TYPE_LIVE_RCMD.css +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# 变更日志
|
|
2
2
|
|
|
3
|
+
## [1.6.8](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.6.7...v1.6.8) (2025-06-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 修复在根目录创建无关日志 ([f7eccaa](https://github.com/ikenxuan/karin-plugin-kkk/commit/f7eccaae568cdaf3b45b5df3b9c0732ead28f5bb))
|
|
9
|
+
|
|
10
|
+
## [1.6.7](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.6.6...v1.6.7) (2025-06-05)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **bilibili:** 添加直播动态推送功能支持 ([231c7d7](https://github.com/ikenxuan/karin-plugin-kkk/commit/231c7d7a7ed9915819b55c9b6bb414276cee1996))
|
|
16
|
+
* **bilibili:** 调整内容显示顺序并优化消息段格式 ([1abc7f5](https://github.com/ikenxuan/karin-plugin-kkk/commit/1abc7f59522f33f92caf8048276b78dfe7e3234f))
|
|
17
|
+
* 优化类型导入使用type关键字 ([0d027d1](https://github.com/ikenxuan/karin-plugin-kkk/commit/0d027d1d313465f272fcc8f09507cd8b6da4c644))
|
|
18
|
+
|
|
3
19
|
## [1.6.6](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.6.5...v1.6.6) (2025-06-01)
|
|
4
20
|
|
|
5
21
|
|
package/lib/apps/admin.js
CHANGED
|
@@ -2,10 +2,10 @@ import fs from "node:fs";
|
|
|
2
2
|
import karin, { logger } from "node-karin";
|
|
3
3
|
import require$$1 from "path";
|
|
4
4
|
import "sequelize";
|
|
5
|
-
import "../chunk/db-
|
|
5
|
+
import "../chunk/db-C5Yqa6MH.js";
|
|
6
6
|
import "../root.js";
|
|
7
|
-
import "../chunk/vendor-
|
|
8
|
-
import { C as Config, a as Common, b as bilibiliLogin, d as douyinLogin } from "../chunk/main-
|
|
7
|
+
import "../chunk/vendor-FI9gb_Rv.js";
|
|
8
|
+
import { C as Config, a as Common, b as bilibiliLogin, d as douyinLogin } from "../chunk/main-BAO84QDi.js";
|
|
9
9
|
import "node-karin/axios";
|
|
10
10
|
import "stream/promises";
|
|
11
11
|
import "node:path";
|
package/lib/apps/help.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import { m as markdown } from "../chunk/vendor-
|
|
3
|
+
import { m as markdown } from "../chunk/vendor-FI9gb_Rv.js";
|
|
4
4
|
import karin, { mkdirSync, render, segment, isPackaged, updatePkg, updateGitPlugin, logger, common, restart } from "node-karin";
|
|
5
5
|
import { karinPathTemp } from "node-karin/root";
|
|
6
6
|
import "sequelize";
|
|
7
|
-
import "../chunk/db-
|
|
7
|
+
import "../chunk/db-C5Yqa6MH.js";
|
|
8
8
|
import { Root } from "../root.js";
|
|
9
|
-
import { R as Render, C as Config, a as Common } from "../chunk/main-
|
|
9
|
+
import { R as Render, C as Config, a as Common } from "../chunk/main-BAO84QDi.js";
|
|
10
10
|
import "node-karin/axios";
|
|
11
11
|
import "stream/promises";
|
|
12
12
|
const help = karin.command(/^#?kkk帮助$/, async (e) => {
|
package/lib/apps/push.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as getDouyinData, g as getBilibiliData } from "../chunk/vendor-
|
|
1
|
+
import { d as getDouyinData, g as getBilibiliData } from "../chunk/vendor-FI9gb_Rv.js";
|
|
2
2
|
import karin from "node-karin";
|
|
3
3
|
import "sequelize";
|
|
4
|
-
import "../chunk/db-
|
|
4
|
+
import "../chunk/db-C5Yqa6MH.js";
|
|
5
5
|
import "../root.js";
|
|
6
6
|
import "node:fs";
|
|
7
|
-
import { C as Config, c as DouYinpush, B as Bilibilipush } from "../chunk/main-
|
|
7
|
+
import { C as Config, c as DouYinpush, B as Bilibilipush } from "../chunk/main-BAO84QDi.js";
|
|
8
8
|
import "node-karin/axios";
|
|
9
9
|
import "stream/promises";
|
|
10
10
|
import "node:path";
|
package/lib/apps/tools.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import karin, { logger } from "node-karin";
|
|
2
2
|
import "sequelize";
|
|
3
|
-
import "../chunk/db-
|
|
3
|
+
import "../chunk/db-C5Yqa6MH.js";
|
|
4
4
|
import "../root.js";
|
|
5
5
|
import "node:fs";
|
|
6
|
-
import "../chunk/vendor-
|
|
7
|
-
import { e as getDouyinID, f as DouYin, C as Config, h as getBilibiliID, i as Bilibili, j as getKuaishouID, k as fetchKuaishouData, K as Kuaishou, a as Common } from "../chunk/main-
|
|
6
|
+
import "../chunk/vendor-FI9gb_Rv.js";
|
|
7
|
+
import { e as getDouyinID, f as DouYin, C as Config, h as getBilibiliID, i as Bilibili, j as getKuaishouID, k as fetchKuaishouData, K as Kuaishou, a as Common } from "../chunk/main-BAO84QDi.js";
|
|
8
8
|
import "node-karin/axios";
|
|
9
9
|
import "stream/promises";
|
|
10
10
|
import "node:path";
|
|
@@ -4,8 +4,8 @@ import { logger } from "node-karin";
|
|
|
4
4
|
import { karinPathBase } from "node-karin/root";
|
|
5
5
|
import { Root } from "../root.js";
|
|
6
6
|
import "node:fs";
|
|
7
|
-
import "./vendor-
|
|
8
|
-
import { C as Config, D as DynamicType } from "./main-
|
|
7
|
+
import "./vendor-FI9gb_Rv.js";
|
|
8
|
+
import { C as Config, D as DynamicType } from "./main-BAO84QDi.js";
|
|
9
9
|
import "node-karin/axios";
|
|
10
10
|
import "stream/promises";
|
|
11
11
|
const sequelize$1 = new Sequelize({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Root } from "../root.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import { C as Client, b as bilibiliErrorCodeMap, g as getBilibiliData, a as bilibiliApiUrls, w as wbi_sign, c as browserExports, i as index, d as getDouyinData, h as heicConvertExports, m as markdown } from "./vendor-
|
|
3
|
+
import { C as Client, b as bilibiliErrorCodeMap, g as getBilibiliData, a as bilibiliApiUrls, w as wbi_sign, c as browserExports, i as index, d as getDouyinData, h as heicConvertExports, m as markdown } from "./vendor-FI9gb_Rv.js";
|
|
4
4
|
import karin, { logger, config, segment, createNotFoundResponse, copyConfigSync, filesByExt, watch, requireFileSync, ffmpeg, ffprobe, render, common, defineConfig, components, karinPathRoot, mkdirSync, handler } from "node-karin";
|
|
5
5
|
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 "sequelize";
|
|
9
|
-
import { douyinDB, bilibiliDB, cleanOldDynamicCache } from "./db-
|
|
9
|
+
import { douyinDB, bilibiliDB, cleanOldDynamicCache } from "./db-C5Yqa6MH.js";
|
|
10
10
|
import _ from "node-karin/lodash";
|
|
11
11
|
import { execSync, spawn } from "node:child_process";
|
|
12
12
|
import { chromium } from "playwright";
|
|
@@ -22,7 +22,6 @@ class Base {
|
|
|
22
22
|
this.headers = baseHeaders;
|
|
23
23
|
this._path = process.cwd()?.replace(/\\/g, "/");
|
|
24
24
|
const client = Client({ douyin: Config.cookies.douyin, bilibili: Config.cookies.bilibili, kuaishou: Config.cookies.kuaishou });
|
|
25
|
-
this.amagi = client;
|
|
26
25
|
this.amagi = new Proxy(client, {
|
|
27
26
|
get(target, prop) {
|
|
28
27
|
const method = target[prop];
|
|
@@ -197,8 +196,8 @@ const uploadFile = async (event, file, videoUrl, options) => {
|
|
|
197
196
|
return false;
|
|
198
197
|
} finally {
|
|
199
198
|
const filePath = file.filepath;
|
|
200
|
-
logger.mark(`临时预览地址:http://localhost:${process.env.HTTP_PORT}/api/kkk/video/${filePath.split("/").pop()}`);
|
|
201
|
-
logger.info(`文件 ${filePath} 将在 10 分钟后删除`);
|
|
199
|
+
logger.mark(`临时预览地址:http://localhost:${process.env.HTTP_PORT}/api/kkk/video/${encodeURIComponent(filePath.split("/").pop() ?? "")}`);
|
|
200
|
+
Config.app.rmmp4 && logger.info(`文件 ${filePath} 将在 10 分钟后删除`);
|
|
202
201
|
setTimeout(async () => {
|
|
203
202
|
await Common.removeFile(filePath);
|
|
204
203
|
}, 10 * 60 * 1e3);
|
|
@@ -779,7 +778,7 @@ class Cfg {
|
|
|
779
778
|
async syncConfigToDatabase() {
|
|
780
779
|
try {
|
|
781
780
|
const pushCfg = this.getYaml("config", "pushlist");
|
|
782
|
-
const { bilibiliDB: bilibiliDB2, douyinDB: douyinDB2 } = await import("./db-
|
|
781
|
+
const { bilibiliDB: bilibiliDB2, douyinDB: douyinDB2 } = await import("./db-C5Yqa6MH.js");
|
|
783
782
|
if (pushCfg.bilibili) {
|
|
784
783
|
await bilibiliDB2.syncConfigSubscriptions(pushCfg.bilibili);
|
|
785
784
|
}
|
|
@@ -1189,24 +1188,25 @@ class Bilibili extends Base {
|
|
|
1189
1188
|
if (Config.bilibili.displayContent && Config.bilibili.displayContent.length > 0) {
|
|
1190
1189
|
const contentMap = {
|
|
1191
1190
|
cover: segment.image(pic),
|
|
1192
|
-
title: `
|
|
1191
|
+
title: segment.text(`
|
|
1193
1192
|
📺 标题: ${title}
|
|
1194
|
-
|
|
1195
|
-
author: `
|
|
1193
|
+
`),
|
|
1194
|
+
author: segment.text(`
|
|
1196
1195
|
👤 作者: ${name}
|
|
1197
|
-
|
|
1198
|
-
stats: this.formatVideoStats(view, danmaku, like, coin, share, favorite),
|
|
1199
|
-
desc: `
|
|
1196
|
+
`),
|
|
1197
|
+
stats: segment.text(this.formatVideoStats(view, danmaku, like, coin, share, favorite)),
|
|
1198
|
+
desc: segment.text(`
|
|
1200
1199
|
|
|
1201
|
-
📝 简介: ${desc}`
|
|
1200
|
+
📝 简介: ${desc}`)
|
|
1202
1201
|
};
|
|
1203
|
-
|
|
1204
|
-
|
|
1202
|
+
const fixedOrder = ["cover", "title", "author", "stats", "desc"];
|
|
1203
|
+
fixedOrder.forEach((item) => {
|
|
1204
|
+
if (Config.bilibili.displayContent.includes(item) && contentMap[item]) {
|
|
1205
1205
|
replyContent.push(contentMap[item]);
|
|
1206
1206
|
}
|
|
1207
1207
|
});
|
|
1208
1208
|
if (replyContent.length > 0) {
|
|
1209
|
-
await this.e.reply(replyContent
|
|
1209
|
+
await this.e.reply(replyContent);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
1212
|
let videoSize = "";
|
|
@@ -1350,8 +1350,13 @@ ${this.downloadfilename}
|
|
|
1350
1350
|
case "dynamic_info": {
|
|
1351
1351
|
const dynamicInfo = await this.amagi.getBilibiliData("动态详情数据", { dynamic_id: iddata.dynamic_id });
|
|
1352
1352
|
const dynamicInfoCard = await this.amagi.getBilibiliData("动态卡片数据", { dynamic_id: dynamicInfo.data.item.id_str, typeMode: "strict" });
|
|
1353
|
-
const commentsData =
|
|
1354
|
-
|
|
1353
|
+
const commentsData = dynamicInfo.data.item.type !== DynamicType.LIVE_RCMD && await this.amagi.getBilibiliData("评论数据", {
|
|
1354
|
+
type: mapping_table(dynamicInfo.data.item.type),
|
|
1355
|
+
oid: oid(dynamicInfo, dynamicInfoCard),
|
|
1356
|
+
number: Config.bilibili.numcomment,
|
|
1357
|
+
typeMode: "strict"
|
|
1358
|
+
});
|
|
1359
|
+
const dynamicCARD = JSON.parse(dynamicInfoCard.data.card.card);
|
|
1355
1360
|
const userProfileData = await this.amagi.getBilibiliData("用户主页数据", { host_mid: dynamicInfo.data.item.modules.module_author.mid, typeMode: "strict" });
|
|
1356
1361
|
switch (dynamicInfo.data.item.type) {
|
|
1357
1362
|
/** 图文、纯图 */
|
|
@@ -1377,7 +1382,7 @@ ${this.downloadfilename}
|
|
|
1377
1382
|
}
|
|
1378
1383
|
await this.e.reply(img$1);
|
|
1379
1384
|
}
|
|
1380
|
-
const
|
|
1385
|
+
const dynamicCARD2 = JSON.parse(dynamicInfoCard.data.card.card);
|
|
1381
1386
|
if ("topic" in dynamicInfo.data.item.modules.module_dynamic && dynamicInfo.data.item.modules.module_dynamic.topic !== null) {
|
|
1382
1387
|
const name = dynamicInfo.data.item.modules.module_dynamic.topic.name;
|
|
1383
1388
|
dynamicInfo.data.item.modules.module_dynamic.desc.rich_text_nodes.unshift({
|
|
@@ -1390,7 +1395,7 @@ ${this.downloadfilename}
|
|
|
1390
1395
|
` + dynamicInfo.data.item.modules.module_dynamic.desc.text;
|
|
1391
1396
|
}
|
|
1392
1397
|
await this.e.reply(await Render("bilibili/dynamic/DYNAMIC_TYPE_DRAW", {
|
|
1393
|
-
image_url: cover(
|
|
1398
|
+
image_url: cover(dynamicCARD2.item.pictures),
|
|
1394
1399
|
text: replacetext(br$4(dynamicInfo.data.item.modules.module_dynamic.desc.text), dynamicInfo.data.item.modules.module_dynamic.desc.rich_text_nodes),
|
|
1395
1400
|
dianzan: Count(dynamicInfo.data.item.modules.module_stat.like.count),
|
|
1396
1401
|
pinglun: Count(dynamicInfo.data.item.modules.module_stat.comment.count),
|
|
@@ -1465,8 +1470,8 @@ ${this.downloadfilename}
|
|
|
1465
1470
|
break;
|
|
1466
1471
|
}
|
|
1467
1472
|
case DynamicType.DRAW: {
|
|
1468
|
-
const
|
|
1469
|
-
const cardData = JSON.parse(
|
|
1473
|
+
const dynamicCARD2 = await getBilibiliData("动态卡片数据", Config.cookies.bilibili, { dynamic_id: dynamicInfo.data.item.orig.id_str });
|
|
1474
|
+
const cardData = JSON.parse(dynamicCARD2.data.card.card);
|
|
1470
1475
|
data = {
|
|
1471
1476
|
username: checkvip$2(dynamicInfo.data.item.orig.modules.module_author),
|
|
1472
1477
|
create_time: Common.convertTimestampToDateTime(dynamicInfo.data.item.orig.modules.module_author.pub_ts),
|
|
@@ -1578,6 +1583,28 @@ ${this.downloadfilename}
|
|
|
1578
1583
|
}
|
|
1579
1584
|
break;
|
|
1580
1585
|
}
|
|
1586
|
+
/** 直播动态 */
|
|
1587
|
+
case DynamicType.LIVE_RCMD: {
|
|
1588
|
+
const userINFO = await getBilibiliData("用户主页数据", "", { host_mid: dynamicInfo.data.item.modules.module_author.mid, typeMode: "strict" });
|
|
1589
|
+
img$1 = await Render(
|
|
1590
|
+
"bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD",
|
|
1591
|
+
{
|
|
1592
|
+
image_url: [{ image_src: dynamicCARD.live_play_info.cover }],
|
|
1593
|
+
text: br$4(dynamicCARD.live_play_info.title),
|
|
1594
|
+
liveinf: br$4(`${dynamicCARD.live_play_info.area_name} | 房间号: ${dynamicCARD.live_play_info.room_id}`),
|
|
1595
|
+
username: checkvip$2(userINFO.data.card),
|
|
1596
|
+
avatar_url: userINFO.data.card.face,
|
|
1597
|
+
frame: dynamicInfo.data.item.modules.module_author.pendant.image,
|
|
1598
|
+
fans: Count(userINFO.data.follower),
|
|
1599
|
+
create_time: Common.convertTimestampToDateTime(dynamicInfo.data.item.modules.module_author.pub_ts),
|
|
1600
|
+
now_time: Common.getCurrentTime(),
|
|
1601
|
+
share_url: "https://live.bilibili.com/" + dynamicCARD.live_play_info.room_id,
|
|
1602
|
+
dynamicTYPE: "直播动态"
|
|
1603
|
+
}
|
|
1604
|
+
);
|
|
1605
|
+
await this.e.reply(img$1);
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1581
1608
|
default:
|
|
1582
1609
|
await this.e.reply(`该动态类型「${dynamicInfo.data.item.type}」暂未支持解析`);
|
|
1583
1610
|
break;
|
|
@@ -5330,7 +5357,7 @@ function handling_at(data) {
|
|
|
5330
5357
|
return data;
|
|
5331
5358
|
}
|
|
5332
5359
|
async function fetchKuaishouData(type, opt) {
|
|
5333
|
-
const client =
|
|
5360
|
+
const client = Client({ kuaishou: Config.cookies.kuaishou });
|
|
5334
5361
|
switch (type) {
|
|
5335
5362
|
case "one_work": {
|
|
5336
5363
|
const VideoData = await client.getKuaishouData("单个视频作品数据", {
|