karin-plugin-kkk 1.5.0 → 1.6.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 +21 -0
- package/config/default_config/bilibili.yaml +16 -2
- package/config/default_config/douyin.yaml +1 -1
- package/lib/apps/admin.js +55 -3
- package/lib/apps/help.js +1 -2
- package/lib/apps/push.js +13 -484
- package/lib/apps/tools.js +4 -6
- package/lib/chunk/{douyin-CAomeaOP.js → index-DRX4XSDJ.js} +5516 -705
- package/lib/chunk/{index-BBNK7K_a.js → push-D60CjIo9.js} +1095 -2194
- package/lib/index.js +3 -3
- package/lib/web.config.js +818 -736
- package/package.json +2 -3
- package/lib/chunk/Render-HdCIiiGO.js +0 -71
- package/lib/chunk/getID-FOWzKupL.js +0 -2628
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# 变更日志
|
|
2
2
|
|
|
3
|
+
## [1.6.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.5.0...v1.6.0) (2025-05-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 细优 close [#85](https://github.com/ikenxuan/karin-plugin-kkk/issues/85) ([1f29c68](https://github.com/ikenxuan/karin-plugin-kkk/commit/1f29c680075460edbd4faa0329a58ffa96f9a944))
|
|
9
|
+
* 给B站推送添加画质偏好配置 ([471a84a](https://github.com/ikenxuan/karin-plugin-kkk/commit/471a84a445e06a75891883306e7211a9d04ce0fb))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **bilibili:** 适配UP关闭评论区 ([f3af874](https://github.com/ikenxuan/karin-plugin-kkk/commit/f3af8743e09a86a6a1ab7954ede81649c86c0607))
|
|
15
|
+
* close [#83](https://github.com/ikenxuan/karin-plugin-kkk/issues/83) ([e0f0156](https://github.com/ikenxuan/karin-plugin-kkk/commit/e0f01568597e351788be832e8175b50aebb3de38))
|
|
16
|
+
* **db:** 重构数据库初始化及配置同步逻辑 ([b5c4a89](https://github.com/ikenxuan/karin-plugin-kkk/commit/b5c4a89398ebbdaf96af3fd3332cc6797288a7d8))
|
|
17
|
+
* key重复 ([589cc28](https://github.com/ikenxuan/karin-plugin-kkk/commit/589cc28f0bb8667640db5be80212d72fdaba2a89))
|
|
18
|
+
* **utils:** 重构文件下载和上传功能,提取公共方法。燃尽了 ([7ff6e8a](https://github.com/ikenxuan/karin-plugin-kkk/commit/7ff6e8aca7849c09fc917d3df179b909cea69bee))
|
|
19
|
+
* 优化推送逻辑 close [#86](https://github.com/ikenxuan/karin-plugin-kkk/issues/86) ([8fd48f5](https://github.com/ikenxuan/karin-plugin-kkk/commit/8fd48f508c0cf984efebb0c6007bdc8cbc06cb36))
|
|
20
|
+
* 坠机了 ([471a84a](https://github.com/ikenxuan/karin-plugin-kkk/commit/471a84a445e06a75891883306e7211a9d04ce0fb))
|
|
21
|
+
* 奇怪的bug ([029b005](https://github.com/ikenxuan/karin-plugin-kkk/commit/029b005505657f656d9004102b909486be66d6ea))
|
|
22
|
+
* 移除多余amagi实例化并更新依赖版本 ([0c2dece](https://github.com/ikenxuan/karin-plugin-kkk/commit/0c2decee87de417c84894f80e3f047f786675e43))
|
|
23
|
+
|
|
3
24
|
## [1.5.0](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.4.1...v1.5.0) (2025-05-04)
|
|
4
25
|
|
|
5
26
|
|
|
@@ -33,7 +33,7 @@ maxAutoVideoSize: 50
|
|
|
33
33
|
autoResolution: true
|
|
34
34
|
|
|
35
35
|
# 谁可以触发扫码登录,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启
|
|
36
|
-
loginPerm:
|
|
36
|
+
loginPerm: master
|
|
37
37
|
|
|
38
38
|
# B站推送相关配置
|
|
39
39
|
push:
|
|
@@ -46,4 +46,18 @@ push:
|
|
|
46
46
|
# 推送时是否一同解析该动态
|
|
47
47
|
parsedynamic: false
|
|
48
48
|
# 是否打印日志
|
|
49
|
-
log: true
|
|
49
|
+
log: true
|
|
50
|
+
# 推送时遇到视频动态时解析的画质偏好设置,0 为自动根据「pushMaxAutoVideoSize」大小选择,其他为固定画质,仅「parsedynamic」为 true 时生效
|
|
51
|
+
# - 0: 自动根据大小选择
|
|
52
|
+
# - 6: 240P 极速 (仅MP4格式支持)
|
|
53
|
+
# - 16: 360P 流畅
|
|
54
|
+
# - 32: 480P 清晰
|
|
55
|
+
# - 64: 720P 高清 (WEB默认值)
|
|
56
|
+
# - 74: 720P60 高帧率 (需登录)
|
|
57
|
+
# - 80: 1080P 高清 (TV/APP默认值,需登录)
|
|
58
|
+
# - 112: 1080P+ 高码率 (需大会员)
|
|
59
|
+
# - 116: 1080P60 高帧率 (需大会员)
|
|
60
|
+
# - 120: 4K 超清 (需大会员且支持4K)
|
|
61
|
+
pushVideoQuality: 0
|
|
62
|
+
# 推送时遇到视频动态时解析的视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「pushVideoQuality」 为 0 且「parsedynamic」为 true时生效
|
|
63
|
+
pushMaxAutoVideoSize: 50
|
package/lib/apps/admin.js
CHANGED
|
@@ -1,16 +1,68 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
import karin, {
|
|
2
|
+
import karin, { segment, common, handler, logger } from "node-karin";
|
|
3
3
|
import require$$1 from "path";
|
|
4
4
|
import "sequelize";
|
|
5
|
-
import { C as Common, a as Config } from "../chunk/
|
|
5
|
+
import { g as getBilibiliData, f as browserExports, C as Common, a as Config } from "../chunk/index-DRX4XSDJ.js";
|
|
6
6
|
import { Version } from "../Version.js";
|
|
7
7
|
import "node-karin/axios";
|
|
8
8
|
import "stream/promises";
|
|
9
9
|
import "node:path";
|
|
10
|
-
import
|
|
10
|
+
import "../chunk/push-D60CjIo9.js";
|
|
11
11
|
import "../chunk/index-BDlGFCbK.js";
|
|
12
12
|
import { execSync, spawn } from "node:child_process";
|
|
13
13
|
import { chromium } from "playwright";
|
|
14
|
+
const bilibiliLogin = async (e) => {
|
|
15
|
+
const qrcodeurl = await getBilibiliData("申请二维码");
|
|
16
|
+
const qrimg = await browserExports.toDataURL(qrcodeurl.data.url);
|
|
17
|
+
const base64Data = qrimg ? qrimg.replace(/^data:image\/\w+;base64,/, "") : "";
|
|
18
|
+
const buffer = Buffer.from(base64Data, "base64");
|
|
19
|
+
fs.writeFileSync(`${Common.tempDri.default}BilibiliLoginQrcode.png`, buffer);
|
|
20
|
+
const qrcode_key = qrcodeurl.data.qrcode_key;
|
|
21
|
+
const msg_id = [];
|
|
22
|
+
const message1 = await e.reply("免责声明:\n您将通过扫码完成获取哔哩哔哩网页端的用户登录凭证(ck),该ck将用于请求哔哩哔哩WEB API接口。\n本BOT不会上传任何有关你的信息到第三方,所配置的 ck 只会用于请求官方 API 接口。\n我方仅提供视频解析及相关哔哩哔哩内容服务,若您的账号封禁、被盗等处罚与我方无关。\n害怕风险请勿扫码 ~");
|
|
23
|
+
const message2 = await e.reply([segment.image(qrimg.split(";")[1].replace("base64,", "base64://")), segment.text("请在120秒内通过哔哩哔哩APP扫码进行登录")], { reply: true });
|
|
24
|
+
msg_id.push(message1.messageId, message2.messageId);
|
|
25
|
+
let executed86090 = false;
|
|
26
|
+
let completedCase0 = false;
|
|
27
|
+
for (let i = 0; i < 33; i++) {
|
|
28
|
+
const qrcodestatusdata = await getBilibiliData("二维码状态", { qrcode_key });
|
|
29
|
+
switch (qrcodestatusdata.data.data.code) {
|
|
30
|
+
case 0: {
|
|
31
|
+
Config.Modify("cookies", "bilibili", Common.formatCookies(qrcodestatusdata.headers["set-cookie"]));
|
|
32
|
+
await e.reply("登录成功!用户登录凭证已保存至cookies.yaml", { reply: true });
|
|
33
|
+
await Promise.all(msg_id.map(async (id) => {
|
|
34
|
+
await e.bot.recallMsg(e.contact, id);
|
|
35
|
+
}));
|
|
36
|
+
completedCase0 = true;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case 86038: {
|
|
40
|
+
i === 17 && await e.reply("二维码已失效", { reply: true });
|
|
41
|
+
await Promise.all(msg_id.map(async (id) => {
|
|
42
|
+
await e.bot.recallMsg(e.contact, id);
|
|
43
|
+
}));
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case 86090: {
|
|
47
|
+
if (!executed86090) {
|
|
48
|
+
const message3 = await e.reply("二维码已扫码,未确认", { reply: true });
|
|
49
|
+
msg_id.push(message3.messageId);
|
|
50
|
+
await e.bot.recallMsg(e.contact, message2.messageId);
|
|
51
|
+
executed86090 = true;
|
|
52
|
+
const index = msg_id.indexOf(message2.messageId);
|
|
53
|
+
if (index > -1) {
|
|
54
|
+
msg_id.splice(index, 1);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
executed86090 = true;
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (completedCase0) break;
|
|
63
|
+
await common.sleep(5e3);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
14
66
|
const startXvfb = async () => {
|
|
15
67
|
if (process.platform !== "linux") return;
|
|
16
68
|
const DISPLAY_NUMBER = ":150";
|
package/lib/apps/help.js
CHANGED
|
@@ -4,11 +4,10 @@ import { m as markdown } from "../chunk/index-BDlGFCbK.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 { a as Config, C as Common } from "../chunk/
|
|
7
|
+
import { R as Render, a as Config, C as Common } from "../chunk/index-DRX4XSDJ.js";
|
|
8
8
|
import { Version } from "../Version.js";
|
|
9
9
|
import "node-karin/axios";
|
|
10
10
|
import "stream/promises";
|
|
11
|
-
import { R as Render } from "../chunk/Render-HdCIiiGO.js";
|
|
12
11
|
const help = karin.command(/^#?kkk帮助$/, async (e) => {
|
|
13
12
|
const img = await Render("help/index");
|
|
14
13
|
await e.reply(img);
|