karin-plugin-kkk 1.6.8 → 1.6.9
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 +8 -0
- package/lib/apps/admin.js +2 -2
- package/lib/apps/help.js +2 -2
- package/lib/apps/push.js +2 -2
- package/lib/apps/tools.js +2 -2
- package/lib/chunk/{db-C5Yqa6MH.js → db-BwUYgCsJ.js} +1 -1
- package/lib/chunk/{main-BAO84QDi.js → main-NN4to0wU.js} +115 -32
- package/lib/index.js +3 -3
- package/lib/web.config.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# 变更日志
|
|
2
2
|
|
|
3
|
+
## [1.6.9](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.6.8...v1.6.9) (2025-06-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **web:** 更新插件配置和依赖项 ([380f538](https://github.com/ikenxuan/karin-plugin-kkk/commit/380f5386b77a4dd7ee5e7649dcf458c40da27b52))
|
|
9
|
+
* **推送配置:** 为推送列表添加启用开关功能 ([9865228](https://github.com/ikenxuan/karin-plugin-kkk/commit/98652285d07fda962af4dff313ac9ab9199a19eb))
|
|
10
|
+
|
|
3
11
|
## [1.6.8](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.6.7...v1.6.8) (2025-06-10)
|
|
4
12
|
|
|
5
13
|
|
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-BwUYgCsJ.js";
|
|
6
6
|
import "../root.js";
|
|
7
7
|
import "../chunk/vendor-FI9gb_Rv.js";
|
|
8
|
-
import { C as Config, a as Common, b as bilibiliLogin, d as douyinLogin } from "../chunk/main-
|
|
8
|
+
import { C as Config, a as Common, b as bilibiliLogin, d as douyinLogin } from "../chunk/main-NN4to0wU.js";
|
|
9
9
|
import "node-karin/axios";
|
|
10
10
|
import "stream/promises";
|
|
11
11
|
import "node:path";
|
package/lib/apps/help.js
CHANGED
|
@@ -4,9 +4,9 @@ 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-BwUYgCsJ.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-NN4to0wU.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
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-BwUYgCsJ.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-NN4to0wU.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-BwUYgCsJ.js";
|
|
4
4
|
import "../root.js";
|
|
5
5
|
import "node:fs";
|
|
6
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-
|
|
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-NN4to0wU.js";
|
|
8
8
|
import "node-karin/axios";
|
|
9
9
|
import "stream/promises";
|
|
10
10
|
import "node:path";
|
|
@@ -5,7 +5,7 @@ import { karinPathBase } from "node-karin/root";
|
|
|
5
5
|
import { Root } from "../root.js";
|
|
6
6
|
import "node:fs";
|
|
7
7
|
import "./vendor-FI9gb_Rv.js";
|
|
8
|
-
import { C as Config, D as DynamicType } from "./main-
|
|
8
|
+
import { C as Config, D as DynamicType } from "./main-NN4to0wU.js";
|
|
9
9
|
import "node-karin/axios";
|
|
10
10
|
import "stream/promises";
|
|
11
11
|
const sequelize$1 = new Sequelize({
|
|
@@ -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 "sequelize";
|
|
9
|
-
import { douyinDB, bilibiliDB, cleanOldDynamicCache } from "./db-
|
|
9
|
+
import { douyinDB, bilibiliDB, cleanOldDynamicCache } from "./db-BwUYgCsJ.js";
|
|
10
10
|
import _ from "node-karin/lodash";
|
|
11
11
|
import { execSync, spawn } from "node:child_process";
|
|
12
12
|
import { chromium } from "playwright";
|
|
@@ -530,7 +530,14 @@ class Cfg {
|
|
|
530
530
|
const config2 = YAML.parseDocument(fs.readFileSync(`${this.dirCfgPath}/${file}`, "utf8"));
|
|
531
531
|
const defConfig = YAML.parseDocument(fs.readFileSync(`${this.defCfgPath}/${file}`, "utf8"));
|
|
532
532
|
const { differences, result } = this.mergeObjectsWithPriority(config2, defConfig);
|
|
533
|
-
|
|
533
|
+
let needsUpdate = differences;
|
|
534
|
+
if (file === "pushlist.yaml") {
|
|
535
|
+
const updated = this.addSwitchFieldToPushlist(result);
|
|
536
|
+
if (updated) {
|
|
537
|
+
needsUpdate = true;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
if (needsUpdate) {
|
|
534
541
|
fs.writeFileSync(`${this.dirCfgPath}/${file}`, result.toString({ lineWidth: -1 }));
|
|
535
542
|
}
|
|
536
543
|
}
|
|
@@ -748,6 +755,40 @@ class Cfg {
|
|
|
748
755
|
}
|
|
749
756
|
this.setNestedValue(subMap, keys.slice(1), value);
|
|
750
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* 为推送列表配置添加switch字段兼容
|
|
760
|
+
* @param doc YAML文档
|
|
761
|
+
* @returns 是否有更新
|
|
762
|
+
*/
|
|
763
|
+
addSwitchFieldToPushlist(doc) {
|
|
764
|
+
let hasUpdates = false;
|
|
765
|
+
const contents = doc.contents;
|
|
766
|
+
const douyinList = contents.get("douyin");
|
|
767
|
+
if (YAML.isSeq(douyinList)) {
|
|
768
|
+
for (const item of douyinList.items) {
|
|
769
|
+
if (YAML.isMap(item)) {
|
|
770
|
+
const switchField = item.get("switch");
|
|
771
|
+
if (switchField === void 0) {
|
|
772
|
+
item.set("switch", true);
|
|
773
|
+
hasUpdates = true;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
const bilibiliList = contents.get("bilibili");
|
|
779
|
+
if (YAML.isSeq(bilibiliList)) {
|
|
780
|
+
for (const item of bilibiliList.items) {
|
|
781
|
+
if (YAML.isMap(item)) {
|
|
782
|
+
const switchField = item.get("switch");
|
|
783
|
+
if (switchField === void 0) {
|
|
784
|
+
item.set("switch", true);
|
|
785
|
+
hasUpdates = true;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return hasUpdates;
|
|
791
|
+
}
|
|
751
792
|
mergeObjectsWithPriority(userDoc, defaultDoc) {
|
|
752
793
|
let differences = false;
|
|
753
794
|
const mergeYamlNodes = (target, source) => {
|
|
@@ -778,7 +819,7 @@ class Cfg {
|
|
|
778
819
|
async syncConfigToDatabase() {
|
|
779
820
|
try {
|
|
780
821
|
const pushCfg = this.getYaml("config", "pushlist");
|
|
781
|
-
const { bilibiliDB: bilibiliDB2, douyinDB: douyinDB2 } = await import("./db-
|
|
822
|
+
const { bilibiliDB: bilibiliDB2, douyinDB: douyinDB2 } = await import("./db-BwUYgCsJ.js");
|
|
782
823
|
if (pushCfg.bilibili) {
|
|
783
824
|
await bilibiliDB2.syncConfigSubscriptions(pushCfg.bilibili);
|
|
784
825
|
}
|
|
@@ -2670,7 +2711,8 @@ https://t.bilibili.com/${dynamicId}`);
|
|
|
2670
2711
|
async getDynamicList(userList) {
|
|
2671
2712
|
const willbepushlist = {};
|
|
2672
2713
|
try {
|
|
2673
|
-
|
|
2714
|
+
const filteredUserList = userList.filter((item) => item.switch !== false);
|
|
2715
|
+
for (const item of filteredUserList) {
|
|
2674
2716
|
const dynamic_list = await this.amagi.getBilibiliData("用户主页动态列表数据", { host_mid: item.host_mid, typeMode: "strict" });
|
|
2675
2717
|
if (dynamic_list.data.items.length > 0) {
|
|
2676
2718
|
for (const dynamic of dynamic_list.data.items) {
|
|
@@ -2810,6 +2852,7 @@ UID:${host_mid}`);
|
|
|
2810
2852
|
data.data.card.name
|
|
2811
2853
|
);
|
|
2812
2854
|
config2.bilibili.push({
|
|
2855
|
+
switch: true,
|
|
2813
2856
|
host_mid,
|
|
2814
2857
|
group_id: [`${groupId}:${botId}`],
|
|
2815
2858
|
remark: data.data.card.name
|
|
@@ -3036,17 +3079,23 @@ const getVideoRouter = (req, res) => {
|
|
|
3036
3079
|
const webConfig = defineConfig({
|
|
3037
3080
|
info: {
|
|
3038
3081
|
id: "karin-plugin-kkk",
|
|
3039
|
-
name: "
|
|
3082
|
+
name: "kkk插件",
|
|
3040
3083
|
description: "Karin 的「抖音」「B站」视频解析/动态推送插件",
|
|
3041
3084
|
icon: {
|
|
3042
|
-
name: "
|
|
3043
|
-
color: "#
|
|
3085
|
+
name: "radio_button_checked",
|
|
3086
|
+
color: "#F31260"
|
|
3044
3087
|
},
|
|
3088
|
+
version: Root.pluginVersion,
|
|
3045
3089
|
author: [
|
|
3046
3090
|
{
|
|
3047
3091
|
name: "ikenxuan",
|
|
3048
3092
|
home: "https://github.com/ikenxuan",
|
|
3049
3093
|
avatar: "https://github.com/ikenxuan.png"
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
name: "sj817",
|
|
3097
|
+
home: "https://github.com/sj817",
|
|
3098
|
+
avatar: "https://github.com/sj817.png"
|
|
3050
3099
|
}
|
|
3051
3100
|
]
|
|
3052
3101
|
},
|
|
@@ -3135,8 +3184,9 @@ const webConfig = defineConfig({
|
|
|
3135
3184
|
}),
|
|
3136
3185
|
components.switch.create("APIServerMount", {
|
|
3137
3186
|
label: "挂载到 Karin",
|
|
3138
|
-
description: "API 服务是否挂载到 Karin 上,开启后监听端口为 Karin 的 http
|
|
3139
|
-
defaultSelected: all.app.APIServerMount
|
|
3187
|
+
description: "API 服务是否挂载到 Karin 上,开启后监听端口为 Karin 的 http 端口,修改后需重启。需开启「API服务」",
|
|
3188
|
+
defaultSelected: all.app.APIServerMount,
|
|
3189
|
+
isDisabled: !all.app.APIServer
|
|
3140
3190
|
}),
|
|
3141
3191
|
components.input.number("APIServerPort", {
|
|
3142
3192
|
label: "API服务端口",
|
|
@@ -3217,29 +3267,32 @@ const webConfig = defineConfig({
|
|
|
3217
3267
|
components.switch.create("tip", {
|
|
3218
3268
|
label: "解析提示",
|
|
3219
3269
|
description: "抖音解析提示,发送提示信息:“检测到抖音链接,开始解析”",
|
|
3220
|
-
defaultSelected: all.douyin.tip
|
|
3270
|
+
defaultSelected: all.douyin.tip,
|
|
3271
|
+
isDisabled: !all.douyin.switch
|
|
3221
3272
|
}),
|
|
3222
3273
|
components.switch.create("comment", {
|
|
3223
3274
|
label: "评论解析",
|
|
3224
3275
|
description: "抖音评论解析,开启后可发送抖音作品评论图",
|
|
3225
|
-
defaultSelected: all.douyin.comment
|
|
3276
|
+
defaultSelected: all.douyin.comment,
|
|
3277
|
+
isDisabled: !all.douyin.switch || !all.douyin.switch
|
|
3226
3278
|
}),
|
|
3227
3279
|
components.input.number("numcomment", {
|
|
3228
3280
|
label: "评论解析数量",
|
|
3229
3281
|
defaultValue: all.douyin.numcomment.toString(),
|
|
3230
3282
|
rules: [{ min: 1 }],
|
|
3231
|
-
isDisabled: !all.douyin.comment
|
|
3283
|
+
isDisabled: !all.douyin.comment || !all.douyin.switch
|
|
3232
3284
|
}),
|
|
3233
3285
|
components.switch.create("realCommentCount", {
|
|
3234
3286
|
label: "显示真实评论数量",
|
|
3235
3287
|
description: "评论图是否显示真实评论数量,关闭则显示解析到的评论数量",
|
|
3236
3288
|
defaultSelected: all.douyin.realCommentCount,
|
|
3237
|
-
isDisabled: !all.douyin.comment
|
|
3289
|
+
isDisabled: !all.douyin.comment || !all.douyin.switch
|
|
3238
3290
|
}),
|
|
3239
3291
|
components.switch.create("autoResolution", {
|
|
3240
3292
|
label: "自动分辨率",
|
|
3241
3293
|
description: "根据「视频拦截阈值」自动选择合适的分辨率,关闭后默认选择最大分辨率进行下载",
|
|
3242
|
-
defaultSelected: all.douyin.autoResolution
|
|
3294
|
+
defaultSelected: all.douyin.autoResolution,
|
|
3295
|
+
isDisabled: !all.douyin.switch
|
|
3243
3296
|
}),
|
|
3244
3297
|
components.radio.group("loginPerm", {
|
|
3245
3298
|
label: "谁可以触发扫码登录",
|
|
@@ -3284,6 +3337,7 @@ const webConfig = defineConfig({
|
|
|
3284
3337
|
description: "修改后需重启",
|
|
3285
3338
|
orientation: "horizontal",
|
|
3286
3339
|
defaultValue: all.douyin.push.permission,
|
|
3340
|
+
isDisabled: !all.douyin.push.switch,
|
|
3287
3341
|
color: "warning",
|
|
3288
3342
|
radio: [
|
|
3289
3343
|
components.radio.create("push:permission:radio-1", {
|
|
@@ -3312,25 +3366,29 @@ const webConfig = defineConfig({
|
|
|
3312
3366
|
label: "定时任务表达式",
|
|
3313
3367
|
description: "定时推送的时间,格式为cron表达式(默认为每十分钟执行一次)",
|
|
3314
3368
|
defaultValue: all.douyin.push.cron,
|
|
3315
|
-
color: "warning"
|
|
3369
|
+
color: "warning",
|
|
3370
|
+
isDisabled: !all.douyin.push.switch
|
|
3316
3371
|
}),
|
|
3317
3372
|
components.switch.create("push:parsedynamic", {
|
|
3318
3373
|
label: "作品解析",
|
|
3319
3374
|
description: "触发推送时是否一同解析该作品",
|
|
3320
3375
|
defaultSelected: all.douyin.push.parsedynamic,
|
|
3321
|
-
color: "warning"
|
|
3376
|
+
color: "warning",
|
|
3377
|
+
isDisabled: !all.douyin.push.switch
|
|
3322
3378
|
}),
|
|
3323
3379
|
components.switch.create("push:log", {
|
|
3324
3380
|
label: "推送日志",
|
|
3325
3381
|
description: "是否打印推送日志(修改后需重启)",
|
|
3326
3382
|
defaultSelected: all.douyin.push.log,
|
|
3327
|
-
color: "warning"
|
|
3383
|
+
color: "warning",
|
|
3384
|
+
isDisabled: !all.douyin.push.switch
|
|
3328
3385
|
}),
|
|
3329
3386
|
components.radio.group("push:shareType", {
|
|
3330
3387
|
label: "推送图二维码的类型",
|
|
3331
3388
|
orientation: "horizontal",
|
|
3332
3389
|
defaultValue: all.douyin.push.shareType,
|
|
3333
3390
|
color: "warning",
|
|
3391
|
+
isDisabled: !all.douyin.push.switch,
|
|
3334
3392
|
radio: [
|
|
3335
3393
|
components.radio.create("push:shareType.radio-1", {
|
|
3336
3394
|
label: "网页链接",
|
|
@@ -3364,34 +3422,39 @@ const webConfig = defineConfig({
|
|
|
3364
3422
|
components.switch.create("tip", {
|
|
3365
3423
|
label: "解析提示",
|
|
3366
3424
|
description: "B站解析提示,发送提示信息:“检测到B站链接,开始解析”",
|
|
3367
|
-
defaultSelected: all.bilibili.tip
|
|
3425
|
+
defaultSelected: all.bilibili.tip,
|
|
3426
|
+
isDisabled: !all.bilibili.switch
|
|
3368
3427
|
}),
|
|
3369
3428
|
components.switch.create("comment", {
|
|
3370
3429
|
label: "评论解析",
|
|
3371
3430
|
description: "B站评论解析,开启后可发送B站作品评论图",
|
|
3372
|
-
defaultSelected: all.bilibili.comment
|
|
3431
|
+
defaultSelected: all.bilibili.comment,
|
|
3432
|
+
isDisabled: !all.bilibili.switch
|
|
3373
3433
|
}),
|
|
3374
3434
|
components.input.number("numcomment", {
|
|
3375
3435
|
label: "评论解析数量",
|
|
3376
3436
|
defaultValue: all.bilibili.numcomment.toString(),
|
|
3377
|
-
rules: [{ min: 1 }]
|
|
3437
|
+
rules: [{ min: 1 }],
|
|
3438
|
+
isDisabled: !all.bilibili.comment || !all.bilibili.switch
|
|
3378
3439
|
}),
|
|
3379
3440
|
components.switch.create("realCommentCount", {
|
|
3380
3441
|
label: "显示真实评论数量",
|
|
3381
3442
|
description: "评论图是否显示真实评论数量,关闭则显示解析到的评论数量",
|
|
3382
3443
|
defaultSelected: all.bilibili.realCommentCount,
|
|
3383
|
-
isDisabled: !all.bilibili.comment
|
|
3444
|
+
isDisabled: !all.bilibili.comment || !all.bilibili.switch
|
|
3384
3445
|
}),
|
|
3385
3446
|
components.switch.create("videopriority", {
|
|
3386
3447
|
label: "优先保内容",
|
|
3387
3448
|
description: "解析视频是否优先保内容,true为优先保证上传将使用最低分辨率,false为优先保清晰度将使用最高分辨率",
|
|
3388
|
-
defaultSelected: all.bilibili.videopriority
|
|
3449
|
+
defaultSelected: all.bilibili.videopriority,
|
|
3450
|
+
isDisabled: !all.bilibili.switch
|
|
3389
3451
|
}),
|
|
3390
3452
|
components.radio.group("videoQuality", {
|
|
3391
3453
|
label: "画质偏好",
|
|
3392
3454
|
description: "解析视频的分辨率偏好。",
|
|
3393
3455
|
orientation: "horizontal",
|
|
3394
3456
|
defaultValue: all.bilibili.videoQuality.toString(),
|
|
3457
|
+
isDisabled: !all.bilibili.switch,
|
|
3395
3458
|
radio: [
|
|
3396
3459
|
components.radio.create("videoQuality:radio-1", {
|
|
3397
3460
|
label: "自动选择",
|
|
@@ -3446,7 +3509,7 @@ const webConfig = defineConfig({
|
|
|
3446
3509
|
label: "视频体积上限(MB)",
|
|
3447
3510
|
description: '根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效',
|
|
3448
3511
|
defaultValue: all.bilibili.maxAutoVideoSize.toString(),
|
|
3449
|
-
isDisabled: all.bilibili.videoQuality !== 0,
|
|
3512
|
+
isDisabled: all.bilibili.videoQuality !== 0 || !all.bilibili.switch,
|
|
3450
3513
|
rules: [{ min: 1, max: 2e4 }]
|
|
3451
3514
|
}),
|
|
3452
3515
|
components.radio.group("loginPerm", {
|
|
@@ -3482,6 +3545,7 @@ const webConfig = defineConfig({
|
|
|
3482
3545
|
description: "若什么都不选,则不会返回任何视频相关信息",
|
|
3483
3546
|
orientation: "horizontal",
|
|
3484
3547
|
defaultValue: all.bilibili.displayContent,
|
|
3548
|
+
isDisabled: !all.bilibili.switch,
|
|
3485
3549
|
checkbox: [
|
|
3486
3550
|
components.checkbox.create("displayContent:checkbox:1", {
|
|
3487
3551
|
label: "封面",
|
|
@@ -3521,6 +3585,7 @@ const webConfig = defineConfig({
|
|
|
3521
3585
|
orientation: "horizontal",
|
|
3522
3586
|
defaultValue: all.bilibili.push.permission,
|
|
3523
3587
|
color: "warning",
|
|
3588
|
+
isDisabled: !all.bilibili.push.switch,
|
|
3524
3589
|
radio: [
|
|
3525
3590
|
components.radio.create("push:permission:radio-1", {
|
|
3526
3591
|
label: "所有人",
|
|
@@ -3548,25 +3613,28 @@ const webConfig = defineConfig({
|
|
|
3548
3613
|
label: "定时任务表达式",
|
|
3549
3614
|
description: "定时推送的时间,格式为cron表达式(默认为每十分钟执行一次)",
|
|
3550
3615
|
defaultValue: all.bilibili.push.cron,
|
|
3551
|
-
color: "warning"
|
|
3616
|
+
color: "warning",
|
|
3617
|
+
isDisabled: !all.bilibili.push.switch
|
|
3552
3618
|
}),
|
|
3553
3619
|
components.switch.create("push:parsedynamic", {
|
|
3554
3620
|
label: "作品解析",
|
|
3555
3621
|
description: "触发推送时是否一同解析该作品",
|
|
3556
3622
|
defaultSelected: all.bilibili.push.parsedynamic,
|
|
3557
|
-
color: "warning"
|
|
3623
|
+
color: "warning",
|
|
3624
|
+
isDisabled: !all.bilibili.push.switch
|
|
3558
3625
|
}),
|
|
3559
3626
|
components.switch.create("push:log", {
|
|
3560
3627
|
label: "推送日志",
|
|
3561
3628
|
description: "是否打印推送日志(修改后需重启)",
|
|
3562
3629
|
defaultSelected: all.bilibili.push.log,
|
|
3563
|
-
color: "warning"
|
|
3630
|
+
color: "warning",
|
|
3631
|
+
isDisabled: !all.bilibili.push.switch
|
|
3564
3632
|
}),
|
|
3565
3633
|
components.radio.group("push:pushVideoQuality", {
|
|
3566
3634
|
label: "解析视频动态时的画质偏好",
|
|
3567
3635
|
description: "「作品解析」开启时生效,仅对视频动态有效",
|
|
3568
3636
|
orientation: "horizontal",
|
|
3569
|
-
isDisabled: !all.bilibili.push.parsedynamic,
|
|
3637
|
+
isDisabled: !all.bilibili.push.parsedynamic || !all.bilibili.push.switch,
|
|
3570
3638
|
defaultValue: all.bilibili.push.pushVideoQuality.toString(),
|
|
3571
3639
|
color: "warning",
|
|
3572
3640
|
radio: [
|
|
@@ -3623,7 +3691,7 @@ const webConfig = defineConfig({
|
|
|
3623
3691
|
label: "视频动态的视频体积上限(MB)",
|
|
3624
3692
|
description: '根据该值自动选择分辨率进行下载。仅在「解析视频动态时的画质偏好」 为 "自动选择" 且「作品解析」开启时生效,仅对视频动态有效',
|
|
3625
3693
|
defaultValue: all.bilibili.push.pushMaxAutoVideoSize.toString(),
|
|
3626
|
-
isDisabled: !all.bilibili.push.parsedynamic || all.bilibili.push.pushVideoQuality !== 0,
|
|
3694
|
+
isDisabled: !all.bilibili.push.parsedynamic || all.bilibili.push.pushVideoQuality !== 0 || !all.bilibili.push.switch,
|
|
3627
3695
|
rules: [{ min: 1, max: 2e4 }],
|
|
3628
3696
|
color: "warning"
|
|
3629
3697
|
})
|
|
@@ -3647,17 +3715,20 @@ const webConfig = defineConfig({
|
|
|
3647
3715
|
components.switch.create("tip", {
|
|
3648
3716
|
label: "解析提示",
|
|
3649
3717
|
description: "快手解析提示,发送提示信息:“检测到快手链接,开始解析”",
|
|
3650
|
-
defaultSelected: all.kuaishou.tip
|
|
3718
|
+
defaultSelected: all.kuaishou.tip,
|
|
3719
|
+
isDisabled: !all.kuaishou.switch
|
|
3651
3720
|
}),
|
|
3652
3721
|
components.switch.create("comment", {
|
|
3653
3722
|
label: "评论解析",
|
|
3654
3723
|
description: "快手评论解析,开启后可发送快手作品评论图",
|
|
3655
|
-
defaultSelected: all.kuaishou.comment
|
|
3724
|
+
defaultSelected: all.kuaishou.comment,
|
|
3725
|
+
isDisabled: !all.kuaishou.switch
|
|
3656
3726
|
}),
|
|
3657
3727
|
components.input.number("numcomment", {
|
|
3658
3728
|
label: "评论解析数量",
|
|
3659
3729
|
defaultValue: all.kuaishou.numcomment.toString(),
|
|
3660
|
-
rules: [{ min: 1 }]
|
|
3730
|
+
rules: [{ min: 1 }],
|
|
3731
|
+
isDisabled: !all.kuaishou.switch || !all.kuaishou.comment
|
|
3661
3732
|
})
|
|
3662
3733
|
]
|
|
3663
3734
|
})
|
|
@@ -3743,6 +3814,11 @@ const webConfig = defineConfig({
|
|
|
3743
3814
|
children: components.accordion.createItem("accordion-item-douyin", {
|
|
3744
3815
|
className: "ml-4 mr-4",
|
|
3745
3816
|
children: [
|
|
3817
|
+
components.switch.create("switch", {
|
|
3818
|
+
label: "是否启用",
|
|
3819
|
+
description: "是否启用该订阅项",
|
|
3820
|
+
color: "warning"
|
|
3821
|
+
}),
|
|
3746
3822
|
components.input.string("short_id", {
|
|
3747
3823
|
placeholder: "",
|
|
3748
3824
|
label: "抖音号",
|
|
@@ -3841,6 +3917,11 @@ const webConfig = defineConfig({
|
|
|
3841
3917
|
children: components.accordion.createItem("accordion-item-bilibili", {
|
|
3842
3918
|
className: "ml-4 mr-4",
|
|
3843
3919
|
children: [
|
|
3920
|
+
components.switch.create("switch", {
|
|
3921
|
+
label: "是否启用",
|
|
3922
|
+
description: "是否启用该订阅项",
|
|
3923
|
+
color: "warning"
|
|
3924
|
+
}),
|
|
3844
3925
|
components.input.number("host_mid", {
|
|
3845
3926
|
placeholder: "",
|
|
3846
3927
|
label: "UID",
|
|
@@ -4971,7 +5052,8 @@ class DouYinpush extends Base {
|
|
|
4971
5052
|
async getDynamicList(userList) {
|
|
4972
5053
|
const willbepushlist = {};
|
|
4973
5054
|
try {
|
|
4974
|
-
|
|
5055
|
+
const filteredUserList = userList.filter((item) => item.switch !== false);
|
|
5056
|
+
for (const item of filteredUserList) {
|
|
4975
5057
|
const sec_uid = item.sec_uid;
|
|
4976
5058
|
const videolist = await this.amagi.getDouyinData("用户主页视频列表数据", { sec_uid, typeMode: "strict" });
|
|
4977
5059
|
const userinfo = await this.amagi.getDouyinData("用户主页数据", { sec_uid, typeMode: "strict" });
|
|
@@ -5131,6 +5213,7 @@ sec_uid${UserInfoData.user.sec_uid}`);
|
|
|
5131
5213
|
}
|
|
5132
5214
|
} else {
|
|
5133
5215
|
config2.douyin.push({
|
|
5216
|
+
switch: true,
|
|
5134
5217
|
sec_uid,
|
|
5135
5218
|
group_id: [`${groupId}:${botId}`],
|
|
5136
5219
|
remark: UserInfoData.user.nickname,
|
package/lib/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { app, mkdirSync, logger as logger$1 } from "node-karin";
|
|
|
3
3
|
import express from "node-karin/express";
|
|
4
4
|
import { karinPathBase } from "node-karin/root";
|
|
5
5
|
import "sequelize";
|
|
6
|
-
import "./chunk/db-
|
|
6
|
+
import "./chunk/db-BwUYgCsJ.js";
|
|
7
7
|
import { Root } from "./root.js";
|
|
8
8
|
import "node:fs";
|
|
9
|
-
import { C as Config, v as videoStreamRouter, g as getVideoRouter, a as Common } from "./chunk/main-
|
|
10
|
-
import { w } from "./chunk/main-
|
|
9
|
+
import { C as Config, v as videoStreamRouter, g as getVideoRouter, a as Common } from "./chunk/main-NN4to0wU.js";
|
|
10
|
+
import { w } from "./chunk/main-NN4to0wU.js";
|
|
11
11
|
import "node-karin/axios";
|
|
12
12
|
import "stream/promises";
|
|
13
13
|
import "node:path";
|
package/lib/web.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { w as default } from './chunk/main-
|
|
1
|
+
export { w as default } from './chunk/main-NN4to0wU.js';
|