karin-plugin-kkk 2.33.0 → 2.34.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/lib/build-metadata.json +5 -5
- package/lib/core_chunk/main.js +123 -3905
- package/lib/core_chunk/template.d.mts +9 -6
- package/lib/core_chunk/vendor.js +137 -71
- package/lib/web/assets/AboutPanel-DFjZYu60.js +1 -0
- package/lib/web/assets/DesktopLayout-Cr5AitGP.js +1 -0
- package/lib/web/assets/MobileLayout-BW-vN-VU.js +2 -0
- package/lib/web/assets/index-8KaTMCj2.css +2 -0
- package/lib/web/assets/index-CQhoJUBv.js +28 -0
- package/lib/web/favicon.svg +1 -0
- package/lib/web/icons.svg +24 -0
- package/lib/web/index.html +15 -0
- package/package.json +2 -2
package/lib/core_chunk/main.js
CHANGED
|
@@ -4,12 +4,11 @@ import "node:module";
|
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path, { resolve } from "node:path";
|
|
6
6
|
import URL$2, { fileURLToPath } from "node:url";
|
|
7
|
-
import
|
|
8
|
-
import karin$1, { BOT_CONNECT, app, authMiddleware, checkPkgUpdate, checkPort, common, components, config, copyConfigSync, createBadRequestResponse, createNotFoundResponse, createServerErrorResponse, createSuccessResponse, db, defineConfig, ffmpeg, ffprobe, filesByExt, getBot, hooks, karin, karinPathHtml, karinPathTemp, logger, logger as logger$1, logs, mkdirSync, parseChangelog, range, render, requireFileSync, restart, segment, updatePkg, watch } from "node-karin";
|
|
9
|
-
import _ from "node-karin/lodash";
|
|
7
|
+
import karin$1, { BOT_CONNECT, app, authMiddleware, checkPkgUpdate, checkPort, common, config, copyConfigSync, createBadRequestResponse, createNotFoundResponse, createServerErrorResponse, createSuccessResponse, db, defineConfig, ffmpeg, ffprobe, filesByExt, getBot, hooks, karin, karinPathHtml, karinPathTemp, logger, logger as logger$1, logs, mkdirSync, parseChangelog, range, render, requireFileSync, restart, segment, updatePkg, watch } from "node-karin";
|
|
10
8
|
import { EventEmitter } from "node:events";
|
|
11
9
|
import crypto from "node:crypto";
|
|
12
10
|
import axios, { AxiosError } from "node-karin/axios";
|
|
11
|
+
import os, { platform } from "node:os";
|
|
13
12
|
import express from "node-karin/express";
|
|
14
13
|
import { karinPathBase, karinPathTemp as karinPathTemp$1 } from "node-karin/root";
|
|
15
14
|
import sqlite3 from "node-karin/sqlite3";
|
|
@@ -18,6 +17,7 @@ import util from "node:util";
|
|
|
18
17
|
import { generate, scan } from "@ikenxuan/qrcode";
|
|
19
18
|
import { Transform } from "node:stream";
|
|
20
19
|
import { pipeline } from "node:stream/promises";
|
|
20
|
+
import _ from "node-karin/lodash";
|
|
21
21
|
import { inflateSync } from "node:zlib";
|
|
22
22
|
import { embedWatermarkToPngBytes } from "@ikenxuan/watermark";
|
|
23
23
|
import { snapka } from "@karinjs/plugin-puppeteer";
|
|
@@ -32576,1087 +32576,7 @@ var cleanOldDynamicCache = async (platform, days = 7) => {
|
|
|
32576
32576
|
else return await (await getBilibiliDB()).cleanOldDynamicCache(days);
|
|
32577
32577
|
};
|
|
32578
32578
|
//#endregion
|
|
32579
|
-
//#region src/platform/bilibili/web.config.ts
|
|
32580
|
-
/**
|
|
32581
|
-
* B站配置组件
|
|
32582
|
-
* @param all 配置
|
|
32583
|
-
*/
|
|
32584
|
-
var BilibiliWeb = (all) => {
|
|
32585
|
-
return [components.accordion.create("bilibili", {
|
|
32586
|
-
label: "B站相关",
|
|
32587
|
-
children: [components.accordion.createItem("cfg:bilibili", {
|
|
32588
|
-
title: "B站相关",
|
|
32589
|
-
className: "ml-4 mr-4",
|
|
32590
|
-
subtitle: "此处为B站相关的用户偏好设置",
|
|
32591
|
-
children: [
|
|
32592
|
-
components.switch.create("switch", {
|
|
32593
|
-
label: "解析开关",
|
|
32594
|
-
description: "B站解析开关,此开关为单独开关",
|
|
32595
|
-
defaultSelected: all.bilibili.switch
|
|
32596
|
-
}),
|
|
32597
|
-
components.checkbox.group("sendContent", {
|
|
32598
|
-
label: "解析时发送的内容",
|
|
32599
|
-
description: "若什么都不选,可能不会返回任何解析结果",
|
|
32600
|
-
orientation: "horizontal",
|
|
32601
|
-
defaultValue: all.bilibili.sendContent,
|
|
32602
|
-
isDisabled: !all.bilibili.switch,
|
|
32603
|
-
checkbox: [
|
|
32604
|
-
components.checkbox.create("sendContent:checkbox:1", {
|
|
32605
|
-
label: "视频信息",
|
|
32606
|
-
value: "info",
|
|
32607
|
-
description: "仅解析视频时有效"
|
|
32608
|
-
}),
|
|
32609
|
-
components.checkbox.create("sendContent:checkbox:2", {
|
|
32610
|
-
label: "评论列表",
|
|
32611
|
-
value: "comment"
|
|
32612
|
-
}),
|
|
32613
|
-
components.checkbox.create("sendContent:checkbox:3", {
|
|
32614
|
-
label: "视频文件",
|
|
32615
|
-
value: "video",
|
|
32616
|
-
description: "仅对视频稿件有效"
|
|
32617
|
-
})
|
|
32618
|
-
]
|
|
32619
|
-
}),
|
|
32620
|
-
components.divider.create("divider-bilibili-comment", {
|
|
32621
|
-
description: "评论详情设置",
|
|
32622
|
-
descPosition: 20
|
|
32623
|
-
}),
|
|
32624
|
-
components.input.number("numcomment", {
|
|
32625
|
-
label: "评论解析数量",
|
|
32626
|
-
defaultValue: all.bilibili.numcomment.toString(),
|
|
32627
|
-
rules: [{ min: 1 }],
|
|
32628
|
-
isDisabled: !all.bilibili.sendContent.some((content) => content === "comment") || !all.bilibili.switch
|
|
32629
|
-
}),
|
|
32630
|
-
components.switch.create("commentImageCollection", {
|
|
32631
|
-
label: "是否收集评论区的图片",
|
|
32632
|
-
description: "开启后将收集评论区的图片,以合并转发的形式返回",
|
|
32633
|
-
defaultSelected: all.bilibili.commentImageCollection,
|
|
32634
|
-
isDisabled: !all.bilibili.sendContent.includes("comment") || !all.bilibili.switch
|
|
32635
|
-
}),
|
|
32636
|
-
components.switch.create("realCommentCount", {
|
|
32637
|
-
label: "显示真实评论数量",
|
|
32638
|
-
description: "评论图是否显示真实评论数量,关闭则显示解析到的评论数量",
|
|
32639
|
-
defaultSelected: all.bilibili.realCommentCount,
|
|
32640
|
-
isDisabled: !all.bilibili.sendContent.some((content) => content === "comment") || !all.bilibili.switch
|
|
32641
|
-
}),
|
|
32642
|
-
components.divider.create("divider-bilibili-render", {
|
|
32643
|
-
description: "渲染与画质设置",
|
|
32644
|
-
descPosition: 20
|
|
32645
|
-
}),
|
|
32646
|
-
components.radio.group("imageLayout", {
|
|
32647
|
-
label: "解析图文动态时,遇到多张图片时的页面布局方式(动态推送图片也生效)",
|
|
32648
|
-
description: "自动布局:少于4张时逐张上下排列;4~8张时瀑布流;9张及以上九宫格",
|
|
32649
|
-
orientation: "horizontal",
|
|
32650
|
-
defaultValue: all.bilibili.imageLayout,
|
|
32651
|
-
radio: [
|
|
32652
|
-
components.radio.create("imageLayout:radio-4", {
|
|
32653
|
-
label: "自动布局",
|
|
32654
|
-
value: "auto"
|
|
32655
|
-
}),
|
|
32656
|
-
components.radio.create("imageLayout:radio-1", {
|
|
32657
|
-
label: "逐张上下排列",
|
|
32658
|
-
value: "vertical"
|
|
32659
|
-
}),
|
|
32660
|
-
components.radio.create("imageLayout:radio-2", {
|
|
32661
|
-
label: "瀑布流排列",
|
|
32662
|
-
value: "waterfall"
|
|
32663
|
-
}),
|
|
32664
|
-
components.radio.create("imageLayout:radio-3", {
|
|
32665
|
-
label: "九宫格排列",
|
|
32666
|
-
value: "grid"
|
|
32667
|
-
})
|
|
32668
|
-
]
|
|
32669
|
-
}),
|
|
32670
|
-
components.radio.group("videoQuality", {
|
|
32671
|
-
label: "画质偏好",
|
|
32672
|
-
description: "解析视频的分辨率偏好。",
|
|
32673
|
-
orientation: "horizontal",
|
|
32674
|
-
defaultValue: all.bilibili.videoQuality.toString(),
|
|
32675
|
-
isDisabled: !all.bilibili.switch,
|
|
32676
|
-
radio: [
|
|
32677
|
-
components.radio.create("videoQuality:parse:radio-1", {
|
|
32678
|
-
label: "自动选择",
|
|
32679
|
-
value: "0"
|
|
32680
|
-
}),
|
|
32681
|
-
components.radio.create("videoQuality:parse:radio-2", {
|
|
32682
|
-
label: "240P 极速",
|
|
32683
|
-
value: "6"
|
|
32684
|
-
}),
|
|
32685
|
-
components.radio.create("videoQuality:parse:radio-3", {
|
|
32686
|
-
label: "360P 流畅",
|
|
32687
|
-
value: "16"
|
|
32688
|
-
}),
|
|
32689
|
-
components.radio.create("videoQuality:parse:radio-4", {
|
|
32690
|
-
label: "480P 清晰",
|
|
32691
|
-
value: "32",
|
|
32692
|
-
description: "需登录(配置ck)"
|
|
32693
|
-
}),
|
|
32694
|
-
components.radio.create("videoQuality:parse:radio-5", {
|
|
32695
|
-
label: "720P 高清",
|
|
32696
|
-
value: "64",
|
|
32697
|
-
description: "需登录(配置ck)"
|
|
32698
|
-
}),
|
|
32699
|
-
components.radio.create("videoQuality:parse:radio-6", {
|
|
32700
|
-
label: "720P60 高帧率",
|
|
32701
|
-
value: "74",
|
|
32702
|
-
description: "需登录(配置ck)"
|
|
32703
|
-
}),
|
|
32704
|
-
components.radio.create("videoQuality:parse:radio-7", {
|
|
32705
|
-
label: "1080P 高清",
|
|
32706
|
-
value: "80",
|
|
32707
|
-
description: "需登录(配置ck)"
|
|
32708
|
-
}),
|
|
32709
|
-
components.radio.create("videoQuality:parse:radio-8", {
|
|
32710
|
-
label: "1080P+ 高码率",
|
|
32711
|
-
value: "112",
|
|
32712
|
-
description: "需大会员&视频支持"
|
|
32713
|
-
}),
|
|
32714
|
-
components.radio.create("videoQuality:parse:radio-9", {
|
|
32715
|
-
label: "1080P60 高帧率",
|
|
32716
|
-
value: "116",
|
|
32717
|
-
description: "需大会员&视频支持"
|
|
32718
|
-
}),
|
|
32719
|
-
components.radio.create("videoQuality:parse:radio-10", {
|
|
32720
|
-
label: "4K 超清",
|
|
32721
|
-
value: "120",
|
|
32722
|
-
description: "需大会员&视频支持"
|
|
32723
|
-
}),
|
|
32724
|
-
components.radio.create("videoQuality:parse:radio-11", {
|
|
32725
|
-
label: "8K 超高清",
|
|
32726
|
-
value: "127",
|
|
32727
|
-
description: "需大会员&视频支持"
|
|
32728
|
-
})
|
|
32729
|
-
]
|
|
32730
|
-
}),
|
|
32731
|
-
components.input.number("maxAutoVideoSize", {
|
|
32732
|
-
label: "视频体积上限(MB)",
|
|
32733
|
-
description: "根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
32734
|
-
defaultValue: all.bilibili.maxAutoVideoSize.toString(),
|
|
32735
|
-
isDisabled: all.bilibili.videoQuality !== 0 || !all.bilibili.switch,
|
|
32736
|
-
rules: [{
|
|
32737
|
-
min: 1,
|
|
32738
|
-
max: 2e4
|
|
32739
|
-
}]
|
|
32740
|
-
}),
|
|
32741
|
-
components.radio.group("videoInfoMode", {
|
|
32742
|
-
label: "视频信息返回形式",
|
|
32743
|
-
defaultValue: all.bilibili.videoInfoMode,
|
|
32744
|
-
isDisabled: !all.bilibili.switch,
|
|
32745
|
-
radio: [components.radio.create("videoInfoMode:radio-2", {
|
|
32746
|
-
label: "图片模式",
|
|
32747
|
-
value: "image"
|
|
32748
|
-
}), components.radio.create("videoInfoMode:radio-1", {
|
|
32749
|
-
label: "文本模式",
|
|
32750
|
-
value: "text"
|
|
32751
|
-
})]
|
|
32752
|
-
}),
|
|
32753
|
-
components.checkbox.group("displayContent", {
|
|
32754
|
-
label: "视频信息前返回的内容",
|
|
32755
|
-
description: "若什么都不选,则不会返回任何视频相关信息",
|
|
32756
|
-
orientation: "horizontal",
|
|
32757
|
-
defaultValue: all.bilibili.displayContent,
|
|
32758
|
-
isDisabled: !all.bilibili.switch || all.bilibili.switch && all.bilibili.videoInfoMode === "image",
|
|
32759
|
-
checkbox: [
|
|
32760
|
-
components.checkbox.create("displayContent:checkbox:1", {
|
|
32761
|
-
label: "封面",
|
|
32762
|
-
value: "cover"
|
|
32763
|
-
}),
|
|
32764
|
-
components.checkbox.create("displayContent:checkbox:2", {
|
|
32765
|
-
label: "标题",
|
|
32766
|
-
value: "title"
|
|
32767
|
-
}),
|
|
32768
|
-
components.checkbox.create("displayContent:checkbox:3", {
|
|
32769
|
-
label: "作者",
|
|
32770
|
-
value: "author"
|
|
32771
|
-
}),
|
|
32772
|
-
components.checkbox.create("displayContent:checkbox:4", {
|
|
32773
|
-
label: "视频统计信息",
|
|
32774
|
-
value: "stats"
|
|
32775
|
-
}),
|
|
32776
|
-
components.checkbox.create("displayContent:checkbox:5", {
|
|
32777
|
-
label: "简介",
|
|
32778
|
-
value: "desc"
|
|
32779
|
-
})
|
|
32780
|
-
]
|
|
32781
|
-
}),
|
|
32782
|
-
components.divider.create("divider-bilibili-permission", {
|
|
32783
|
-
description: "权限设置",
|
|
32784
|
-
descPosition: 20
|
|
32785
|
-
}),
|
|
32786
|
-
components.radio.group("loginPerm", {
|
|
32787
|
-
label: "谁可以触发扫码登录",
|
|
32788
|
-
description: "修改后需重启",
|
|
32789
|
-
orientation: "horizontal",
|
|
32790
|
-
defaultValue: all.bilibili.loginPerm,
|
|
32791
|
-
radio: [
|
|
32792
|
-
components.radio.create("permission:radio-1", {
|
|
32793
|
-
label: "所有人",
|
|
32794
|
-
value: "all"
|
|
32795
|
-
}),
|
|
32796
|
-
components.radio.create("permission:radio-2", {
|
|
32797
|
-
label: "管理员",
|
|
32798
|
-
value: "admin"
|
|
32799
|
-
}),
|
|
32800
|
-
components.radio.create("permission:radio-3", {
|
|
32801
|
-
label: "主人",
|
|
32802
|
-
value: "master"
|
|
32803
|
-
}),
|
|
32804
|
-
components.radio.create("permission:radio-4", {
|
|
32805
|
-
label: "群主",
|
|
32806
|
-
value: "group.owner"
|
|
32807
|
-
}),
|
|
32808
|
-
components.radio.create("permission:radio-5", {
|
|
32809
|
-
label: "群管理员",
|
|
32810
|
-
value: "group.admin"
|
|
32811
|
-
})
|
|
32812
|
-
]
|
|
32813
|
-
}),
|
|
32814
|
-
components.divider.create("divider-bilibili-danmaku", {
|
|
32815
|
-
description: "弹幕烧录相关",
|
|
32816
|
-
descPosition: 20
|
|
32817
|
-
}),
|
|
32818
|
-
components.switch.create("burnDanmaku", {
|
|
32819
|
-
label: "弹幕烧录",
|
|
32820
|
-
description: "将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长,高分辨率视频会占用较多资源",
|
|
32821
|
-
defaultSelected: all.bilibili.burnDanmaku,
|
|
32822
|
-
isDisabled: !all.bilibili.switch
|
|
32823
|
-
}),
|
|
32824
|
-
components.radio.group("danmakuArea", {
|
|
32825
|
-
label: "弹幕区域",
|
|
32826
|
-
description: "限制弹幕的显示范围,避免遮挡视频主体内容",
|
|
32827
|
-
orientation: "horizontal",
|
|
32828
|
-
defaultValue: all.bilibili.danmakuArea.toString(),
|
|
32829
|
-
isDisabled: !all.bilibili.switch || !all.bilibili.burnDanmaku,
|
|
32830
|
-
radio: [
|
|
32831
|
-
components.radio.create("danmakuArea:radio-1", {
|
|
32832
|
-
label: "1/4 屏",
|
|
32833
|
-
value: "0.25",
|
|
32834
|
-
description: "仅顶部区域"
|
|
32835
|
-
}),
|
|
32836
|
-
components.radio.create("danmakuArea:radio-2", {
|
|
32837
|
-
label: "半屏",
|
|
32838
|
-
value: "0.5",
|
|
32839
|
-
description: "上半部分(推荐)"
|
|
32840
|
-
}),
|
|
32841
|
-
components.radio.create("danmakuArea:radio-3", {
|
|
32842
|
-
label: "3/4 屏",
|
|
32843
|
-
value: "0.75",
|
|
32844
|
-
description: "大部分区域"
|
|
32845
|
-
}),
|
|
32846
|
-
components.radio.create("danmakuArea:radio-4", {
|
|
32847
|
-
label: "全屏",
|
|
32848
|
-
value: "1",
|
|
32849
|
-
description: "铺满整个画面"
|
|
32850
|
-
})
|
|
32851
|
-
]
|
|
32852
|
-
}),
|
|
32853
|
-
components.radio.group("danmakuFontSize", {
|
|
32854
|
-
label: "弹幕字号",
|
|
32855
|
-
description: "弹幕文字大小",
|
|
32856
|
-
orientation: "horizontal",
|
|
32857
|
-
defaultValue: all.bilibili.danmakuFontSize,
|
|
32858
|
-
isDisabled: !all.bilibili.switch || !all.bilibili.burnDanmaku,
|
|
32859
|
-
radio: [
|
|
32860
|
-
components.radio.create("danmakuFontSize:radio-1", {
|
|
32861
|
-
label: "小",
|
|
32862
|
-
value: "small"
|
|
32863
|
-
}),
|
|
32864
|
-
components.radio.create("danmakuFontSize:radio-2", {
|
|
32865
|
-
label: "中",
|
|
32866
|
-
value: "medium"
|
|
32867
|
-
}),
|
|
32868
|
-
components.radio.create("danmakuFontSize:radio-3", {
|
|
32869
|
-
label: "大",
|
|
32870
|
-
value: "large"
|
|
32871
|
-
})
|
|
32872
|
-
]
|
|
32873
|
-
}),
|
|
32874
|
-
components.input.number("danmakuOpacity", {
|
|
32875
|
-
label: "弹幕透明度",
|
|
32876
|
-
description: "0为完全透明,100为完全不透明,推荐70",
|
|
32877
|
-
defaultValue: all.bilibili.danmakuOpacity.toString(),
|
|
32878
|
-
isDisabled: !all.bilibili.switch || !all.bilibili.burnDanmaku,
|
|
32879
|
-
rules: [{
|
|
32880
|
-
min: 0,
|
|
32881
|
-
max: 100
|
|
32882
|
-
}]
|
|
32883
|
-
}),
|
|
32884
|
-
components.radio.group("verticalMode", {
|
|
32885
|
-
label: "竖屏适配",
|
|
32886
|
-
description: "模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕",
|
|
32887
|
-
orientation: "horizontal",
|
|
32888
|
-
defaultValue: all.bilibili.verticalMode,
|
|
32889
|
-
isDisabled: !all.bilibili.switch || !all.bilibili.burnDanmaku,
|
|
32890
|
-
radio: [
|
|
32891
|
-
components.radio.create("verticalMode:radio-1", {
|
|
32892
|
-
label: "关闭",
|
|
32893
|
-
value: "off",
|
|
32894
|
-
description: "保持原始比例,不做转换"
|
|
32895
|
-
}),
|
|
32896
|
-
components.radio.create("verticalMode:radio-2", {
|
|
32897
|
-
label: "智能",
|
|
32898
|
-
value: "standard",
|
|
32899
|
-
description: "仅对 16:9、21:9 等常见宽屏比例生效"
|
|
32900
|
-
}),
|
|
32901
|
-
components.radio.create("verticalMode:radio-3", {
|
|
32902
|
-
label: "强制 9:16",
|
|
32903
|
-
value: "force",
|
|
32904
|
-
description: "所有视频统一转为 9:16 竖屏,弹幕大小一致"
|
|
32905
|
-
})
|
|
32906
|
-
]
|
|
32907
|
-
}),
|
|
32908
|
-
components.radio.group("videoCodec", {
|
|
32909
|
-
label: "视频编码格式",
|
|
32910
|
-
description: "弹幕烧录时使用的视频编码格式,会自动检测硬件加速",
|
|
32911
|
-
orientation: "horizontal",
|
|
32912
|
-
defaultValue: all.bilibili.videoCodec,
|
|
32913
|
-
isDisabled: !all.bilibili.switch || !all.bilibili.burnDanmaku,
|
|
32914
|
-
radio: [
|
|
32915
|
-
components.radio.create("videoCodec:radio-1", {
|
|
32916
|
-
label: "H.264",
|
|
32917
|
-
value: "h264",
|
|
32918
|
-
description: "兼容性最好,支持几乎所有设备"
|
|
32919
|
-
}),
|
|
32920
|
-
components.radio.create("videoCodec:radio-2", {
|
|
32921
|
-
label: "H.265",
|
|
32922
|
-
value: "h265",
|
|
32923
|
-
description: "压缩率更高,近几年设备支持良好(推荐)"
|
|
32924
|
-
}),
|
|
32925
|
-
components.radio.create("videoCodec:radio-3", {
|
|
32926
|
-
label: "AV1",
|
|
32927
|
-
value: "av1",
|
|
32928
|
-
description: "最新编码格式,压缩率最高,但编码较慢"
|
|
32929
|
-
})
|
|
32930
|
-
]
|
|
32931
|
-
}),
|
|
32932
|
-
components.divider.create("divider-bilibili-1", {
|
|
32933
|
-
description: "B站推送相关",
|
|
32934
|
-
descPosition: 20
|
|
32935
|
-
}),
|
|
32936
|
-
components.switch.create("push:switch", {
|
|
32937
|
-
label: "推送开关",
|
|
32938
|
-
description: "推送开关,修改后需重启;使用「#设置B站推送 + UID」配置推送列表",
|
|
32939
|
-
defaultSelected: all.bilibili.push.switch,
|
|
32940
|
-
color: "warning"
|
|
32941
|
-
}),
|
|
32942
|
-
components.radio.group("push:permission", {
|
|
32943
|
-
label: "谁可以设置推送",
|
|
32944
|
-
description: "修改后需重启",
|
|
32945
|
-
orientation: "horizontal",
|
|
32946
|
-
defaultValue: all.bilibili.push.permission,
|
|
32947
|
-
color: "warning",
|
|
32948
|
-
isDisabled: !all.bilibili.push.switch,
|
|
32949
|
-
radio: [
|
|
32950
|
-
components.radio.create("push:permission:radio-1", {
|
|
32951
|
-
label: "所有人",
|
|
32952
|
-
value: "all"
|
|
32953
|
-
}),
|
|
32954
|
-
components.radio.create("push:permission:radio-2", {
|
|
32955
|
-
label: "管理员",
|
|
32956
|
-
value: "admin"
|
|
32957
|
-
}),
|
|
32958
|
-
components.radio.create("push:permission:radio-3", {
|
|
32959
|
-
label: "主人",
|
|
32960
|
-
value: "master"
|
|
32961
|
-
}),
|
|
32962
|
-
components.radio.create("push:permission:radio-4", {
|
|
32963
|
-
label: "群主",
|
|
32964
|
-
value: "group.owner"
|
|
32965
|
-
}),
|
|
32966
|
-
components.radio.create("push:permission:radio-5", {
|
|
32967
|
-
label: "群管理员",
|
|
32968
|
-
value: "group.admin"
|
|
32969
|
-
})
|
|
32970
|
-
]
|
|
32971
|
-
}),
|
|
32972
|
-
components.input.string("push:cron", {
|
|
32973
|
-
label: "定时任务表达式",
|
|
32974
|
-
description: "定时推送的时间,格式为cron表达式(默认为每十分钟执行一次)",
|
|
32975
|
-
defaultValue: all.bilibili.push.cron,
|
|
32976
|
-
color: "warning",
|
|
32977
|
-
isDisabled: !all.bilibili.push.switch
|
|
32978
|
-
}),
|
|
32979
|
-
components.switch.create("push:parsedynamic", {
|
|
32980
|
-
label: "作品解析",
|
|
32981
|
-
description: "触发推送时是否一同解析该作品",
|
|
32982
|
-
defaultSelected: all.bilibili.push.parsedynamic,
|
|
32983
|
-
color: "warning",
|
|
32984
|
-
isDisabled: !all.bilibili.push.switch
|
|
32985
|
-
}),
|
|
32986
|
-
components.radio.group("push:pushVideoQuality", {
|
|
32987
|
-
label: "解析视频动态时的画质偏好",
|
|
32988
|
-
description: "「作品解析」开启时生效,仅对视频动态有效",
|
|
32989
|
-
orientation: "horizontal",
|
|
32990
|
-
isDisabled: !all.bilibili.push.parsedynamic || !all.bilibili.push.switch,
|
|
32991
|
-
defaultValue: all.bilibili.push.pushVideoQuality.toString(),
|
|
32992
|
-
color: "warning",
|
|
32993
|
-
radio: [
|
|
32994
|
-
components.radio.create("push:pushVideoQuality:radio-1", {
|
|
32995
|
-
label: "自动选择",
|
|
32996
|
-
value: "0"
|
|
32997
|
-
}),
|
|
32998
|
-
components.radio.create("push:pushVideoQuality:radio-2", {
|
|
32999
|
-
label: "240P 极速",
|
|
33000
|
-
value: "6"
|
|
33001
|
-
}),
|
|
33002
|
-
components.radio.create("push:pushVideoQuality:radio-3", {
|
|
33003
|
-
label: "360P 流畅",
|
|
33004
|
-
value: "16"
|
|
33005
|
-
}),
|
|
33006
|
-
components.radio.create("push:pushVideoQuality:radio-4", {
|
|
33007
|
-
label: "480P 清晰",
|
|
33008
|
-
value: "32",
|
|
33009
|
-
description: "需登录(配置ck)"
|
|
33010
|
-
}),
|
|
33011
|
-
components.radio.create("push:pushVideoQuality:radio-5", {
|
|
33012
|
-
label: "720P 高清",
|
|
33013
|
-
value: "64",
|
|
33014
|
-
description: "需登录(配置ck)"
|
|
33015
|
-
}),
|
|
33016
|
-
components.radio.create("push:pushVideoQuality:radio-6", {
|
|
33017
|
-
label: "720P60 高帧率",
|
|
33018
|
-
value: "74",
|
|
33019
|
-
description: "需登录(配置ck)"
|
|
33020
|
-
}),
|
|
33021
|
-
components.radio.create("push:pushVideoQuality:radio-7", {
|
|
33022
|
-
label: "1080P 高清",
|
|
33023
|
-
value: "80",
|
|
33024
|
-
description: "需登录(配置ck)"
|
|
33025
|
-
}),
|
|
33026
|
-
components.radio.create("push:pushVideoQuality:radio-8", {
|
|
33027
|
-
label: "1080P+ 高码率",
|
|
33028
|
-
value: "112",
|
|
33029
|
-
description: "需大会员&视频支持"
|
|
33030
|
-
}),
|
|
33031
|
-
components.radio.create("push:pushVideoQuality:radio-9", {
|
|
33032
|
-
label: "1080P60 高帧率",
|
|
33033
|
-
value: "116",
|
|
33034
|
-
description: "需大会员&视频支持"
|
|
33035
|
-
}),
|
|
33036
|
-
components.radio.create("push:pushVideoQuality:radio-10", {
|
|
33037
|
-
label: "4K 超清",
|
|
33038
|
-
value: "120",
|
|
33039
|
-
description: "需大会员&视频支持"
|
|
33040
|
-
}),
|
|
33041
|
-
components.radio.create("push:pushVideoQuality:radio-11", {
|
|
33042
|
-
label: "8K 超高清",
|
|
33043
|
-
value: "127",
|
|
33044
|
-
description: "需大会员&视频支持"
|
|
33045
|
-
})
|
|
33046
|
-
]
|
|
33047
|
-
}),
|
|
33048
|
-
components.input.number("push:pushMaxAutoVideoSize", {
|
|
33049
|
-
label: "视频动态的视频体积上限(MB)",
|
|
33050
|
-
description: "根据该值自动选择分辨率进行下载。仅在「解析视频动态时的画质偏好」 为 \"自动选择\" 且「作品解析」开启时生效,仅对视频动态有效",
|
|
33051
|
-
defaultValue: all.bilibili.push.pushMaxAutoVideoSize.toString(),
|
|
33052
|
-
isDisabled: !all.bilibili.push.parsedynamic || all.bilibili.push.pushVideoQuality !== 0 || !all.bilibili.push.switch,
|
|
33053
|
-
rules: [{
|
|
33054
|
-
min: 1,
|
|
33055
|
-
max: 2e4
|
|
33056
|
-
}],
|
|
33057
|
-
color: "warning"
|
|
33058
|
-
})
|
|
33059
|
-
]
|
|
33060
|
-
})]
|
|
33061
|
-
})];
|
|
33062
|
-
};
|
|
33063
|
-
//#endregion
|
|
33064
|
-
//#region src/platform/douyin/web.config.ts
|
|
33065
|
-
/**
|
|
33066
|
-
* 抖音配置组件
|
|
33067
|
-
* @param all 配置
|
|
33068
|
-
*/
|
|
33069
|
-
var DouyinWeb = (all) => {
|
|
33070
|
-
return [components.accordion.create("douyin", {
|
|
33071
|
-
label: "抖音相关",
|
|
33072
|
-
children: [components.accordion.createItem("cfg:douyin", {
|
|
33073
|
-
title: "抖音相关",
|
|
33074
|
-
className: "ml-4 mr-4",
|
|
33075
|
-
subtitle: "此处为抖音相关的用户偏好设置",
|
|
33076
|
-
children: [
|
|
33077
|
-
components.switch.create("switch", {
|
|
33078
|
-
label: "解析开关",
|
|
33079
|
-
description: "抖音解析开关,此开关为单独开关",
|
|
33080
|
-
defaultSelected: all.douyin.switch
|
|
33081
|
-
}),
|
|
33082
|
-
components.checkbox.group("sendContent", {
|
|
33083
|
-
label: "解析时发送的内容",
|
|
33084
|
-
description: "若什么都不选,可能不会返回任何解析结果",
|
|
33085
|
-
orientation: "horizontal",
|
|
33086
|
-
defaultValue: all.douyin.sendContent,
|
|
33087
|
-
isDisabled: !all.douyin.switch,
|
|
33088
|
-
checkbox: [
|
|
33089
|
-
components.checkbox.create("sendContent:checkbox:1", {
|
|
33090
|
-
label: "视频信息",
|
|
33091
|
-
value: "info",
|
|
33092
|
-
description: "仅解析视频时有效"
|
|
33093
|
-
}),
|
|
33094
|
-
components.checkbox.create("sendContent:checkbox:2", {
|
|
33095
|
-
label: "评论列表",
|
|
33096
|
-
value: "comment"
|
|
33097
|
-
}),
|
|
33098
|
-
components.checkbox.create("sendContent:checkbox:3", {
|
|
33099
|
-
label: "视频文件",
|
|
33100
|
-
value: "video",
|
|
33101
|
-
description: "仅对视频作品有效"
|
|
33102
|
-
})
|
|
33103
|
-
]
|
|
33104
|
-
}),
|
|
33105
|
-
components.divider.create("divider-dy-comment", {
|
|
33106
|
-
description: "评论详情设置",
|
|
33107
|
-
descPosition: 20
|
|
33108
|
-
}),
|
|
33109
|
-
components.input.number("numcomment", {
|
|
33110
|
-
label: "评论解析数量",
|
|
33111
|
-
defaultValue: all.douyin.numcomment.toString(),
|
|
33112
|
-
rules: [{ min: 1 }],
|
|
33113
|
-
isDisabled: !all.douyin.sendContent.includes("comment") || !all.douyin.switch
|
|
33114
|
-
}),
|
|
33115
|
-
components.input.number("subCommentLimit", {
|
|
33116
|
-
label: "次级评论解析数量",
|
|
33117
|
-
description: "次级评论解析数量,当前逻辑不仅无法判断请求的来的评论的嵌套深度,而且「次级评论解析深度」会限制嵌套深度,超过深度的评论会被截断",
|
|
33118
|
-
defaultValue: all.douyin.subCommentLimit.toString(),
|
|
33119
|
-
rules: [{
|
|
33120
|
-
min: 1,
|
|
33121
|
-
max: 20
|
|
33122
|
-
}],
|
|
33123
|
-
isDisabled: !all.douyin.sendContent.includes("comment") || !all.douyin.switch
|
|
33124
|
-
}),
|
|
33125
|
-
components.switch.create("commentImageCollection", {
|
|
33126
|
-
label: "是否收集评论区的图片",
|
|
33127
|
-
description: "开启后将收集评论区的图片,以合并转发的形式返回",
|
|
33128
|
-
defaultSelected: all.douyin.commentImageCollection,
|
|
33129
|
-
isDisabled: !all.douyin.sendContent.includes("comment") || !all.douyin.switch
|
|
33130
|
-
}),
|
|
33131
|
-
components.divider.create("divider-dy-render", {
|
|
33132
|
-
description: "渲染与画质设置",
|
|
33133
|
-
descPosition: 20
|
|
33134
|
-
}),
|
|
33135
|
-
components.radio.group("liveImageMergeMode", {
|
|
33136
|
-
label: "合辑 Live 图 BGM 合并方式",
|
|
33137
|
-
orientation: "horizontal",
|
|
33138
|
-
defaultValue: all.douyin.liveImageMergeMode.toString(),
|
|
33139
|
-
isDisabled: !all.douyin.switch || all.app.livePhotoMode === "livephoto_only",
|
|
33140
|
-
radio: [components.radio.create("liveImageMergeMode:radio-1", {
|
|
33141
|
-
label: "连续",
|
|
33142
|
-
value: "continuous",
|
|
33143
|
-
description: "BGM 接续播放,结束后自动循环"
|
|
33144
|
-
}), components.radio.create("liveImageMergeMode:radio-2", {
|
|
33145
|
-
label: "独立",
|
|
33146
|
-
value: "independent",
|
|
33147
|
-
description: "每张图 BGM 从头开始"
|
|
33148
|
-
})]
|
|
33149
|
-
}),
|
|
33150
|
-
components.radio.group("videoQuality", {
|
|
33151
|
-
label: "画质偏好",
|
|
33152
|
-
description: "解析视频的分辨率偏好。",
|
|
33153
|
-
orientation: "horizontal",
|
|
33154
|
-
defaultValue: all.douyin.videoQuality.toString(),
|
|
33155
|
-
isDisabled: !all.douyin.switch,
|
|
33156
|
-
radio: [
|
|
33157
|
-
components.radio.create("videoQuality:parse:radio-1", {
|
|
33158
|
-
label: "自动选择",
|
|
33159
|
-
value: "adapt",
|
|
33160
|
-
description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
|
|
33161
|
-
}),
|
|
33162
|
-
components.radio.create("videoQuality:parse:radio-2", {
|
|
33163
|
-
label: "标清 540p",
|
|
33164
|
-
value: "540p"
|
|
33165
|
-
}),
|
|
33166
|
-
components.radio.create("videoQuality:parse:radio-3", {
|
|
33167
|
-
label: "高清 720p",
|
|
33168
|
-
value: "720p"
|
|
33169
|
-
}),
|
|
33170
|
-
components.radio.create("videoQuality:parse:radio-4", {
|
|
33171
|
-
label: "高清 1080p",
|
|
33172
|
-
value: "1080p"
|
|
33173
|
-
}),
|
|
33174
|
-
components.radio.create("videoQuality:parse:radio-5", {
|
|
33175
|
-
label: "超清 2k",
|
|
33176
|
-
value: "2k"
|
|
33177
|
-
}),
|
|
33178
|
-
components.radio.create("videoQuality:parse:radio-6", {
|
|
33179
|
-
label: "超清 4k",
|
|
33180
|
-
value: "4k"
|
|
33181
|
-
})
|
|
33182
|
-
]
|
|
33183
|
-
}),
|
|
33184
|
-
components.input.number("maxAutoVideoSize", {
|
|
33185
|
-
label: "视频体积上限(MB)",
|
|
33186
|
-
description: "根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
33187
|
-
defaultValue: all.douyin.maxAutoVideoSize.toString(),
|
|
33188
|
-
isDisabled: all.douyin.videoQuality !== "adapt" || !all.douyin.switch,
|
|
33189
|
-
rules: [{
|
|
33190
|
-
min: 1,
|
|
33191
|
-
max: 2e4
|
|
33192
|
-
}]
|
|
33193
|
-
}),
|
|
33194
|
-
components.radio.group("videoInfoMode", {
|
|
33195
|
-
label: "视频信息返回形式",
|
|
33196
|
-
defaultValue: all.douyin.videoInfoMode,
|
|
33197
|
-
isDisabled: !all.douyin.switch,
|
|
33198
|
-
radio: [components.radio.create("videoInfoMode:radio-2", {
|
|
33199
|
-
label: "图片模式",
|
|
33200
|
-
value: "image"
|
|
33201
|
-
}), components.radio.create("videoInfoMode:radio-1", {
|
|
33202
|
-
label: "文本模式",
|
|
33203
|
-
value: "text"
|
|
33204
|
-
})]
|
|
33205
|
-
}),
|
|
33206
|
-
components.checkbox.group("displayContent", {
|
|
33207
|
-
label: "视频信息的内容",
|
|
33208
|
-
description: "若什么都不选,则不会返回任何视频相关信息",
|
|
33209
|
-
orientation: "horizontal",
|
|
33210
|
-
defaultValue: all.douyin.displayContent,
|
|
33211
|
-
isDisabled: !all.douyin.switch || all.douyin.switch && all.douyin.videoInfoMode === "image",
|
|
33212
|
-
checkbox: [
|
|
33213
|
-
components.checkbox.create("displayContent:checkbox:1", {
|
|
33214
|
-
label: "封面",
|
|
33215
|
-
value: "cover"
|
|
33216
|
-
}),
|
|
33217
|
-
components.checkbox.create("displayContent:checkbox:2", {
|
|
33218
|
-
label: "标题",
|
|
33219
|
-
value: "title"
|
|
33220
|
-
}),
|
|
33221
|
-
components.checkbox.create("displayContent:checkbox:3", {
|
|
33222
|
-
label: "作者",
|
|
33223
|
-
value: "author"
|
|
33224
|
-
}),
|
|
33225
|
-
components.checkbox.create("displayContent:checkbox:4", {
|
|
33226
|
-
label: "视频统计信息",
|
|
33227
|
-
value: "stats"
|
|
33228
|
-
})
|
|
33229
|
-
]
|
|
33230
|
-
}),
|
|
33231
|
-
components.divider.create("divider-dy-permission", {
|
|
33232
|
-
description: "权限设置",
|
|
33233
|
-
descPosition: 20
|
|
33234
|
-
}),
|
|
33235
|
-
components.radio.group("loginPerm", {
|
|
33236
|
-
label: "谁可以触发扫码登录",
|
|
33237
|
-
description: "修改后需重启",
|
|
33238
|
-
orientation: "horizontal",
|
|
33239
|
-
defaultValue: all.douyin.loginPerm,
|
|
33240
|
-
radio: [
|
|
33241
|
-
components.radio.create("permission:radio-1", {
|
|
33242
|
-
label: "所有人",
|
|
33243
|
-
value: "all"
|
|
33244
|
-
}),
|
|
33245
|
-
components.radio.create("permission:radio-2", {
|
|
33246
|
-
label: "管理员",
|
|
33247
|
-
value: "admin"
|
|
33248
|
-
}),
|
|
33249
|
-
components.radio.create("permission:radio-3", {
|
|
33250
|
-
label: "主人",
|
|
33251
|
-
value: "master"
|
|
33252
|
-
}),
|
|
33253
|
-
components.radio.create("permission:radio-4", {
|
|
33254
|
-
label: "群主",
|
|
33255
|
-
value: "group.owner"
|
|
33256
|
-
}),
|
|
33257
|
-
components.radio.create("permission:radio-5", {
|
|
33258
|
-
label: "群管理员",
|
|
33259
|
-
value: "group.admin"
|
|
33260
|
-
})
|
|
33261
|
-
]
|
|
33262
|
-
}),
|
|
33263
|
-
components.divider.create("divider-dy-danmaku", {
|
|
33264
|
-
description: "弹幕烧录相关",
|
|
33265
|
-
descPosition: 20
|
|
33266
|
-
}),
|
|
33267
|
-
components.switch.create("burnDanmaku", {
|
|
33268
|
-
label: "弹幕烧录",
|
|
33269
|
-
description: "将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长",
|
|
33270
|
-
defaultSelected: all.douyin.burnDanmaku,
|
|
33271
|
-
isDisabled: !all.douyin.switch
|
|
33272
|
-
}),
|
|
33273
|
-
components.radio.group("danmakuArea", {
|
|
33274
|
-
label: "弹幕显示区域",
|
|
33275
|
-
description: "限制弹幕范围,避免遮挡视频主体",
|
|
33276
|
-
orientation: "horizontal",
|
|
33277
|
-
defaultValue: all.douyin.danmakuArea.toString(),
|
|
33278
|
-
isDisabled: !all.douyin.switch || !all.douyin.burnDanmaku,
|
|
33279
|
-
radio: [
|
|
33280
|
-
components.radio.create("danmakuArea:radio-1", {
|
|
33281
|
-
label: "1/4 屏",
|
|
33282
|
-
value: "0.25"
|
|
33283
|
-
}),
|
|
33284
|
-
components.radio.create("danmakuArea:radio-2", {
|
|
33285
|
-
label: "半屏",
|
|
33286
|
-
value: "0.5"
|
|
33287
|
-
}),
|
|
33288
|
-
components.radio.create("danmakuArea:radio-3", {
|
|
33289
|
-
label: "3/4 屏",
|
|
33290
|
-
value: "0.75"
|
|
33291
|
-
}),
|
|
33292
|
-
components.radio.create("danmakuArea:radio-4", {
|
|
33293
|
-
label: "全屏",
|
|
33294
|
-
value: "1"
|
|
33295
|
-
})
|
|
33296
|
-
]
|
|
33297
|
-
}),
|
|
33298
|
-
components.radio.group("danmakuFontSize", {
|
|
33299
|
-
label: "弹幕字号",
|
|
33300
|
-
description: "弹幕文字大小",
|
|
33301
|
-
orientation: "horizontal",
|
|
33302
|
-
defaultValue: all.douyin.danmakuFontSize,
|
|
33303
|
-
isDisabled: !all.douyin.switch || !all.douyin.burnDanmaku,
|
|
33304
|
-
radio: [
|
|
33305
|
-
components.radio.create("danmakuFontSize:radio-1", {
|
|
33306
|
-
label: "小",
|
|
33307
|
-
value: "small"
|
|
33308
|
-
}),
|
|
33309
|
-
components.radio.create("danmakuFontSize:radio-2", {
|
|
33310
|
-
label: "中",
|
|
33311
|
-
value: "medium"
|
|
33312
|
-
}),
|
|
33313
|
-
components.radio.create("danmakuFontSize:radio-3", {
|
|
33314
|
-
label: "大",
|
|
33315
|
-
value: "large"
|
|
33316
|
-
})
|
|
33317
|
-
]
|
|
33318
|
-
}),
|
|
33319
|
-
components.input.number("danmakuOpacity", {
|
|
33320
|
-
label: "弹幕透明度",
|
|
33321
|
-
description: "0为完全透明,100为完全不透明,推荐70",
|
|
33322
|
-
defaultValue: all.douyin.danmakuOpacity.toString(),
|
|
33323
|
-
isDisabled: !all.douyin.switch || !all.douyin.burnDanmaku,
|
|
33324
|
-
rules: [{
|
|
33325
|
-
min: 0,
|
|
33326
|
-
max: 100
|
|
33327
|
-
}]
|
|
33328
|
-
}),
|
|
33329
|
-
components.radio.group("verticalMode", {
|
|
33330
|
-
label: "竖屏适配",
|
|
33331
|
-
description: "针对横屏视频,模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕",
|
|
33332
|
-
orientation: "horizontal",
|
|
33333
|
-
defaultValue: all.douyin.verticalMode,
|
|
33334
|
-
isDisabled: !all.douyin.switch || !all.douyin.burnDanmaku,
|
|
33335
|
-
radio: [
|
|
33336
|
-
components.radio.create("verticalMode:radio-1", {
|
|
33337
|
-
label: "关闭",
|
|
33338
|
-
value: "off",
|
|
33339
|
-
description: "保持原始比例,不做转换"
|
|
33340
|
-
}),
|
|
33341
|
-
components.radio.create("verticalMode:radio-2", {
|
|
33342
|
-
label: "智能",
|
|
33343
|
-
value: "standard",
|
|
33344
|
-
description: "仅对宽高比 ≥1.7 的横屏视频生效"
|
|
33345
|
-
}),
|
|
33346
|
-
components.radio.create("verticalMode:radio-3", {
|
|
33347
|
-
label: "强制 9:16",
|
|
33348
|
-
value: "force",
|
|
33349
|
-
description: "所有视频统一转为竖屏"
|
|
33350
|
-
})
|
|
33351
|
-
]
|
|
33352
|
-
}),
|
|
33353
|
-
components.radio.group("videoCodec", {
|
|
33354
|
-
label: "视频编码格式",
|
|
33355
|
-
description: "烧录弹幕后的视频编码格式",
|
|
33356
|
-
orientation: "horizontal",
|
|
33357
|
-
defaultValue: all.douyin.videoCodec,
|
|
33358
|
-
isDisabled: !all.douyin.switch || !all.douyin.burnDanmaku,
|
|
33359
|
-
radio: [
|
|
33360
|
-
components.radio.create("videoCodec:radio-1", {
|
|
33361
|
-
label: "H.264",
|
|
33362
|
-
value: "h264"
|
|
33363
|
-
}),
|
|
33364
|
-
components.radio.create("videoCodec:radio-2", {
|
|
33365
|
-
label: "H.265",
|
|
33366
|
-
value: "h265"
|
|
33367
|
-
}),
|
|
33368
|
-
components.radio.create("videoCodec:radio-3", {
|
|
33369
|
-
label: "AV1",
|
|
33370
|
-
value: "av1"
|
|
33371
|
-
})
|
|
33372
|
-
]
|
|
33373
|
-
}),
|
|
33374
|
-
components.divider.create("divider-dy-1", {
|
|
33375
|
-
description: "抖音推送相关",
|
|
33376
|
-
descPosition: 20
|
|
33377
|
-
}),
|
|
33378
|
-
components.switch.create("push:switch", {
|
|
33379
|
-
label: "推送开关",
|
|
33380
|
-
description: "推送开关,修改后需重启;使用「#设置抖音推送 + 抖音号」配置推送列表",
|
|
33381
|
-
defaultSelected: all.douyin.push.switch,
|
|
33382
|
-
color: "warning"
|
|
33383
|
-
}),
|
|
33384
|
-
components.radio.group("push:permission", {
|
|
33385
|
-
label: "谁可以设置推送",
|
|
33386
|
-
description: "修改后需重启",
|
|
33387
|
-
orientation: "horizontal",
|
|
33388
|
-
defaultValue: all.douyin.push.permission,
|
|
33389
|
-
isDisabled: !all.douyin.push.switch,
|
|
33390
|
-
color: "warning",
|
|
33391
|
-
radio: [
|
|
33392
|
-
components.radio.create("push:permission:radio-1", {
|
|
33393
|
-
label: "所有人",
|
|
33394
|
-
value: "all"
|
|
33395
|
-
}),
|
|
33396
|
-
components.radio.create("push:permission:radio-2", {
|
|
33397
|
-
label: "管理员",
|
|
33398
|
-
value: "admin"
|
|
33399
|
-
}),
|
|
33400
|
-
components.radio.create("push:permission:radio-3", {
|
|
33401
|
-
label: "主人",
|
|
33402
|
-
value: "master"
|
|
33403
|
-
}),
|
|
33404
|
-
components.radio.create("push:permission:radio-4", {
|
|
33405
|
-
label: "群主",
|
|
33406
|
-
value: "group.owner"
|
|
33407
|
-
}),
|
|
33408
|
-
components.radio.create("push:permission:radio-5", {
|
|
33409
|
-
label: "群管理员",
|
|
33410
|
-
value: "group.admin"
|
|
33411
|
-
})
|
|
33412
|
-
]
|
|
33413
|
-
}),
|
|
33414
|
-
components.input.string("push:cron", {
|
|
33415
|
-
label: "定时任务表达式",
|
|
33416
|
-
description: "定时推送的时间,格式为cron表达式(默认为每十分钟执行一次)",
|
|
33417
|
-
defaultValue: all.douyin.push.cron,
|
|
33418
|
-
color: "warning",
|
|
33419
|
-
isDisabled: !all.douyin.push.switch
|
|
33420
|
-
}),
|
|
33421
|
-
components.switch.create("push:parsedynamic", {
|
|
33422
|
-
label: "作品解析",
|
|
33423
|
-
description: "触发推送时是否一同解析该作品",
|
|
33424
|
-
defaultSelected: all.douyin.push.parsedynamic,
|
|
33425
|
-
color: "warning",
|
|
33426
|
-
isDisabled: !all.douyin.push.switch
|
|
33427
|
-
}),
|
|
33428
|
-
components.radio.group("push:shareType", {
|
|
33429
|
-
label: "推送图二维码的类型",
|
|
33430
|
-
orientation: "horizontal",
|
|
33431
|
-
defaultValue: all.douyin.push.shareType,
|
|
33432
|
-
color: "warning",
|
|
33433
|
-
isDisabled: !all.douyin.push.switch,
|
|
33434
|
-
radio: [components.radio.create("push:shareType.radio-1", {
|
|
33435
|
-
label: "网页链接",
|
|
33436
|
-
description: "识别后访问抖音官网对应的作品地址",
|
|
33437
|
-
value: "web"
|
|
33438
|
-
}), components.radio.create("push:shareType.radio-2", {
|
|
33439
|
-
description: "识别后访问无水印作品下载地址",
|
|
33440
|
-
label: "下载链接",
|
|
33441
|
-
value: "download"
|
|
33442
|
-
})]
|
|
33443
|
-
}),
|
|
33444
|
-
components.radio.group("push:pushVideoQuality", {
|
|
33445
|
-
label: "画质偏好",
|
|
33446
|
-
description: "推送解析时解析视频的分辨率偏好。",
|
|
33447
|
-
orientation: "horizontal",
|
|
33448
|
-
defaultValue: all.douyin.push.pushVideoQuality.toString(),
|
|
33449
|
-
isDisabled: !all.douyin.push.switch,
|
|
33450
|
-
color: "warning",
|
|
33451
|
-
radio: [
|
|
33452
|
-
components.radio.create("push:pushVideoQuality:radio-1", {
|
|
33453
|
-
label: "自动选择",
|
|
33454
|
-
value: "adapt",
|
|
33455
|
-
description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
|
|
33456
|
-
}),
|
|
33457
|
-
components.radio.create("push:pushVideoQuality:radio-2", {
|
|
33458
|
-
label: "标清 540p",
|
|
33459
|
-
value: "540p"
|
|
33460
|
-
}),
|
|
33461
|
-
components.radio.create("push:pushVideoQuality:radio-3", {
|
|
33462
|
-
label: "高清 720p",
|
|
33463
|
-
value: "720p"
|
|
33464
|
-
}),
|
|
33465
|
-
components.radio.create("push:pushVideoQuality:radio-4", {
|
|
33466
|
-
label: "高清 1080p",
|
|
33467
|
-
value: "1080p"
|
|
33468
|
-
}),
|
|
33469
|
-
components.radio.create("push:pushVideoQuality:radio-5", {
|
|
33470
|
-
label: "超清 2k",
|
|
33471
|
-
value: "2k"
|
|
33472
|
-
}),
|
|
33473
|
-
components.radio.create("push:pushVideoQuality:radio-6", {
|
|
33474
|
-
label: "超清 4k",
|
|
33475
|
-
value: "4k"
|
|
33476
|
-
})
|
|
33477
|
-
]
|
|
33478
|
-
}),
|
|
33479
|
-
components.input.number("push:pushMaxAutoVideoSize", {
|
|
33480
|
-
label: "视频体积上限(MB)",
|
|
33481
|
-
color: "warning",
|
|
33482
|
-
description: "推送解析时根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
33483
|
-
defaultValue: all.douyin.push.pushMaxAutoVideoSize.toString(),
|
|
33484
|
-
isDisabled: all.douyin.push.pushVideoQuality !== "adapt" || !all.douyin.push.switch,
|
|
33485
|
-
rules: [{
|
|
33486
|
-
min: 1,
|
|
33487
|
-
max: 2e4
|
|
33488
|
-
}]
|
|
33489
|
-
})
|
|
33490
|
-
]
|
|
33491
|
-
})]
|
|
33492
|
-
})];
|
|
33493
|
-
};
|
|
33494
|
-
//#endregion
|
|
33495
|
-
//#region src/platform/kuaishou/web.config.ts
|
|
33496
|
-
/**
|
|
33497
|
-
* 快手配置组件
|
|
33498
|
-
* @param all 配置
|
|
33499
|
-
*/
|
|
33500
|
-
var KuaishouWeb = (all) => {
|
|
33501
|
-
return [components.accordion.create("kuaishou", {
|
|
33502
|
-
label: "快手相关",
|
|
33503
|
-
children: [components.accordion.createItem("cfg:kuaishou", {
|
|
33504
|
-
title: "快手相关",
|
|
33505
|
-
className: "ml-4 mr-4",
|
|
33506
|
-
subtitle: "此处为快手相关的用户偏好设置",
|
|
33507
|
-
children: [
|
|
33508
|
-
components.switch.create("switch", {
|
|
33509
|
-
label: "解析开关",
|
|
33510
|
-
description: "快手解析开关,此开关为单独开关",
|
|
33511
|
-
defaultSelected: all.kuaishou.switch
|
|
33512
|
-
}),
|
|
33513
|
-
components.divider.create("divider-kuaishou-comment", {
|
|
33514
|
-
description: "评论详情设置",
|
|
33515
|
-
descPosition: 20
|
|
33516
|
-
}),
|
|
33517
|
-
components.switch.create("comment", {
|
|
33518
|
-
label: "评论解析",
|
|
33519
|
-
description: "快手评论解析,开启后可发送快手作品评论图",
|
|
33520
|
-
defaultSelected: all.kuaishou.comment,
|
|
33521
|
-
isDisabled: !all.kuaishou.switch
|
|
33522
|
-
}),
|
|
33523
|
-
components.input.number("numcomment", {
|
|
33524
|
-
label: "评论解析数量",
|
|
33525
|
-
defaultValue: all.kuaishou.numcomment.toString(),
|
|
33526
|
-
rules: [{ min: 1 }],
|
|
33527
|
-
isDisabled: !all.kuaishou.switch || !all.kuaishou.comment
|
|
33528
|
-
})
|
|
33529
|
-
]
|
|
33530
|
-
})]
|
|
33531
|
-
})];
|
|
33532
|
-
};
|
|
33533
|
-
//#endregion
|
|
33534
|
-
//#region src/platform/xiaohongshu/web.config.ts
|
|
33535
|
-
/**
|
|
33536
|
-
* 小红书配置组件
|
|
33537
|
-
* @param all 配置
|
|
33538
|
-
*/
|
|
33539
|
-
var XiaohongshuWeb = (all) => {
|
|
33540
|
-
return [components.accordion.create("xiaohongshu", {
|
|
33541
|
-
label: "小红书相关",
|
|
33542
|
-
children: [components.accordion.createItem("cfg:xiaohongshu", {
|
|
33543
|
-
title: "小红书相关",
|
|
33544
|
-
className: "ml-4 mr-4",
|
|
33545
|
-
subtitle: "此处为小红书相关的用户偏好设置",
|
|
33546
|
-
children: [
|
|
33547
|
-
components.switch.create("switch", {
|
|
33548
|
-
label: "解析开关",
|
|
33549
|
-
description: "小红书解析开关,此开关为单独开关",
|
|
33550
|
-
defaultSelected: all.xiaohongshu.switch
|
|
33551
|
-
}),
|
|
33552
|
-
components.checkbox.group("sendContent", {
|
|
33553
|
-
label: "解析时发送的内容",
|
|
33554
|
-
description: "若什么都不选,可能不会返回任何解析结果",
|
|
33555
|
-
orientation: "horizontal",
|
|
33556
|
-
defaultValue: all.xiaohongshu.sendContent,
|
|
33557
|
-
isDisabled: !all.xiaohongshu.switch,
|
|
33558
|
-
checkbox: [
|
|
33559
|
-
components.checkbox.create("sendContent:checkbox:1", {
|
|
33560
|
-
label: "笔记信息",
|
|
33561
|
-
value: "info"
|
|
33562
|
-
}),
|
|
33563
|
-
components.checkbox.create("sendContent:checkbox:2", {
|
|
33564
|
-
label: "评论列表",
|
|
33565
|
-
value: "comment"
|
|
33566
|
-
}),
|
|
33567
|
-
components.checkbox.create("sendContent:checkbox:3", {
|
|
33568
|
-
label: "笔记图片",
|
|
33569
|
-
value: "image"
|
|
33570
|
-
}),
|
|
33571
|
-
components.checkbox.create("sendContent:checkbox:4", {
|
|
33572
|
-
label: "视频文件",
|
|
33573
|
-
value: "video",
|
|
33574
|
-
description: "仅对视频笔记有效"
|
|
33575
|
-
})
|
|
33576
|
-
]
|
|
33577
|
-
}),
|
|
33578
|
-
components.input.number("numcomment", {
|
|
33579
|
-
label: "评论解析数量",
|
|
33580
|
-
defaultValue: all.xiaohongshu.numcomment.toString(),
|
|
33581
|
-
rules: [{ min: 1 }],
|
|
33582
|
-
isDisabled: !all.xiaohongshu.sendContent.some((content) => content === "comment") || !all.xiaohongshu.switch
|
|
33583
|
-
}),
|
|
33584
|
-
components.divider.create("divider-xiaohongshu-render", {
|
|
33585
|
-
description: "渲染与画质设置",
|
|
33586
|
-
descPosition: 20
|
|
33587
|
-
}),
|
|
33588
|
-
components.radio.group("videoQuality", {
|
|
33589
|
-
label: "画质偏好",
|
|
33590
|
-
description: "解析视频的分辨率偏好。",
|
|
33591
|
-
orientation: "horizontal",
|
|
33592
|
-
defaultValue: all.xiaohongshu.videoQuality.toString(),
|
|
33593
|
-
isDisabled: !all.xiaohongshu.switch,
|
|
33594
|
-
radio: [
|
|
33595
|
-
components.radio.create("videoQuality:radio-1", {
|
|
33596
|
-
label: "自动选择",
|
|
33597
|
-
value: "adapt",
|
|
33598
|
-
description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
|
|
33599
|
-
}),
|
|
33600
|
-
components.radio.create("videoQuality:radio-2", {
|
|
33601
|
-
label: "标清 540p",
|
|
33602
|
-
value: "540p"
|
|
33603
|
-
}),
|
|
33604
|
-
components.radio.create("videoQuality:radio-3", {
|
|
33605
|
-
label: "高清 720p",
|
|
33606
|
-
value: "720p"
|
|
33607
|
-
}),
|
|
33608
|
-
components.radio.create("videoQuality:radio-4", {
|
|
33609
|
-
label: "高清 1080p",
|
|
33610
|
-
value: "1080p"
|
|
33611
|
-
}),
|
|
33612
|
-
components.radio.create("videoQuality:radio-5", {
|
|
33613
|
-
label: "超清 2k",
|
|
33614
|
-
value: "2k"
|
|
33615
|
-
}),
|
|
33616
|
-
components.radio.create("videoQuality:radio-6", {
|
|
33617
|
-
label: "超清 4k",
|
|
33618
|
-
value: "4k"
|
|
33619
|
-
})
|
|
33620
|
-
]
|
|
33621
|
-
}),
|
|
33622
|
-
components.input.number("maxAutoVideoSize", {
|
|
33623
|
-
label: "视频体积上限(MB)",
|
|
33624
|
-
description: "根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
33625
|
-
defaultValue: all.xiaohongshu.maxAutoVideoSize.toString(),
|
|
33626
|
-
isDisabled: all.xiaohongshu.videoQuality !== "adapt" || !all.xiaohongshu.switch,
|
|
33627
|
-
rules: [{
|
|
33628
|
-
min: 1,
|
|
33629
|
-
max: 2e4
|
|
33630
|
-
}]
|
|
33631
|
-
})
|
|
33632
|
-
]
|
|
33633
|
-
})]
|
|
33634
|
-
})];
|
|
33635
|
-
};
|
|
33636
|
-
//#endregion
|
|
33637
32579
|
//#region src/web.config.ts
|
|
33638
|
-
/**
|
|
33639
|
-
* 获取本机局域网 IP 地址
|
|
33640
|
-
* 优先返回常见局域网网段的 IP(192.168.x.x, 10.x.x.x, 172.16-31.x.x)
|
|
33641
|
-
*/
|
|
33642
|
-
function getLocalIP$1() {
|
|
33643
|
-
const interfaces = os.networkInterfaces();
|
|
33644
|
-
const candidates = [];
|
|
33645
|
-
for (const name of Object.keys(interfaces)) {
|
|
33646
|
-
const netInterface = interfaces[name];
|
|
33647
|
-
if (!netInterface) continue;
|
|
33648
|
-
for (const net of netInterface) if (net.family === "IPv4" && !net.internal) candidates.push(net.address);
|
|
33649
|
-
}
|
|
33650
|
-
return candidates.find((ip) => {
|
|
33651
|
-
if (ip.startsWith("192.168.")) return true;
|
|
33652
|
-
if (ip.startsWith("10.")) return true;
|
|
33653
|
-
if (ip.startsWith("172.")) {
|
|
33654
|
-
const second = parseInt(ip.split(".")[1], 10);
|
|
33655
|
-
if (second >= 16 && second <= 31) return true;
|
|
33656
|
-
}
|
|
33657
|
-
return false;
|
|
33658
|
-
}) || candidates[0] || "127.0.0.1";
|
|
33659
|
-
}
|
|
33660
32580
|
var webConfig = defineConfig({
|
|
33661
32581
|
info: {
|
|
33662
32582
|
id: "karin-plugin-kkk",
|
|
@@ -33677,1006 +32597,12 @@ var webConfig = defineConfig({
|
|
|
33677
32597
|
avatar: "https://github.com/sj817.png"
|
|
33678
32598
|
}]
|
|
33679
32599
|
},
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33683
|
-
|
|
33684
|
-
label: "Cookies 相关",
|
|
33685
|
-
children: [components.accordion.createItem("cfg:cookies", {
|
|
33686
|
-
title: "Cookies 相关",
|
|
33687
|
-
className: "ml-4 mr-4",
|
|
33688
|
-
subtitle: "建议配置,否则大部分功能无法使用",
|
|
33689
|
-
children: [
|
|
33690
|
-
components.input.string("douyin", {
|
|
33691
|
-
label: "抖音",
|
|
33692
|
-
type: "text",
|
|
33693
|
-
description: "请输入你的抖音Cookies,不输入则无法使用抖音相关功能噢",
|
|
33694
|
-
defaultValue: all.cookies.douyin,
|
|
33695
|
-
placeholder: "",
|
|
33696
|
-
rules: void 0,
|
|
33697
|
-
isRequired: false
|
|
33698
|
-
}),
|
|
33699
|
-
components.input.string("bilibili", {
|
|
33700
|
-
label: "B站",
|
|
33701
|
-
type: "text",
|
|
33702
|
-
description: "请输入你的B站Cookies,不输入部分功能将受限噢",
|
|
33703
|
-
defaultValue: all.cookies.bilibili,
|
|
33704
|
-
placeholder: "",
|
|
33705
|
-
rules: void 0,
|
|
33706
|
-
isRequired: false
|
|
33707
|
-
}),
|
|
33708
|
-
components.input.string("kuaishou", {
|
|
33709
|
-
label: "快手",
|
|
33710
|
-
type: "text",
|
|
33711
|
-
description: "请输入你的快手Cookies,不输入则无法使用快手相关功能噢",
|
|
33712
|
-
defaultValue: all.cookies.kuaishou,
|
|
33713
|
-
placeholder: "",
|
|
33714
|
-
rules: void 0,
|
|
33715
|
-
isRequired: false
|
|
33716
|
-
}),
|
|
33717
|
-
components.input.string("xiaohongshu", {
|
|
33718
|
-
label: "小红书",
|
|
33719
|
-
type: "text",
|
|
33720
|
-
description: "请输入你的小红书Cookies,不输入则无法使用小红书相关功能噢",
|
|
33721
|
-
defaultValue: all.cookies.xiaohongshu,
|
|
33722
|
-
placeholder: "",
|
|
33723
|
-
rules: void 0,
|
|
33724
|
-
isRequired: false
|
|
33725
|
-
})
|
|
33726
|
-
]
|
|
33727
|
-
})]
|
|
33728
|
-
}),
|
|
33729
|
-
components.accordion.create("app", {
|
|
33730
|
-
label: "插件应用相关",
|
|
33731
|
-
children: [components.accordion.createItem("cfg:app", {
|
|
33732
|
-
title: "插件应用相关",
|
|
33733
|
-
className: "ml-4 mr-4",
|
|
33734
|
-
subtitle: "此处用于管理插件的基本设置",
|
|
33735
|
-
children: [
|
|
33736
|
-
components.divider.create("divider-app-cache", {
|
|
33737
|
-
description: "缓存设置",
|
|
33738
|
-
descPosition: 20
|
|
33739
|
-
}),
|
|
33740
|
-
components.switch.create("removeCache", {
|
|
33741
|
-
label: "缓存删除",
|
|
33742
|
-
description: "下载的视频缓存自动删除,非必要不修改!",
|
|
33743
|
-
defaultSelected: all.app.removeCache
|
|
33744
|
-
}),
|
|
33745
|
-
components.divider.create("divider-app-priority", {
|
|
33746
|
-
description: "解析优先级设置",
|
|
33747
|
-
descPosition: 20
|
|
33748
|
-
}),
|
|
33749
|
-
components.switch.create("videoTool", {
|
|
33750
|
-
label: "默认解析",
|
|
33751
|
-
description: "即识别最高优先级,修改后重启生效",
|
|
33752
|
-
defaultSelected: all.app.videoTool
|
|
33753
|
-
}),
|
|
33754
|
-
components.input.number("priority", {
|
|
33755
|
-
label: "自定义优先级",
|
|
33756
|
-
description: "自定义优先级,「默认解析」关闭后才会生效。修改后重启生效",
|
|
33757
|
-
defaultValue: all.app.priority.toString(),
|
|
33758
|
-
isDisabled: all.app.videoTool,
|
|
33759
|
-
rules: void 0
|
|
33760
|
-
}),
|
|
33761
|
-
components.divider.create("divider-app-render", {
|
|
33762
|
-
description: "渲染配置",
|
|
33763
|
-
descPosition: 20
|
|
33764
|
-
}),
|
|
33765
|
-
components.input.number("renderScale", {
|
|
33766
|
-
label: "渲染精度",
|
|
33767
|
-
description: "可选值50~200,建议100。设置高精度会提高图片的精细度,过高可能会影响渲染与发送速度",
|
|
33768
|
-
defaultValue: all.app.renderScale.toString(),
|
|
33769
|
-
rules: [{
|
|
33770
|
-
min: 50,
|
|
33771
|
-
max: 200
|
|
33772
|
-
}]
|
|
33773
|
-
}),
|
|
33774
|
-
components.radio.group("Theme", {
|
|
33775
|
-
label: "渲染图片的主题色",
|
|
33776
|
-
orientation: "horizontal",
|
|
33777
|
-
defaultValue: all.app.Theme.toString(),
|
|
33778
|
-
radio: [
|
|
33779
|
-
components.radio.create("Theme-1", {
|
|
33780
|
-
label: "自动",
|
|
33781
|
-
description: "06:00-18:00为浅色,18:00-06:00为深色",
|
|
33782
|
-
value: "0"
|
|
33783
|
-
}),
|
|
33784
|
-
components.radio.create("Theme-2", {
|
|
33785
|
-
label: "浅色",
|
|
33786
|
-
value: "1"
|
|
33787
|
-
}),
|
|
33788
|
-
components.radio.create("Theme-3", {
|
|
33789
|
-
label: "深色",
|
|
33790
|
-
value: "2"
|
|
33791
|
-
})
|
|
33792
|
-
]
|
|
33793
|
-
}),
|
|
33794
|
-
components.switch.create("RemoveWatermark", {
|
|
33795
|
-
label: "移除版本信息",
|
|
33796
|
-
description: "渲染的图片是否移除底部版本信息",
|
|
33797
|
-
defaultSelected: all.app.RemoveWatermark
|
|
33798
|
-
}),
|
|
33799
|
-
components.input.number("RenderWaitTime", {
|
|
33800
|
-
label: "渲染图片的等待时间",
|
|
33801
|
-
description: os.platform() === "linux" ? "单位:秒,Linux系统下不能为0" : "单位:秒,传递 0 可禁用",
|
|
33802
|
-
defaultValue: all.app.RenderWaitTime.toString(),
|
|
33803
|
-
rules: [os.platform() === "linux" ? {
|
|
33804
|
-
min: 1,
|
|
33805
|
-
error: "Linux系统下渲染等待时间不能为0"
|
|
33806
|
-
} : { min: 0 }]
|
|
33807
|
-
}),
|
|
33808
|
-
components.switch.create("multiPageRender", {
|
|
33809
|
-
label: "分页渲染",
|
|
33810
|
-
description: "将模板渲染成多页的图片,以降低渲染器压力,默认开启,非必要不修改!",
|
|
33811
|
-
defaultSelected: all.app.multiPageRender
|
|
33812
|
-
}),
|
|
33813
|
-
components.input.number("multiPageHeight", {
|
|
33814
|
-
label: "分页渲染时,每页的高度",
|
|
33815
|
-
description: "经测试最佳每页高度为12000px,默认12000px",
|
|
33816
|
-
defaultValue: all.app.multiPageHeight.toString(),
|
|
33817
|
-
isDisabled: !all.app.multiPageRender,
|
|
33818
|
-
rules: [{
|
|
33819
|
-
min: 1e3,
|
|
33820
|
-
max: 2e4,
|
|
33821
|
-
error: "请输入一个范围在 1000 到 20000 之间的数字"
|
|
33822
|
-
}]
|
|
33823
|
-
}),
|
|
33824
|
-
components.divider.create("divider-app-live-photo", {
|
|
33825
|
-
description: "Live Photo 兼容设置",
|
|
33826
|
-
descPosition: 20
|
|
33827
|
-
}),
|
|
33828
|
-
components.radio.group("livePhotoMode", {
|
|
33829
|
-
label: "Live Photo 处理和发送方式",
|
|
33830
|
-
description: "解析遇到实况图时的处理和发送方式。注意:生成视频性能开销大,2C2G 服务器单张约需 20 秒",
|
|
33831
|
-
orientation: "horizontal",
|
|
33832
|
-
defaultValue: all.app.livePhotoMode || "video_and_livephoto",
|
|
33833
|
-
radio: [
|
|
33834
|
-
components.radio.create("livePhotoMode-video-and-livephoto", {
|
|
33835
|
-
label: "视频 + 实况图",
|
|
33836
|
-
description: "生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)+ 对应系统的实况图",
|
|
33837
|
-
value: "video_and_livephoto"
|
|
33838
|
-
}),
|
|
33839
|
-
components.radio.create("livePhotoMode-video-only", {
|
|
33840
|
-
label: "仅视频",
|
|
33841
|
-
description: "仅生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)",
|
|
33842
|
-
value: "video_only"
|
|
33843
|
-
}),
|
|
33844
|
-
components.radio.create("livePhotoMode-livephoto-only", {
|
|
33845
|
-
label: "仅实况图",
|
|
33846
|
-
description: "仅生成并发送对应系统的实况图,性能开销小",
|
|
33847
|
-
value: "livephoto_only"
|
|
33848
|
-
})
|
|
33849
|
-
]
|
|
33850
|
-
}),
|
|
33851
|
-
components.radio.group("livePhotoSystem", {
|
|
33852
|
-
label: "Live Photo 静态图兼容系统",
|
|
33853
|
-
description: "当解析到作品/动态包含 Live Photo 时,合并转发里发送的 Live Photo 静态图按所选系统生成。推荐 OPPO,兼容性最广",
|
|
33854
|
-
orientation: "horizontal",
|
|
33855
|
-
defaultValue: all.app.livePhotoSystem || "oppo",
|
|
33856
|
-
isDisabled: all.app.livePhotoMode === "video_only",
|
|
33857
|
-
radio: [
|
|
33858
|
-
components.radio.create("livePhotoSystem-google", {
|
|
33859
|
-
label: "Google",
|
|
33860
|
-
description: "Google Motion Photo 格式",
|
|
33861
|
-
value: "google"
|
|
33862
|
-
}),
|
|
33863
|
-
components.radio.create("livePhotoSystem-xiaomi", {
|
|
33864
|
-
label: "小米(HyperOS)",
|
|
33865
|
-
description: "兼容小米(任何版本)和 Google,但无法被 OPPO 识别",
|
|
33866
|
-
value: "xiaomi"
|
|
33867
|
-
}),
|
|
33868
|
-
components.radio.create("livePhotoSystem-oppo", {
|
|
33869
|
-
label: "OPPO(ColorOS)",
|
|
33870
|
-
description: "推荐,兼容 OPPO、小米(较新版本)和 Google",
|
|
33871
|
-
value: "oppo"
|
|
33872
|
-
}),
|
|
33873
|
-
components.radio.create("livePhotoSystem-huawei-honor", {
|
|
33874
|
-
label: "华为/荣耀(HarmonyOS/MagicOS)",
|
|
33875
|
-
description: "理论可行但未实测(作者无对应设备)",
|
|
33876
|
-
value: "huawei_honor"
|
|
33877
|
-
}),
|
|
33878
|
-
components.radio.create("livePhotoSystem-vivo", {
|
|
33879
|
-
label: "vivo(Origin OS)",
|
|
33880
|
-
description: "需要独立的图片和同名视频文件,暂不支持",
|
|
33881
|
-
value: "vivo",
|
|
33882
|
-
isDisabled: true
|
|
33883
|
-
}),
|
|
33884
|
-
components.radio.create("livePhotoSystem-iphone", {
|
|
33885
|
-
label: "iPhone(iOS)",
|
|
33886
|
-
description: "需要独立的图片和同名视频文件,暂不支持",
|
|
33887
|
-
value: "iphone",
|
|
33888
|
-
isDisabled: true
|
|
33889
|
-
})
|
|
33890
|
-
]
|
|
33891
|
-
}),
|
|
33892
|
-
components.divider.create("divider-app-api", {
|
|
33893
|
-
description: "API服务配置",
|
|
33894
|
-
descPosition: 20
|
|
33895
|
-
}),
|
|
33896
|
-
components.switch.create("APIServer", {
|
|
33897
|
-
label: "API服务",
|
|
33898
|
-
description: "本地部署一个视频解析API服务,接口范围为本插件用到的所有",
|
|
33899
|
-
defaultSelected: all.app.APIServer
|
|
33900
|
-
}),
|
|
33901
|
-
components.switch.create("APIServerMount", {
|
|
33902
|
-
label: "挂载到 Karin",
|
|
33903
|
-
description: "API 服务是否挂载到 Karin 上,开启后监听端口为 Karin 的 http 端口,修改后需重启。需开启「API服务」",
|
|
33904
|
-
defaultSelected: all.app.APIServerMount,
|
|
33905
|
-
isDisabled: !all.app.APIServer
|
|
33906
|
-
}),
|
|
33907
|
-
components.input.number("APIServerPort", {
|
|
33908
|
-
label: "API服务端口",
|
|
33909
|
-
defaultValue: all.app.APIServerPort.toString(),
|
|
33910
|
-
isDisabled: all.app.APIServerMount,
|
|
33911
|
-
rules: [{
|
|
33912
|
-
min: 1024,
|
|
33913
|
-
max: 65535,
|
|
33914
|
-
error: "请输入一个范围在 1024 到 65535 之间的数字"
|
|
33915
|
-
}]
|
|
33916
|
-
}),
|
|
33917
|
-
components.divider.create("divider-app-interaction", {
|
|
33918
|
-
description: "交互与认证设置",
|
|
33919
|
-
descPosition: 20
|
|
33920
|
-
}),
|
|
33921
|
-
components.switch.create("EmojiReply", {
|
|
33922
|
-
label: "表情回应",
|
|
33923
|
-
description: "在解析任务开始时添加表情回应,若适配器不支持需要关闭",
|
|
33924
|
-
defaultSelected: all.app.EmojiReply
|
|
33925
|
-
}),
|
|
33926
|
-
components.switch.create("parseTip", {
|
|
33927
|
-
label: "解析提示",
|
|
33928
|
-
description: "发送提示信息:\"检测到xxx链接,开始解析\"",
|
|
33929
|
-
defaultSelected: all.app.parseTip
|
|
33930
|
-
}),
|
|
33931
|
-
components.switch.create("fakeForward", {
|
|
33932
|
-
label: "伪造合并转发消息",
|
|
33933
|
-
description: "开启后合并转发将使用触发者身份展示;关闭后使用机器人身份展示",
|
|
33934
|
-
defaultSelected: all.app.fakeForward
|
|
33935
|
-
}),
|
|
33936
|
-
components.checkbox.group("errorLogSendTo", {
|
|
33937
|
-
label: "错误日志",
|
|
33938
|
-
description: "遇到错误时谁会收到错误日志。注:推送任务只可发送给主人。「第一个主人」与「所有主人」互斥。",
|
|
33939
|
-
orientation: "horizontal",
|
|
33940
|
-
defaultValue: all.app.errorLogSendTo,
|
|
33941
|
-
checkbox: [
|
|
33942
|
-
components.checkbox.create("errorLogSendTo:checkbox:1", {
|
|
33943
|
-
label: "第一个主人",
|
|
33944
|
-
value: "master"
|
|
33945
|
-
}),
|
|
33946
|
-
components.checkbox.create("errorLogSendTo:checkbox:2", {
|
|
33947
|
-
label: "所有主人",
|
|
33948
|
-
value: "allMasters"
|
|
33949
|
-
}),
|
|
33950
|
-
components.checkbox.create("errorLogSendTo:checkbox:3", {
|
|
33951
|
-
label: "触发者的群聊",
|
|
33952
|
-
value: "trigger"
|
|
33953
|
-
})
|
|
33954
|
-
]
|
|
33955
|
-
}),
|
|
33956
|
-
components.divider.create("divider-app-qrlogin", {
|
|
33957
|
-
description: "我的小玩具配置",
|
|
33958
|
-
descPosition: 20
|
|
33959
|
-
}),
|
|
33960
|
-
components.radio.group("qrLoginAddrType", {
|
|
33961
|
-
label: "扫码登录地址类型",
|
|
33962
|
-
description: "生成登录二维码时使用的服务器地址",
|
|
33963
|
-
orientation: "horizontal",
|
|
33964
|
-
defaultValue: all.app.qrLoginAddrType || "lan",
|
|
33965
|
-
radio: [components.radio.create("qrLoginAddrType-lan", {
|
|
33966
|
-
label: `局域网(${getLocalIP$1()})`,
|
|
33967
|
-
description: "适用于手机和服务器在同一局域网",
|
|
33968
|
-
value: "lan"
|
|
33969
|
-
}), components.radio.create("qrLoginAddrType-external", {
|
|
33970
|
-
label: "外部地址",
|
|
33971
|
-
description: "适用于远程访问,需手动配置",
|
|
33972
|
-
value: "external"
|
|
33973
|
-
})]
|
|
33974
|
-
}),
|
|
33975
|
-
components.input.string("qrLoginExternalAddr", {
|
|
33976
|
-
label: "外部访问地址",
|
|
33977
|
-
type: "text",
|
|
33978
|
-
description: "公网 IP 或域名,如:123.45.67.89 或 example.com",
|
|
33979
|
-
defaultValue: all.app.qrLoginExternalAddr || "",
|
|
33980
|
-
placeholder: "请输入公网 IP 或域名",
|
|
33981
|
-
isDisabled: all.app.qrLoginAddrType !== "external",
|
|
33982
|
-
isRequired: false
|
|
33983
|
-
})
|
|
33984
|
-
]
|
|
33985
|
-
})]
|
|
33986
|
-
}),
|
|
33987
|
-
...DouyinWeb(all),
|
|
33988
|
-
...BilibiliWeb(all),
|
|
33989
|
-
...KuaishouWeb(all),
|
|
33990
|
-
...XiaohongshuWeb(all),
|
|
33991
|
-
components.accordion.create("upload", {
|
|
33992
|
-
label: "视频上传和下载相关",
|
|
33993
|
-
children: [components.accordion.createItem("cfg:upload", {
|
|
33994
|
-
title: "上传和下载相关",
|
|
33995
|
-
className: "ml-4 mr-4",
|
|
33996
|
-
subtitle: "此处为视频上传和下载相关的用户偏好设置",
|
|
33997
|
-
children: [
|
|
33998
|
-
components.divider.create("divider-upload-method", {
|
|
33999
|
-
description: "发送方式配置",
|
|
34000
|
-
descPosition: 20
|
|
34001
|
-
}),
|
|
34002
|
-
components.radio.group("videoSendMode", {
|
|
34003
|
-
label: "本地视频发送方式",
|
|
34004
|
-
orientation: "vertical",
|
|
34005
|
-
defaultValue: all.upload.videoSendMode,
|
|
34006
|
-
isDisabled: all.upload.usegroupfile,
|
|
34007
|
-
radio: [components.radio.create("videoSendMode:radio-1", {
|
|
34008
|
-
label: "File 协议(本地文件)",
|
|
34009
|
-
description: "使用 file 协议发送本地视频,需 Karin 与协议端在同一系统",
|
|
34010
|
-
value: "file"
|
|
34011
|
-
}), components.radio.create("videoSendMode:radio-2", {
|
|
34012
|
-
label: "Base64(编码传输)",
|
|
34013
|
-
description: "将本地视频转换为 base64 发送,传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本,适合 karin 和协议端不在同一网络环境",
|
|
34014
|
-
value: "base64"
|
|
34015
|
-
})]
|
|
34016
|
-
}),
|
|
34017
|
-
components.switch.create("usegroupfile", {
|
|
34018
|
-
label: "群文件上传",
|
|
34019
|
-
description: "使用群文件上传,开启后会将视频文件上传到群文件中,需配置「群文件上传阈值」。与「本地视频发送方式 = Base64」互斥。",
|
|
34020
|
-
defaultSelected: all.upload.usegroupfile,
|
|
34021
|
-
isDisabled: all.upload.videoSendMode === "base64"
|
|
34022
|
-
}),
|
|
34023
|
-
components.input.number("groupfilevalue", {
|
|
34024
|
-
label: "群文件上传阈值",
|
|
34025
|
-
description: "当文件大小超过该值时将使用群文件上传,单位:MB,「使用群文件上传」开启后才会生效",
|
|
34026
|
-
defaultValue: all.upload.groupfilevalue.toString(),
|
|
34027
|
-
rules: [{ min: 1 }],
|
|
34028
|
-
isDisabled: !all.upload.usegroupfile || all.upload.videoSendMode === "base64"
|
|
34029
|
-
}),
|
|
34030
|
-
components.radio.group("imageSendMode", {
|
|
34031
|
-
label: "网络图片发送方式",
|
|
34032
|
-
orientation: "vertical",
|
|
34033
|
-
defaultValue: all.upload.imageSendMode,
|
|
34034
|
-
radio: [
|
|
34035
|
-
components.radio.create("imageSendMode:radio-1", {
|
|
34036
|
-
label: "URL 链接(直接传递)",
|
|
34037
|
-
description: "直接传递 HTTP 链接给上游下载,可能因上游网络问题导致下载超时",
|
|
34038
|
-
value: "url"
|
|
34039
|
-
}),
|
|
34040
|
-
components.radio.create("imageSendMode:radio-2", {
|
|
34041
|
-
label: "File 协议(本地文件)",
|
|
34042
|
-
description: "下载到本地后使用 file 协议发送,需 Karin 与协议端在同一系统",
|
|
34043
|
-
value: "file"
|
|
34044
|
-
}),
|
|
34045
|
-
components.radio.create("imageSendMode:radio-3", {
|
|
34046
|
-
label: "Base64(编码传输)",
|
|
34047
|
-
description: "下载后转换为 base64 发送,传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本",
|
|
34048
|
-
value: "base64"
|
|
34049
|
-
})
|
|
34050
|
-
]
|
|
34051
|
-
}),
|
|
34052
|
-
components.divider.create("divider-upload-limit", {
|
|
34053
|
-
description: "上传拦截配置",
|
|
34054
|
-
descPosition: 20
|
|
34055
|
-
}),
|
|
34056
|
-
components.switch.create("usefilelimit", {
|
|
34057
|
-
label: "视频上传拦截",
|
|
34058
|
-
description: "开启后会根据视频文件大小判断是否需要上传,需配置「视频拦截阈值」。",
|
|
34059
|
-
defaultSelected: all.upload.usefilelimit
|
|
34060
|
-
}),
|
|
34061
|
-
components.input.number("filelimit", {
|
|
34062
|
-
label: "视频拦截阈值",
|
|
34063
|
-
description: "视频文件大于该数值则直接结束任务,不会上传,单位: MB,「视频上传拦截」开启后才会生效。",
|
|
34064
|
-
defaultValue: all.upload.filelimit.toString(),
|
|
34065
|
-
rules: [{ min: 1 }],
|
|
34066
|
-
isDisabled: !all.upload.usefilelimit
|
|
34067
|
-
}),
|
|
34068
|
-
components.divider.create("divider-upload-compress", {
|
|
34069
|
-
description: "视频压缩配置",
|
|
34070
|
-
descPosition: 20
|
|
34071
|
-
}),
|
|
34072
|
-
components.switch.create("compress", {
|
|
34073
|
-
label: "压缩视频",
|
|
34074
|
-
description: "开启后会将视频文件压缩后再上传,适合上传大文件,任务过程中会吃满CPU,对低配服务器不友好。需配置「压缩触发阈值」与「压缩后的值」",
|
|
34075
|
-
defaultSelected: all.upload.compress
|
|
34076
|
-
}),
|
|
34077
|
-
components.input.number("compresstrigger", {
|
|
34078
|
-
label: "压缩触发阈值",
|
|
34079
|
-
description: "触发视频压缩的阈值,单位:MB。当文件大小超过该值时,才会压缩视频,「压缩视频」开启后才会生效",
|
|
34080
|
-
defaultValue: all.upload.compresstrigger.toString(),
|
|
34081
|
-
rules: [{ min: 1 }],
|
|
34082
|
-
isDisabled: !all.upload.compress
|
|
34083
|
-
}),
|
|
34084
|
-
components.input.number("compressvalue", {
|
|
34085
|
-
label: "压缩后的值",
|
|
34086
|
-
description: "单位:MB,若视频文件大小大于「压缩触发阈值」的值,则会进行压缩至该值(±5%),「压缩视频」开启后才会生效",
|
|
34087
|
-
defaultValue: all.upload.compressvalue.toString(),
|
|
34088
|
-
rules: [{ min: 1 }],
|
|
34089
|
-
isDisabled: !all.upload.compress
|
|
34090
|
-
}),
|
|
34091
|
-
components.divider.create("divider-upload-throttle", {
|
|
34092
|
-
description: "下载限速配置",
|
|
34093
|
-
descPosition: 20
|
|
34094
|
-
}),
|
|
34095
|
-
components.switch.create("downloadThrottle", {
|
|
34096
|
-
label: "下载限速",
|
|
34097
|
-
description: "开启后会限制下载速度,避免触发服务器风控导致连接被重置(ECONNRESET)。如果下载时经常报错\"连接被重置\",建议开启",
|
|
34098
|
-
defaultSelected: all.upload.downloadThrottle
|
|
34099
|
-
}),
|
|
34100
|
-
components.input.number("downloadMaxSpeed", {
|
|
34101
|
-
label: "最大下载速度",
|
|
34102
|
-
description: "单位:MB/s,建议设置为 5-20 之间。设置过高可能触发风控,设置过低会影响下载体验",
|
|
34103
|
-
defaultValue: all.upload.downloadMaxSpeed.toString(),
|
|
34104
|
-
rules: [{
|
|
34105
|
-
min: 1,
|
|
34106
|
-
max: 1e3,
|
|
34107
|
-
error: "请输入一个范围在 1 到 1000 之间的数字"
|
|
34108
|
-
}],
|
|
34109
|
-
isDisabled: !all.upload.downloadThrottle
|
|
34110
|
-
}),
|
|
34111
|
-
components.switch.create("downloadAutoReduce", {
|
|
34112
|
-
label: "断流自动降速",
|
|
34113
|
-
description: "当检测到连接被重置时自动降低下载速度,每次断流后速度会降低到当前的 60%",
|
|
34114
|
-
defaultSelected: all.upload.downloadAutoReduce,
|
|
34115
|
-
isDisabled: !all.upload.downloadThrottle
|
|
34116
|
-
}),
|
|
34117
|
-
components.input.number("downloadMinSpeed", {
|
|
34118
|
-
label: "最低下载速度",
|
|
34119
|
-
description: "单位:MB/s,自动降速时不会低于此值",
|
|
34120
|
-
defaultValue: all.upload.downloadMinSpeed.toString(),
|
|
34121
|
-
rules: [{
|
|
34122
|
-
min: .1,
|
|
34123
|
-
max: 100,
|
|
34124
|
-
error: "请输入一个范围在 0.1 到 100 之间的数字"
|
|
34125
|
-
}],
|
|
34126
|
-
isDisabled: !all.upload.downloadThrottle || !all.upload.downloadAutoReduce
|
|
34127
|
-
})
|
|
34128
|
-
]
|
|
34129
|
-
})]
|
|
34130
|
-
}),
|
|
34131
|
-
components.accordion.create("request", {
|
|
34132
|
-
label: "解析库请求配置相关",
|
|
34133
|
-
children: [components.accordion.createItem("cfg:request", {
|
|
34134
|
-
title: "解析库请求配置相关",
|
|
34135
|
-
className: "ml-4 mr-4",
|
|
34136
|
-
subtitle: "此处用于管理解析库的网络请求配置",
|
|
34137
|
-
children: [
|
|
34138
|
-
components.input.number("timeout", {
|
|
34139
|
-
label: "请求超时时间",
|
|
34140
|
-
description: "网络请求的超时时间,单位:毫秒",
|
|
34141
|
-
defaultValue: all.request.timeout.toString(),
|
|
34142
|
-
rules: [{
|
|
34143
|
-
min: 1e3,
|
|
34144
|
-
max: 3e5,
|
|
34145
|
-
error: "请输入一个范围在 1000 到 300000 之间的数字"
|
|
34146
|
-
}]
|
|
34147
|
-
}),
|
|
34148
|
-
components.input.string("User-Agent", {
|
|
34149
|
-
label: "User-Agent",
|
|
34150
|
-
type: "text",
|
|
34151
|
-
description: "请求头中的User-Agent字段,用于标识客户端类型",
|
|
34152
|
-
defaultValue: all.request["User-Agent"],
|
|
34153
|
-
placeholder: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
|
|
34154
|
-
rules: void 0,
|
|
34155
|
-
isRequired: false
|
|
34156
|
-
}),
|
|
34157
|
-
components.divider.create("divider-proxy", {
|
|
34158
|
-
description: "代理配置(可选)",
|
|
34159
|
-
descPosition: 20
|
|
34160
|
-
}),
|
|
34161
|
-
components.switch.create("proxy:switch", {
|
|
34162
|
-
label: "代理开关",
|
|
34163
|
-
description: "开启后需要配置「代理主机」「代理端口」",
|
|
34164
|
-
defaultSelected: all.request.proxy?.switch
|
|
34165
|
-
}),
|
|
34166
|
-
components.input.string("proxy:host", {
|
|
34167
|
-
label: "代理主机",
|
|
34168
|
-
type: "text",
|
|
34169
|
-
description: "代理服务器的主机地址,如:127.0.0.1",
|
|
34170
|
-
defaultValue: all.request.proxy?.host || "",
|
|
34171
|
-
placeholder: "127.0.0.1",
|
|
34172
|
-
rules: void 0,
|
|
34173
|
-
isDisabled: !all.request.proxy?.switch
|
|
34174
|
-
}),
|
|
34175
|
-
components.input.number("proxy:port", {
|
|
34176
|
-
label: "代理端口",
|
|
34177
|
-
description: "代理服务器的端口号",
|
|
34178
|
-
defaultValue: all.request.proxy?.port?.toString() || "",
|
|
34179
|
-
rules: [{
|
|
34180
|
-
min: 1,
|
|
34181
|
-
max: 65535,
|
|
34182
|
-
error: "请输入一个范围在 1 到 65535 之间的数字"
|
|
34183
|
-
}],
|
|
34184
|
-
isDisabled: !all.request.proxy?.switch
|
|
34185
|
-
}),
|
|
34186
|
-
components.radio.group("proxy:protocol", {
|
|
34187
|
-
label: "代理协议",
|
|
34188
|
-
orientation: "horizontal",
|
|
34189
|
-
defaultValue: all.request.proxy?.protocol || "http",
|
|
34190
|
-
radio: [components.radio.create("proxy-protocol-1", {
|
|
34191
|
-
label: "HTTP",
|
|
34192
|
-
value: "http"
|
|
34193
|
-
}), components.radio.create("proxy-protocol-2", {
|
|
34194
|
-
label: "HTTPS",
|
|
34195
|
-
value: "https"
|
|
34196
|
-
})],
|
|
34197
|
-
isDisabled: !all.request.proxy?.switch
|
|
34198
|
-
}),
|
|
34199
|
-
components.input.string("proxy:auth:username", {
|
|
34200
|
-
label: "代理用户名",
|
|
34201
|
-
type: "text",
|
|
34202
|
-
description: "代理服务器的认证用户名(如果需要)",
|
|
34203
|
-
defaultValue: all.request.proxy?.auth?.username || "",
|
|
34204
|
-
placeholder: "",
|
|
34205
|
-
rules: void 0,
|
|
34206
|
-
isRequired: false,
|
|
34207
|
-
isDisabled: !all.request.proxy?.switch
|
|
34208
|
-
}),
|
|
34209
|
-
components.input.string("proxy:auth:password", {
|
|
34210
|
-
label: "代理密码",
|
|
34211
|
-
type: "password",
|
|
34212
|
-
description: "代理服务器的认证密码(如果需要)",
|
|
34213
|
-
defaultValue: all.request.proxy?.auth?.password || "",
|
|
34214
|
-
placeholder: "",
|
|
34215
|
-
rules: void 0,
|
|
34216
|
-
isRequired: false,
|
|
34217
|
-
isDisabled: !all.request.proxy?.switch
|
|
34218
|
-
})
|
|
34219
|
-
]
|
|
34220
|
-
})]
|
|
34221
|
-
}),
|
|
34222
|
-
components.divider.create("divider-7", {
|
|
34223
|
-
description: "抖音推送列表相关",
|
|
34224
|
-
descPosition: 20
|
|
34225
|
-
}),
|
|
34226
|
-
components.accordionPro.create("pushlist:douyin", all.pushlist.douyin.map((item) => {
|
|
34227
|
-
return {
|
|
34228
|
-
...item,
|
|
34229
|
-
title: item.remark,
|
|
34230
|
-
subtitle: item.short_id
|
|
34231
|
-
};
|
|
34232
|
-
}), {
|
|
34233
|
-
label: "抖音推送列表",
|
|
34234
|
-
children: components.accordion.createItem("accordion-item-douyin", {
|
|
34235
|
-
className: "ml-4 mr-4",
|
|
34236
|
-
children: [
|
|
34237
|
-
components.switch.create("switch", {
|
|
34238
|
-
label: "是否启用",
|
|
34239
|
-
description: "是否启用该订阅项",
|
|
34240
|
-
color: "warning"
|
|
34241
|
-
}),
|
|
34242
|
-
components.input.string("short_id", {
|
|
34243
|
-
placeholder: "",
|
|
34244
|
-
label: "抖音号",
|
|
34245
|
-
description: "抖音号, 必填",
|
|
34246
|
-
errorMessage: "抖音号不能为空 Ciallo~(∠・ω< )⌒☆",
|
|
34247
|
-
color: "warning"
|
|
34248
|
-
}),
|
|
34249
|
-
components.input.group("group_id", {
|
|
34250
|
-
label: "绑定推送群",
|
|
34251
|
-
maxRows: 2,
|
|
34252
|
-
data: [],
|
|
34253
|
-
template: components.input.string("accordion-item-douyin:push:douyin:group_id", {
|
|
34254
|
-
placeholder: "必填,不能出现空值",
|
|
34255
|
-
label: "群号:机器人账号",
|
|
34256
|
-
color: "warning",
|
|
34257
|
-
rules: [{
|
|
34258
|
-
regex: /.+:.+/,
|
|
34259
|
-
error: "请使用 `群号:机器人账号` 的格式"
|
|
34260
|
-
}]
|
|
34261
|
-
})
|
|
34262
|
-
}),
|
|
34263
|
-
components.input.string("sec_uid", {
|
|
34264
|
-
color: "default",
|
|
34265
|
-
placeholder: "可不填,会自动获取",
|
|
34266
|
-
label: "UID",
|
|
34267
|
-
isRequired: false,
|
|
34268
|
-
description: "获取方法:PC浏览器打开某个博主主页,https://www.douyin.com/user/MS4wLj..... 其中的user/后的即为UID"
|
|
34269
|
-
}),
|
|
34270
|
-
components.input.string("remark", {
|
|
34271
|
-
color: "default",
|
|
34272
|
-
placeholder: "可不填,会自动获取",
|
|
34273
|
-
label: "昵称",
|
|
34274
|
-
isRequired: false,
|
|
34275
|
-
description: "博主的抖音名称"
|
|
34276
|
-
}),
|
|
34277
|
-
components.divider.create("push:douyin:divider-pushTypes", {
|
|
34278
|
-
description: "推送类型配置",
|
|
34279
|
-
descPosition: 20
|
|
34280
|
-
}),
|
|
34281
|
-
components.checkbox.group("pushTypes", {
|
|
34282
|
-
label: "推送类型",
|
|
34283
|
-
description: "选择要推送的内容类型,可多选",
|
|
34284
|
-
orientation: "horizontal",
|
|
34285
|
-
color: "warning",
|
|
34286
|
-
checkbox: [
|
|
34287
|
-
components.checkbox.create("pushTypes:checkbox:post", {
|
|
34288
|
-
label: "作品列表",
|
|
34289
|
-
description: "推送博主发布的作品",
|
|
34290
|
-
value: "post"
|
|
34291
|
-
}),
|
|
34292
|
-
components.checkbox.create("pushTypes:checkbox:favorite", {
|
|
34293
|
-
label: "喜欢列表",
|
|
34294
|
-
description: "推送博主喜欢的作品",
|
|
34295
|
-
value: "favorite"
|
|
34296
|
-
}),
|
|
34297
|
-
components.checkbox.create("pushTypes:checkbox:recommend", {
|
|
34298
|
-
label: "推荐列表",
|
|
34299
|
-
description: "推送博主的推荐作品",
|
|
34300
|
-
value: "recommend"
|
|
34301
|
-
}),
|
|
34302
|
-
components.checkbox.create("pushTypes:checkbox:live", {
|
|
34303
|
-
label: "直播",
|
|
34304
|
-
description: "推送博主开播通知",
|
|
34305
|
-
value: "live"
|
|
34306
|
-
})
|
|
34307
|
-
]
|
|
34308
|
-
}),
|
|
34309
|
-
components.divider.create("push:douyin:divider-1", {
|
|
34310
|
-
description: "过滤系统",
|
|
34311
|
-
descPosition: 20
|
|
34312
|
-
}),
|
|
34313
|
-
components.radio.group("filterMode", {
|
|
34314
|
-
label: "过滤模式",
|
|
34315
|
-
orientation: "horizontal",
|
|
34316
|
-
color: "warning",
|
|
34317
|
-
radio: [components.radio.create("push:bilibili:filterMode.radio-1", {
|
|
34318
|
-
label: "黑名单模式",
|
|
34319
|
-
description: "命中以下内容时,不推送",
|
|
34320
|
-
value: "blacklist"
|
|
34321
|
-
}), components.radio.create("push:bilibili:filterMode.radio-2", {
|
|
34322
|
-
label: "白名单模式",
|
|
34323
|
-
description: "命中以下内容时,才推送",
|
|
34324
|
-
value: "whitelist"
|
|
34325
|
-
})]
|
|
34326
|
-
}),
|
|
34327
|
-
components.input.group("Keywords", {
|
|
34328
|
-
label: "关键词",
|
|
34329
|
-
maxRows: 2,
|
|
34330
|
-
itemsPerRow: 4,
|
|
34331
|
-
data: [],
|
|
34332
|
-
template: components.input.string("push:bilibili:filterKeywords", {
|
|
34333
|
-
placeholder: "严禁提交空值",
|
|
34334
|
-
label: "",
|
|
34335
|
-
color: "warning"
|
|
34336
|
-
})
|
|
34337
|
-
}),
|
|
34338
|
-
components.input.group("Tags", {
|
|
34339
|
-
label: "标签",
|
|
34340
|
-
maxRows: 2,
|
|
34341
|
-
itemsPerRow: 4,
|
|
34342
|
-
data: [],
|
|
34343
|
-
template: components.input.string("push:bilibili:filterTags", {
|
|
34344
|
-
placeholder: "严禁提交空值",
|
|
34345
|
-
label: "",
|
|
34346
|
-
color: "warning"
|
|
34347
|
-
})
|
|
34348
|
-
})
|
|
34349
|
-
]
|
|
34350
|
-
})
|
|
34351
|
-
}),
|
|
34352
|
-
components.divider.create("divider-8", {
|
|
34353
|
-
description: "B站推送列表相关",
|
|
34354
|
-
descPosition: 20
|
|
34355
|
-
}),
|
|
34356
|
-
components.accordionPro.create("pushlist:bilibili", all.pushlist.bilibili.map((item) => {
|
|
34357
|
-
return {
|
|
34358
|
-
...item,
|
|
34359
|
-
title: item.remark,
|
|
34360
|
-
subtitle: item.host_mid
|
|
34361
|
-
};
|
|
34362
|
-
}), {
|
|
34363
|
-
label: "B站推送列表",
|
|
34364
|
-
children: components.accordion.createItem("accordion-item-bilibili", {
|
|
34365
|
-
className: "ml-4 mr-4",
|
|
34366
|
-
children: [
|
|
34367
|
-
components.switch.create("switch", {
|
|
34368
|
-
label: "是否启用",
|
|
34369
|
-
description: "是否启用该订阅项",
|
|
34370
|
-
color: "warning"
|
|
34371
|
-
}),
|
|
34372
|
-
components.input.number("host_mid", {
|
|
34373
|
-
placeholder: "",
|
|
34374
|
-
label: "UID",
|
|
34375
|
-
rules: void 0,
|
|
34376
|
-
description: "B站用户的UID,必填",
|
|
34377
|
-
errorMessage: "UID 不能为空 Ciallo~(∠・ω< )⌒☆",
|
|
34378
|
-
color: "warning"
|
|
34379
|
-
}),
|
|
34380
|
-
components.input.group("group_id", {
|
|
34381
|
-
label: "绑定推送群",
|
|
34382
|
-
maxRows: 2,
|
|
34383
|
-
data: [],
|
|
34384
|
-
template: components.input.string("accordion-item-bilibili:push:bilibili:group_id", {
|
|
34385
|
-
placeholder: "必填,不能出现空值",
|
|
34386
|
-
label: "",
|
|
34387
|
-
color: "warning",
|
|
34388
|
-
rules: [{
|
|
34389
|
-
regex: /.+:.+/,
|
|
34390
|
-
error: "请使用 `群号:机器人账号` 的格式"
|
|
34391
|
-
}]
|
|
34392
|
-
})
|
|
34393
|
-
}),
|
|
34394
|
-
components.input.string("remark", {
|
|
34395
|
-
color: "default",
|
|
34396
|
-
placeholder: "可不填,会自动获取",
|
|
34397
|
-
label: "昵称",
|
|
34398
|
-
isRequired: false,
|
|
34399
|
-
description: "UP主的昵称"
|
|
34400
|
-
}),
|
|
34401
|
-
components.divider.create("push:bilibili:divider-pushTypes", {
|
|
34402
|
-
description: "推送类型配置",
|
|
34403
|
-
descPosition: 20
|
|
34404
|
-
}),
|
|
34405
|
-
components.checkbox.group("pushTypes", {
|
|
34406
|
-
label: "推送类型",
|
|
34407
|
-
description: "选择要推送的动态类型,可多选",
|
|
34408
|
-
orientation: "horizontal",
|
|
34409
|
-
color: "warning",
|
|
34410
|
-
checkbox: [
|
|
34411
|
-
components.checkbox.create("pushTypes:checkbox:video", {
|
|
34412
|
-
label: "投稿视频",
|
|
34413
|
-
description: "推送UP主投稿的视频",
|
|
34414
|
-
value: "video"
|
|
34415
|
-
}),
|
|
34416
|
-
components.checkbox.create("pushTypes:checkbox:draw", {
|
|
34417
|
-
label: "图文动态",
|
|
34418
|
-
description: "推送UP主发布的图文动态",
|
|
34419
|
-
value: "draw"
|
|
34420
|
-
}),
|
|
34421
|
-
components.checkbox.create("pushTypes:checkbox:word", {
|
|
34422
|
-
label: "纯文动态",
|
|
34423
|
-
description: "推送UP主发布的纯文字动态",
|
|
34424
|
-
value: "word"
|
|
34425
|
-
}),
|
|
34426
|
-
components.checkbox.create("pushTypes:checkbox:live", {
|
|
34427
|
-
label: "直播动态",
|
|
34428
|
-
description: "推送UP主的直播通知",
|
|
34429
|
-
value: "live"
|
|
34430
|
-
}),
|
|
34431
|
-
components.checkbox.create("pushTypes:checkbox:forward", {
|
|
34432
|
-
label: "转发动态",
|
|
34433
|
-
description: "推送UP主的转发动态",
|
|
34434
|
-
value: "forward"
|
|
34435
|
-
}),
|
|
34436
|
-
components.checkbox.create("pushTypes:checkbox:article", {
|
|
34437
|
-
label: "投稿专栏",
|
|
34438
|
-
description: "推送UP主投稿的专栏文章",
|
|
34439
|
-
value: "article"
|
|
34440
|
-
})
|
|
34441
|
-
]
|
|
34442
|
-
}),
|
|
34443
|
-
components.divider.create("push:bilibili:divider-filter", {
|
|
34444
|
-
description: "过滤系统",
|
|
34445
|
-
descPosition: 20
|
|
34446
|
-
}),
|
|
34447
|
-
components.radio.group("filterMode", {
|
|
34448
|
-
label: "过滤模式",
|
|
34449
|
-
orientation: "horizontal",
|
|
34450
|
-
color: "warning",
|
|
34451
|
-
radio: [components.radio.create("push:bilibili:filterMode.radio-1", {
|
|
34452
|
-
label: "黑名单模式",
|
|
34453
|
-
description: "命中以下内容时,不推送",
|
|
34454
|
-
value: "blacklist"
|
|
34455
|
-
}), components.radio.create("push:bilibili:filterMode.radio-2", {
|
|
34456
|
-
label: "白名单模式",
|
|
34457
|
-
description: "命中以下内容时,才推送",
|
|
34458
|
-
value: "whitelist"
|
|
34459
|
-
})]
|
|
34460
|
-
}),
|
|
34461
|
-
components.input.group("Keywords", {
|
|
34462
|
-
label: "关键词",
|
|
34463
|
-
maxRows: 2,
|
|
34464
|
-
itemsPerRow: 4,
|
|
34465
|
-
data: [],
|
|
34466
|
-
description: "关键词,多个则使用逗号隔开",
|
|
34467
|
-
template: components.input.string("push:bilibili:filterKeywords", {
|
|
34468
|
-
placeholder: "严禁提交空值",
|
|
34469
|
-
label: "",
|
|
34470
|
-
color: "warning"
|
|
34471
|
-
})
|
|
34472
|
-
}),
|
|
34473
|
-
components.input.group("Tags", {
|
|
34474
|
-
label: "标签",
|
|
34475
|
-
maxRows: 2,
|
|
34476
|
-
itemsPerRow: 4,
|
|
34477
|
-
data: [],
|
|
34478
|
-
template: components.input.string("push:bilibili:filterTags", {
|
|
34479
|
-
placeholder: "严禁提交空值",
|
|
34480
|
-
label: "",
|
|
34481
|
-
color: "warning"
|
|
34482
|
-
})
|
|
34483
|
-
})
|
|
34484
|
-
]
|
|
34485
|
-
})
|
|
34486
|
-
})
|
|
34487
|
-
];
|
|
34488
|
-
},
|
|
34489
|
-
/** 前端点击保存之后调用的方法 */
|
|
34490
|
-
save: async (config) => {
|
|
34491
|
-
const formatCfg = processFrontendData(config);
|
|
34492
|
-
const oldAllCfg = await Config.All();
|
|
34493
|
-
const mergeCfg = _.mergeWith({}, oldAllCfg, formatCfg, customizer);
|
|
34494
|
-
cleanFlattenedFields(mergeCfg);
|
|
34495
|
-
let success = false;
|
|
34496
|
-
let isChange = false;
|
|
34497
|
-
let needReloadAmagi = false;
|
|
34498
|
-
for (const key of Object.keys(mergeCfg)) {
|
|
34499
|
-
const configValue = mergeCfg[key];
|
|
34500
|
-
if (configValue && typeof configValue === "object" && Object.keys(configValue).length > 0) {
|
|
34501
|
-
isChange = deepEqual(configValue, oldAllCfg[key]);
|
|
34502
|
-
if (isChange) {
|
|
34503
|
-
if (await Config.ModifyPro(key, configValue)) {
|
|
34504
|
-
success = true;
|
|
34505
|
-
if (key === "cookies" || key === "request") needReloadAmagi = true;
|
|
34506
|
-
}
|
|
34507
|
-
}
|
|
34508
|
-
}
|
|
34509
|
-
}
|
|
34510
|
-
await Config.syncConfigToDatabase();
|
|
34511
|
-
if (needReloadAmagi) reloadAmagiConfig();
|
|
34512
|
-
return {
|
|
34513
|
-
mergeCfg,
|
|
34514
|
-
formatCfg,
|
|
34515
|
-
success,
|
|
34516
|
-
message: success ? "保存成功 Ciallo~(∠・ω< )⌒☆" : "配置无变化 Ciallo~(∠・ω< )⌒☆"
|
|
34517
|
-
};
|
|
32600
|
+
page: {
|
|
32601
|
+
url: process.env.NODE_ENV === "development" ? "http://192.168.1.8:5176/kkk/karin-config" : "/kkk/karin-config",
|
|
32602
|
+
title: "kkk插件配置管理",
|
|
32603
|
+
description: "使用 kkk 插件自带的配置管理页面"
|
|
34518
32604
|
}
|
|
34519
32605
|
});
|
|
34520
|
-
/**
|
|
34521
|
-
* 遇到数组时用新数组覆盖原始数组(而不是合并)
|
|
34522
|
-
* @param value 原始内容
|
|
34523
|
-
* @param srcValue 新内容
|
|
34524
|
-
* @returns
|
|
34525
|
-
*/
|
|
34526
|
-
var customizer = (value, srcValue) => {
|
|
34527
|
-
if (Array.isArray(srcValue)) return srcValue;
|
|
34528
|
-
};
|
|
34529
|
-
/**
|
|
34530
|
-
* 归递判断配置是否修改
|
|
34531
|
-
* @param a 前端传回来的配置
|
|
34532
|
-
* @param b 用户原本的配置
|
|
34533
|
-
* @returns 配置对象是否被修改
|
|
34534
|
-
*/
|
|
34535
|
-
var deepEqual = (a, b) => {
|
|
34536
|
-
if (a === b) return false;
|
|
34537
|
-
if (typeof a === "string" && typeof b === "string") {
|
|
34538
|
-
if (a !== b) return true;
|
|
34539
|
-
}
|
|
34540
|
-
if (typeof a === "number" && typeof b === "number") {
|
|
34541
|
-
if (a !== b) return true;
|
|
34542
|
-
}
|
|
34543
|
-
if (typeof a === "boolean" && typeof b === "boolean") {
|
|
34544
|
-
if (a !== b) return true;
|
|
34545
|
-
}
|
|
34546
|
-
if (a === null || b === null || typeof a !== typeof b) return true;
|
|
34547
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
34548
|
-
if (a.length !== b.length) return true;
|
|
34549
|
-
for (let i = 0; i < a.length; i++) if (deepEqual(a[i], b[i])) return true;
|
|
34550
|
-
}
|
|
34551
|
-
let isChange = false;
|
|
34552
|
-
if (typeof a === "object" && typeof b === "object") {
|
|
34553
|
-
if (isChange) return true;
|
|
34554
|
-
const keysA = Object.keys(a);
|
|
34555
|
-
const keysB = Object.keys(b);
|
|
34556
|
-
if (keysA.length !== keysB.length) return true;
|
|
34557
|
-
for (const key of keysA) {
|
|
34558
|
-
if (!keysB.includes(key)) {
|
|
34559
|
-
isChange = true;
|
|
34560
|
-
return true;
|
|
34561
|
-
}
|
|
34562
|
-
if (deepEqual(a[key], b[key])) {
|
|
34563
|
-
isChange = true;
|
|
34564
|
-
return true;
|
|
34565
|
-
}
|
|
34566
|
-
}
|
|
34567
|
-
}
|
|
34568
|
-
return false;
|
|
34569
|
-
};
|
|
34570
|
-
/**
|
|
34571
|
-
* str 转 num
|
|
34572
|
-
* @param value 字符串
|
|
34573
|
-
* @returns
|
|
34574
|
-
*/
|
|
34575
|
-
var convertToNumber = (value) => {
|
|
34576
|
-
if (/^\d+$/.test(value)) return parseInt(value, 10);
|
|
34577
|
-
else return value;
|
|
34578
|
-
};
|
|
34579
|
-
/**
|
|
34580
|
-
* 获取数组中的第一个对象,如果数组为空则返回空对象
|
|
34581
|
-
* @param arr 数组
|
|
34582
|
-
* @returns 数组中的第一个对象或空对象
|
|
34583
|
-
*/
|
|
34584
|
-
var getFirstObject = (arr) => {
|
|
34585
|
-
return arr.length > 0 ? arr[0] : {};
|
|
34586
|
-
};
|
|
34587
|
-
/**
|
|
34588
|
-
* 设置嵌套属性值
|
|
34589
|
-
* @param obj 目标对象
|
|
34590
|
-
* @param keys 键路径数组
|
|
34591
|
-
* @param value 要设置的值
|
|
34592
|
-
*/
|
|
34593
|
-
var setNestedProperty = (obj, keys, value) => {
|
|
34594
|
-
let current = obj;
|
|
34595
|
-
for (let i = 0; i < keys.length - 1; i++) {
|
|
34596
|
-
const key = keys[i];
|
|
34597
|
-
if (!current[key] || typeof current[key] !== "object") current[key] = {};
|
|
34598
|
-
current = current[key];
|
|
34599
|
-
}
|
|
34600
|
-
const lastKey = keys[keys.length - 1];
|
|
34601
|
-
current[lastKey] = value;
|
|
34602
|
-
};
|
|
34603
|
-
/**
|
|
34604
|
-
* 处理前端返回的数据,将其转换为 ConfigType 格式
|
|
34605
|
-
* @param data 前端返回的数据
|
|
34606
|
-
* @returns 处理后符合 ConfigType 格式的数据
|
|
34607
|
-
*/
|
|
34608
|
-
var processFrontendData = (data) => {
|
|
34609
|
-
const result = {};
|
|
34610
|
-
const configKeys = Object.keys(data).filter((key) => {
|
|
34611
|
-
return !key.includes("pushlist") && key in data;
|
|
34612
|
-
});
|
|
34613
|
-
for (const key of configKeys) {
|
|
34614
|
-
const value = data[key];
|
|
34615
|
-
const firstObj = Array.isArray(value) ? getFirstObject(value) : {};
|
|
34616
|
-
const objKeys = Object.keys(firstObj);
|
|
34617
|
-
if (objKeys.length === 0) continue;
|
|
34618
|
-
const configObj = {};
|
|
34619
|
-
let hasValidData = false;
|
|
34620
|
-
const nestedProps = objKeys.filter((prop) => prop.includes(":"));
|
|
34621
|
-
const flatProps = objKeys.filter((prop) => !prop.includes(":"));
|
|
34622
|
-
for (const prop of nestedProps) {
|
|
34623
|
-
let propValue = firstObj[prop];
|
|
34624
|
-
if (typeof propValue === "string") propValue = convertToNumber(propValue);
|
|
34625
|
-
if (propValue !== void 0 && propValue !== null) {
|
|
34626
|
-
setNestedProperty(configObj, prop.split(":"), propValue);
|
|
34627
|
-
hasValidData = true;
|
|
34628
|
-
}
|
|
34629
|
-
}
|
|
34630
|
-
for (const prop of flatProps) {
|
|
34631
|
-
let propValue = firstObj[prop];
|
|
34632
|
-
if (typeof propValue === "string") propValue = convertToNumber(propValue);
|
|
34633
|
-
if (propValue !== void 0 && propValue !== null) {
|
|
34634
|
-
configObj[prop] = propValue;
|
|
34635
|
-
hasValidData = true;
|
|
34636
|
-
}
|
|
34637
|
-
}
|
|
34638
|
-
if (hasValidData && Object.keys(configObj).length > 0) result[key] = configObj;
|
|
34639
|
-
}
|
|
34640
|
-
result.pushlist = {
|
|
34641
|
-
douyin: data["pushlist:douyin"] || [],
|
|
34642
|
-
bilibili: (data["pushlist:bilibili"] || []).map((item) => {
|
|
34643
|
-
return {
|
|
34644
|
-
...item,
|
|
34645
|
-
host_mid: Number(item.host_mid)
|
|
34646
|
-
};
|
|
34647
|
-
})
|
|
34648
|
-
};
|
|
34649
|
-
return result;
|
|
34650
|
-
};
|
|
34651
|
-
/**
|
|
34652
|
-
* 通用的扁平化字段清理函数
|
|
34653
|
-
* 自动检测并清理与嵌套结构冲突的扁平化字段
|
|
34654
|
-
* @param obj 要清理的对象
|
|
34655
|
-
*/
|
|
34656
|
-
var cleanFlattenedFields = (obj) => {
|
|
34657
|
-
if (!obj || typeof obj !== "object") return;
|
|
34658
|
-
for (const [, value] of Object.entries(obj)) if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
34659
|
-
cleanFlattenedFields(value);
|
|
34660
|
-
const valueObj = value;
|
|
34661
|
-
const flattenedKeys = Object.keys(valueObj).filter((k) => k.includes("."));
|
|
34662
|
-
for (const flatKey of flattenedKeys) if (hasNestedStructure(valueObj, flatKey.split("."))) delete valueObj[flatKey];
|
|
34663
|
-
}
|
|
34664
|
-
};
|
|
34665
|
-
/**
|
|
34666
|
-
* 检查对象中是否存在指定路径的嵌套结构
|
|
34667
|
-
* @param obj 要检查的对象
|
|
34668
|
-
* @param path 路径数组
|
|
34669
|
-
* @returns 是否存在嵌套结构
|
|
34670
|
-
*/
|
|
34671
|
-
var hasNestedStructure = (obj, path) => {
|
|
34672
|
-
let current = obj;
|
|
34673
|
-
for (let i = 0; i < path.length - 1; i++) {
|
|
34674
|
-
const key = path[i];
|
|
34675
|
-
if (!current[key] || typeof current[key] !== "object") return false;
|
|
34676
|
-
current = current[key];
|
|
34677
|
-
}
|
|
34678
|
-
return path[path.length - 1] in current;
|
|
34679
|
-
};
|
|
34680
32606
|
//#endregion
|
|
34681
32607
|
//#region src/export/template.ts
|
|
34682
32608
|
var template_default = reactServerRender;
|
|
@@ -45569,6 +43495,18 @@ var signatureVerificationMiddleware = (req, res, next) => {
|
|
|
45569
43495
|
/**
|
|
45570
43496
|
* Bot 管理 API
|
|
45571
43497
|
*/
|
|
43498
|
+
var getOnlineBotById = (botId) => {
|
|
43499
|
+
return karin.getAllBotList().find((item) => item.bot.account.selfId === botId)?.bot;
|
|
43500
|
+
};
|
|
43501
|
+
var getBotAvatar = async (bot, botId) => {
|
|
43502
|
+
if (!bot) return "";
|
|
43503
|
+
try {
|
|
43504
|
+
return await bot.getAvatarUrl(botId) || "";
|
|
43505
|
+
} catch (e) {
|
|
43506
|
+
logger.warn(`[BotsAPI] 获取 Bot 头像失败 ${botId}:`, e);
|
|
43507
|
+
return "";
|
|
43508
|
+
}
|
|
43509
|
+
};
|
|
45572
43510
|
/**
|
|
45573
43511
|
* 获取所有在线 Bot 列表
|
|
45574
43512
|
* GET /api/v1/bots
|
|
@@ -45600,6 +43538,27 @@ var getBots = async (_req, res) => {
|
|
|
45600
43538
|
}
|
|
45601
43539
|
};
|
|
45602
43540
|
/**
|
|
43541
|
+
* 获取指定 Bot 信息
|
|
43542
|
+
* GET /api/v1/bots/:botId
|
|
43543
|
+
*/
|
|
43544
|
+
var getBotInfo = async (req, res) => {
|
|
43545
|
+
try {
|
|
43546
|
+
const { botId } = req.params;
|
|
43547
|
+
if (!botId) return createServerErrorResponse(res, "缺少 botId 参数");
|
|
43548
|
+
const bot = getOnlineBotById(botId);
|
|
43549
|
+
if (!bot || bot.account.name === "console") return createServerErrorResponse(res, "Bot 不存在或不在线");
|
|
43550
|
+
return createSuccessResponse(res, {
|
|
43551
|
+
id: bot.account.selfId,
|
|
43552
|
+
name: bot.account.name || bot.account.selfId,
|
|
43553
|
+
avatar: await getBotAvatar(bot, bot.account.selfId),
|
|
43554
|
+
isOnline: true
|
|
43555
|
+
});
|
|
43556
|
+
} catch (error) {
|
|
43557
|
+
logger.error("[BotsAPI] 获取 Bot 信息失败:", error);
|
|
43558
|
+
return createServerErrorResponse(res, "获取 Bot 信息失败");
|
|
43559
|
+
}
|
|
43560
|
+
};
|
|
43561
|
+
/**
|
|
45603
43562
|
* 获取指定 Bot 的群列表
|
|
45604
43563
|
* GET /api/v1/bots/:botId/groups
|
|
45605
43564
|
*/
|
|
@@ -45630,6 +43589,42 @@ var getBotGroups = async (req, res) => {
|
|
|
45630
43589
|
}
|
|
45631
43590
|
};
|
|
45632
43591
|
/**
|
|
43592
|
+
* 获取指定 Bot 下的群信息
|
|
43593
|
+
* GET /api/v1/bots/:botId/groups/:groupId
|
|
43594
|
+
*/
|
|
43595
|
+
var getBotGroupInfo = async (req, res) => {
|
|
43596
|
+
try {
|
|
43597
|
+
const { botId, groupId } = req.params;
|
|
43598
|
+
if (!botId || !groupId) return createServerErrorResponse(res, "缺少 botId 或 groupId 参数");
|
|
43599
|
+
const bot = getOnlineBotById(botId);
|
|
43600
|
+
if (!bot) return createServerErrorResponse(res, "Bot 不存在或不在线");
|
|
43601
|
+
let groupName = groupId;
|
|
43602
|
+
let groupAvatar = "";
|
|
43603
|
+
let memberCount;
|
|
43604
|
+
try {
|
|
43605
|
+
const groupInfo = await bot.getGroupInfo(groupId);
|
|
43606
|
+
groupName = groupInfo?.groupName || groupName;
|
|
43607
|
+
memberCount = groupInfo?.memberCount;
|
|
43608
|
+
groupAvatar = await bot.getGroupAvatarUrl(groupId) || "";
|
|
43609
|
+
} catch (e) {
|
|
43610
|
+
logger.warn(`[BotsAPI] 获取群组信息失败 ${groupId}:`, e);
|
|
43611
|
+
}
|
|
43612
|
+
return createSuccessResponse(res, {
|
|
43613
|
+
id: groupId,
|
|
43614
|
+
name: groupName,
|
|
43615
|
+
avatar: groupAvatar,
|
|
43616
|
+
botId: bot.account.selfId,
|
|
43617
|
+
botName: bot.account.name || bot.account.selfId,
|
|
43618
|
+
botAvatar: await getBotAvatar(bot, bot.account.selfId),
|
|
43619
|
+
memberCount,
|
|
43620
|
+
isOnline: true
|
|
43621
|
+
});
|
|
43622
|
+
} catch (error) {
|
|
43623
|
+
logger.error("[BotsAPI] 获取 Bot 群信息失败:", error);
|
|
43624
|
+
return createServerErrorResponse(res, "获取群信息失败");
|
|
43625
|
+
}
|
|
43626
|
+
};
|
|
43627
|
+
/**
|
|
45633
43628
|
* 批量获取群组信息
|
|
45634
43629
|
* POST /api/v1/groups/batch
|
|
45635
43630
|
* Body: { groups: [{ groupId: string, botId: string }] }
|
|
@@ -45752,6 +43747,7 @@ var updateConfigModule = async (req, res) => {
|
|
|
45752
43747
|
});
|
|
45753
43748
|
if (await Config.ModifyPro(module, newConfig)) {
|
|
45754
43749
|
if (module === "pushlist") await Config.syncConfigToDatabase();
|
|
43750
|
+
if (module === "cookies" || module === "request") reloadAmagiConfig();
|
|
45755
43751
|
const updatedConfig = await Config.All();
|
|
45756
43752
|
res.json({
|
|
45757
43753
|
success: true,
|
|
@@ -45818,13 +43814,25 @@ var updateAllConfig = async (req, res) => {
|
|
|
45818
43814
|
message: "请求体必须是有效的配置对象",
|
|
45819
43815
|
data: null
|
|
45820
43816
|
});
|
|
43817
|
+
const oldConfig = await Config.All();
|
|
45821
43818
|
const results = [];
|
|
43819
|
+
let needReloadAmagi = false;
|
|
45822
43820
|
for (const [module, config] of Object.entries(newConfig)) try {
|
|
45823
|
-
|
|
43821
|
+
if (!(module in oldConfig)) {
|
|
43822
|
+
results.push({
|
|
43823
|
+
module,
|
|
43824
|
+
success: false,
|
|
43825
|
+
error: `配置模块 "${module}" 不存在`
|
|
43826
|
+
});
|
|
43827
|
+
continue;
|
|
43828
|
+
}
|
|
43829
|
+
const moduleName = module;
|
|
43830
|
+
const success = await Config.ModifyPro(moduleName, config);
|
|
45824
43831
|
results.push({
|
|
45825
43832
|
module,
|
|
45826
43833
|
success
|
|
45827
43834
|
});
|
|
43835
|
+
if (success && (moduleName === "cookies" || moduleName === "request")) needReloadAmagi = true;
|
|
45828
43836
|
} catch (error) {
|
|
45829
43837
|
results.push({
|
|
45830
43838
|
module,
|
|
@@ -45833,6 +43841,7 @@ var updateAllConfig = async (req, res) => {
|
|
|
45833
43841
|
});
|
|
45834
43842
|
}
|
|
45835
43843
|
if ("pushlist" in newConfig) await Config.syncConfigToDatabase();
|
|
43844
|
+
if (needReloadAmagi) reloadAmagiConfig();
|
|
45836
43845
|
const allSuccess = results.every((r) => r.success);
|
|
45837
43846
|
const updatedConfig = await Config.All();
|
|
45838
43847
|
res.json({
|
|
@@ -46005,1826 +44014,6 @@ var resolveLink = async (req, res) => {
|
|
|
46005
44014
|
}
|
|
46006
44015
|
};
|
|
46007
44016
|
//#endregion
|
|
46008
|
-
//#region src/module/config/schema.ts
|
|
46009
|
-
/** 创建变量引用 */
|
|
46010
|
-
var $var = (field) => ({
|
|
46011
|
-
type: "var",
|
|
46012
|
-
field
|
|
46013
|
-
});
|
|
46014
|
-
/** 创建字面量 */
|
|
46015
|
-
var $literal = (value) => ({
|
|
46016
|
-
type: "literal",
|
|
46017
|
-
value
|
|
46018
|
-
});
|
|
46019
|
-
/** 创建比较表达式 */
|
|
46020
|
-
var $compare = (left, operator, right) => ({
|
|
46021
|
-
type: "compare",
|
|
46022
|
-
operator,
|
|
46023
|
-
left: typeof left === "string" ? $var(left) : left,
|
|
46024
|
-
right: typeof right === "string" ? $var(right) : typeof right === "object" ? right : $literal(right)
|
|
46025
|
-
});
|
|
46026
|
-
/** 创建逻辑非 */
|
|
46027
|
-
var $not = (condition) => ({
|
|
46028
|
-
type: "not",
|
|
46029
|
-
condition: typeof condition === "string" ? $var(condition) : condition
|
|
46030
|
-
});
|
|
46031
|
-
/** 创建逻辑或 */
|
|
46032
|
-
var $or = (...conditions) => ({
|
|
46033
|
-
type: "or",
|
|
46034
|
-
conditions: conditions.map((c) => typeof c === "string" ? $var(c) : c)
|
|
46035
|
-
});
|
|
46036
|
-
/** 创建数组包含检查 */
|
|
46037
|
-
var $includes = (field, value) => ({
|
|
46038
|
-
type: "includes",
|
|
46039
|
-
field,
|
|
46040
|
-
value
|
|
46041
|
-
});
|
|
46042
|
-
/** 快捷方式:字段等于某值 */
|
|
46043
|
-
var $eq = (field, value) => $compare(field, "===", value);
|
|
46044
|
-
/** 快捷方式:字段不等于某值 */
|
|
46045
|
-
var $ne = (field, value) => $compare(field, "!==", value);
|
|
46046
|
-
//#endregion
|
|
46047
|
-
//#region src/module/config/app.schema.ts
|
|
46048
|
-
/**
|
|
46049
|
-
* 应用配置 Schema
|
|
46050
|
-
*/
|
|
46051
|
-
var appConfigSchema = {
|
|
46052
|
-
key: "app",
|
|
46053
|
-
title: "插件应用相关",
|
|
46054
|
-
subtitle: "此处用于管理插件的基本设置",
|
|
46055
|
-
fields: [
|
|
46056
|
-
{
|
|
46057
|
-
type: "divider",
|
|
46058
|
-
title: "缓存设置"
|
|
46059
|
-
},
|
|
46060
|
-
{
|
|
46061
|
-
key: "removeCache",
|
|
46062
|
-
type: "switch",
|
|
46063
|
-
label: "缓存删除",
|
|
46064
|
-
description: "下载的视频缓存自动删除,非必要不修改!"
|
|
46065
|
-
},
|
|
46066
|
-
{
|
|
46067
|
-
type: "divider",
|
|
46068
|
-
title: "解析优先级设置"
|
|
46069
|
-
},
|
|
46070
|
-
{
|
|
46071
|
-
key: "videoTool",
|
|
46072
|
-
type: "switch",
|
|
46073
|
-
label: "默认解析",
|
|
46074
|
-
description: "即识别最高优先级,修改后重启生效"
|
|
46075
|
-
},
|
|
46076
|
-
{
|
|
46077
|
-
key: "priority",
|
|
46078
|
-
type: "input",
|
|
46079
|
-
inputType: "number",
|
|
46080
|
-
label: "自定义优先级",
|
|
46081
|
-
description: "自定义优先级,「默认解析」关闭后才会生效。修改后重启生效",
|
|
46082
|
-
disabled: $var("videoTool")
|
|
46083
|
-
},
|
|
46084
|
-
{
|
|
46085
|
-
type: "divider",
|
|
46086
|
-
title: "渲染配置"
|
|
46087
|
-
},
|
|
46088
|
-
{
|
|
46089
|
-
key: "renderScale",
|
|
46090
|
-
type: "input",
|
|
46091
|
-
inputType: "number",
|
|
46092
|
-
label: "渲染精度",
|
|
46093
|
-
description: "可选值50~200,建议100。设置高精度会提高图片的精细度,过高可能会影响渲染与发送速度",
|
|
46094
|
-
rules: [{
|
|
46095
|
-
min: 50,
|
|
46096
|
-
max: 200
|
|
46097
|
-
}]
|
|
46098
|
-
},
|
|
46099
|
-
{
|
|
46100
|
-
key: "Theme",
|
|
46101
|
-
type: "radio",
|
|
46102
|
-
label: "渲染图片的主题色",
|
|
46103
|
-
orientation: "horizontal",
|
|
46104
|
-
options: [
|
|
46105
|
-
{
|
|
46106
|
-
label: "自动",
|
|
46107
|
-
value: "0",
|
|
46108
|
-
description: "06:00-18:00为浅色,18:00-06:00为深色"
|
|
46109
|
-
},
|
|
46110
|
-
{
|
|
46111
|
-
label: "浅色",
|
|
46112
|
-
value: "1"
|
|
46113
|
-
},
|
|
46114
|
-
{
|
|
46115
|
-
label: "深色",
|
|
46116
|
-
value: "2"
|
|
46117
|
-
}
|
|
46118
|
-
]
|
|
46119
|
-
},
|
|
46120
|
-
{
|
|
46121
|
-
key: "RemoveWatermark",
|
|
46122
|
-
type: "switch",
|
|
46123
|
-
label: "移除版本信息",
|
|
46124
|
-
description: "渲染的图片是否移除底部版本信息"
|
|
46125
|
-
},
|
|
46126
|
-
{
|
|
46127
|
-
key: "RenderWaitTime",
|
|
46128
|
-
type: "input",
|
|
46129
|
-
inputType: "number",
|
|
46130
|
-
label: "渲染图片的等待时间",
|
|
46131
|
-
description: os.platform() === "linux" ? "单位:秒,Linux系统下不能为0" : "单位:秒,传递 0 可禁用",
|
|
46132
|
-
rules: [os.platform() === "linux" ? {
|
|
46133
|
-
min: 1,
|
|
46134
|
-
error: "Linux系统下渲染等待时间不能为0"
|
|
46135
|
-
} : { min: 0 }]
|
|
46136
|
-
},
|
|
46137
|
-
{
|
|
46138
|
-
key: "multiPageRender",
|
|
46139
|
-
type: "switch",
|
|
46140
|
-
label: "分页渲染",
|
|
46141
|
-
description: "将模板渲染成多页的图片,以降低渲染器压力,默认开启,非必要不修改!"
|
|
46142
|
-
},
|
|
46143
|
-
{
|
|
46144
|
-
key: "multiPageHeight",
|
|
46145
|
-
type: "input",
|
|
46146
|
-
inputType: "number",
|
|
46147
|
-
label: "分页渲染时,每页的高度",
|
|
46148
|
-
description: "经测试最佳每页高度为12000px,默认12000px",
|
|
46149
|
-
disabled: $not("multiPageRender"),
|
|
46150
|
-
rules: [{
|
|
46151
|
-
min: 1e3,
|
|
46152
|
-
max: 2e4,
|
|
46153
|
-
error: "请输入一个范围在 1000 到 20000 之间的数字"
|
|
46154
|
-
}]
|
|
46155
|
-
},
|
|
46156
|
-
{
|
|
46157
|
-
type: "divider",
|
|
46158
|
-
title: "Live Photo 兼容设置"
|
|
46159
|
-
},
|
|
46160
|
-
{
|
|
46161
|
-
key: "livePhotoMode",
|
|
46162
|
-
type: "radio",
|
|
46163
|
-
label: "Live Photo 处理和发送方式",
|
|
46164
|
-
description: "解析遇到实况图时的处理和发送方式。注意:生成视频性能开销大,2C2G 服务器单张约需 20 秒",
|
|
46165
|
-
orientation: "horizontal",
|
|
46166
|
-
options: [
|
|
46167
|
-
{
|
|
46168
|
-
label: "视频 + 实况图",
|
|
46169
|
-
value: "video_and_livephoto",
|
|
46170
|
-
description: "生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)+ 对应系统的实况图"
|
|
46171
|
-
},
|
|
46172
|
-
{
|
|
46173
|
-
label: "仅视频",
|
|
46174
|
-
value: "video_only",
|
|
46175
|
-
description: "仅生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)"
|
|
46176
|
-
},
|
|
46177
|
-
{
|
|
46178
|
-
label: "仅实况图",
|
|
46179
|
-
value: "livephoto_only",
|
|
46180
|
-
description: "仅生成并发送对应系统的实况图,性能开销小"
|
|
46181
|
-
}
|
|
46182
|
-
]
|
|
46183
|
-
},
|
|
46184
|
-
{
|
|
46185
|
-
key: "livePhotoSystem",
|
|
46186
|
-
type: "radio",
|
|
46187
|
-
label: "Live Photo 静态图兼容系统",
|
|
46188
|
-
description: "当解析到作品/动态包含 Live Photo 时,合并转发里发送的 Live Photo 静态图按所选系统生成。推荐 OPPO,兼容性最广",
|
|
46189
|
-
orientation: "horizontal",
|
|
46190
|
-
disabled: $ne("livePhotoMode", "livephoto_only"),
|
|
46191
|
-
options: [
|
|
46192
|
-
{
|
|
46193
|
-
label: "Google",
|
|
46194
|
-
value: "google",
|
|
46195
|
-
description: "Google Motion Photo 格式"
|
|
46196
|
-
},
|
|
46197
|
-
{
|
|
46198
|
-
label: "小米(HyperOS)",
|
|
46199
|
-
value: "xiaomi",
|
|
46200
|
-
description: "兼容小米(任何版本)和 Google,但无法被 OPPO 识别"
|
|
46201
|
-
},
|
|
46202
|
-
{
|
|
46203
|
-
label: "OPPO(ColorOS)",
|
|
46204
|
-
value: "oppo",
|
|
46205
|
-
description: "推荐,兼容 OPPO、小米(较新版本)和 Google"
|
|
46206
|
-
},
|
|
46207
|
-
{
|
|
46208
|
-
label: "华为/荣耀(HarmonyOS/MagicOS)",
|
|
46209
|
-
value: "huawei_honor",
|
|
46210
|
-
description: "理论可行但未实测"
|
|
46211
|
-
}
|
|
46212
|
-
]
|
|
46213
|
-
},
|
|
46214
|
-
{
|
|
46215
|
-
type: "divider",
|
|
46216
|
-
title: "API服务配置"
|
|
46217
|
-
},
|
|
46218
|
-
{
|
|
46219
|
-
key: "APIServer",
|
|
46220
|
-
type: "switch",
|
|
46221
|
-
label: "API服务",
|
|
46222
|
-
description: "本地部署一个视频解析API服务,接口范围为本插件用到的所有"
|
|
46223
|
-
},
|
|
46224
|
-
{
|
|
46225
|
-
key: "APIServerMount",
|
|
46226
|
-
type: "switch",
|
|
46227
|
-
label: "挂载到 Karin",
|
|
46228
|
-
description: "API 服务是否挂载到 Karin 上,开启后监听端口为 Karin 的 http 端口,修改后需重启。需开启「API服务」",
|
|
46229
|
-
disabled: $not("APIServer")
|
|
46230
|
-
},
|
|
46231
|
-
{
|
|
46232
|
-
key: "APIServerPort",
|
|
46233
|
-
type: "input",
|
|
46234
|
-
inputType: "number",
|
|
46235
|
-
label: "API服务端口",
|
|
46236
|
-
disabled: $or($not("APIServer"), $var("APIServerMount")),
|
|
46237
|
-
rules: [{
|
|
46238
|
-
min: 1024,
|
|
46239
|
-
max: 65535,
|
|
46240
|
-
error: "请输入一个范围在 1024 到 65535 之间的数字"
|
|
46241
|
-
}]
|
|
46242
|
-
},
|
|
46243
|
-
{
|
|
46244
|
-
type: "divider",
|
|
46245
|
-
title: "交互与认证设置"
|
|
46246
|
-
},
|
|
46247
|
-
{
|
|
46248
|
-
key: "EmojiReply",
|
|
46249
|
-
type: "switch",
|
|
46250
|
-
label: "表情回应",
|
|
46251
|
-
description: "在解析任务开始时添加表情回应,若适配器不支持需要关闭"
|
|
46252
|
-
},
|
|
46253
|
-
{
|
|
46254
|
-
key: "parseTip",
|
|
46255
|
-
type: "switch",
|
|
46256
|
-
label: "解析提示",
|
|
46257
|
-
description: "发送提示信息:\"检测到xxx链接,开始解析\""
|
|
46258
|
-
},
|
|
46259
|
-
{
|
|
46260
|
-
key: "fakeForward",
|
|
46261
|
-
type: "switch",
|
|
46262
|
-
label: "伪造合并转发消息",
|
|
46263
|
-
description: "开启后合并转发将使用触发者身份展示;关闭后使用机器人身份展示"
|
|
46264
|
-
},
|
|
46265
|
-
{
|
|
46266
|
-
key: "errorLogSendTo",
|
|
46267
|
-
type: "checkbox",
|
|
46268
|
-
label: "错误日志",
|
|
46269
|
-
description: "遇到错误时谁会收到错误日志。注:推送任务只可发送给主人。「第一个主人」与「所有主人」互斥。",
|
|
46270
|
-
orientation: "horizontal",
|
|
46271
|
-
options: [
|
|
46272
|
-
{
|
|
46273
|
-
label: "第一个主人",
|
|
46274
|
-
value: "master"
|
|
46275
|
-
},
|
|
46276
|
-
{
|
|
46277
|
-
label: "所有主人",
|
|
46278
|
-
value: "allMasters"
|
|
46279
|
-
},
|
|
46280
|
-
{
|
|
46281
|
-
label: "触发者的群聊",
|
|
46282
|
-
value: "trigger"
|
|
46283
|
-
}
|
|
46284
|
-
]
|
|
46285
|
-
},
|
|
46286
|
-
{
|
|
46287
|
-
type: "divider",
|
|
46288
|
-
title: "我的小玩具配置"
|
|
46289
|
-
},
|
|
46290
|
-
{
|
|
46291
|
-
key: "qrLoginAddrType",
|
|
46292
|
-
type: "radio",
|
|
46293
|
-
label: "扫码登录地址类型",
|
|
46294
|
-
description: "生成登录二维码时使用的服务器地址",
|
|
46295
|
-
orientation: "horizontal",
|
|
46296
|
-
options: [{
|
|
46297
|
-
label: "局域网",
|
|
46298
|
-
value: "lan",
|
|
46299
|
-
description: "适用于手机和服务器在同一局域网"
|
|
46300
|
-
}, {
|
|
46301
|
-
label: "外部地址",
|
|
46302
|
-
value: "external",
|
|
46303
|
-
description: "适用于远程访问,需手动配置"
|
|
46304
|
-
}]
|
|
46305
|
-
},
|
|
46306
|
-
{
|
|
46307
|
-
key: "qrLoginExternalAddr",
|
|
46308
|
-
type: "input",
|
|
46309
|
-
inputType: "text",
|
|
46310
|
-
label: "外部访问地址",
|
|
46311
|
-
description: "公网 IP 或域名,如:123.45.67.89 或 example.com",
|
|
46312
|
-
placeholder: "请输入公网 IP 或域名",
|
|
46313
|
-
disabled: $ne("qrLoginAddrType", "external")
|
|
46314
|
-
}
|
|
46315
|
-
]
|
|
46316
|
-
};
|
|
46317
|
-
//#endregion
|
|
46318
|
-
//#region src/module/config/bilibili.schema.ts
|
|
46319
|
-
var bilibiliConfigSchema = {
|
|
46320
|
-
key: "bilibili",
|
|
46321
|
-
title: "B站相关",
|
|
46322
|
-
subtitle: "此处为B站相关的用户偏好设置",
|
|
46323
|
-
fields: [
|
|
46324
|
-
{
|
|
46325
|
-
key: "switch",
|
|
46326
|
-
type: "switch",
|
|
46327
|
-
label: "解析开关",
|
|
46328
|
-
description: "B站解析开关,此开关为单独开关"
|
|
46329
|
-
},
|
|
46330
|
-
{
|
|
46331
|
-
key: "tip",
|
|
46332
|
-
type: "switch",
|
|
46333
|
-
label: "解析提示",
|
|
46334
|
-
description: "B站解析提示,发送提示信息:\"检测到B站链接,开始解析\"",
|
|
46335
|
-
disabled: $not("switch")
|
|
46336
|
-
},
|
|
46337
|
-
{
|
|
46338
|
-
key: "sendContent",
|
|
46339
|
-
type: "checkbox",
|
|
46340
|
-
label: "解析时发送的内容",
|
|
46341
|
-
description: "若什么都不选,可能不会返回任何解析结果",
|
|
46342
|
-
orientation: "horizontal",
|
|
46343
|
-
disabled: $not("switch"),
|
|
46344
|
-
options: [
|
|
46345
|
-
{
|
|
46346
|
-
label: "视频信息",
|
|
46347
|
-
value: "info",
|
|
46348
|
-
description: "仅解析视频时有效"
|
|
46349
|
-
},
|
|
46350
|
-
{
|
|
46351
|
-
label: "评论列表",
|
|
46352
|
-
value: "comment"
|
|
46353
|
-
},
|
|
46354
|
-
{
|
|
46355
|
-
label: "视频文件",
|
|
46356
|
-
value: "video",
|
|
46357
|
-
description: "仅对视频稿件有效"
|
|
46358
|
-
}
|
|
46359
|
-
]
|
|
46360
|
-
},
|
|
46361
|
-
{
|
|
46362
|
-
type: "divider",
|
|
46363
|
-
title: "评论详情设置"
|
|
46364
|
-
},
|
|
46365
|
-
{
|
|
46366
|
-
key: "numcomment",
|
|
46367
|
-
type: "input",
|
|
46368
|
-
inputType: "number",
|
|
46369
|
-
label: "评论解析数量",
|
|
46370
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment"))),
|
|
46371
|
-
rules: [{ min: 1 }]
|
|
46372
|
-
},
|
|
46373
|
-
{
|
|
46374
|
-
key: "realCommentCount",
|
|
46375
|
-
type: "switch",
|
|
46376
|
-
label: "显示真实评论数量",
|
|
46377
|
-
description: "评论图是否显示真实评论数量,关闭则显示解析到的评论数量",
|
|
46378
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment")))
|
|
46379
|
-
},
|
|
46380
|
-
{
|
|
46381
|
-
key: "commentImageCollection",
|
|
46382
|
-
type: "switch",
|
|
46383
|
-
label: "是否收集评论区的图片",
|
|
46384
|
-
description: "开启后将收集评论区的图片,以合并转发的形式返回",
|
|
46385
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment")))
|
|
46386
|
-
},
|
|
46387
|
-
{
|
|
46388
|
-
type: "divider",
|
|
46389
|
-
title: "渲染与画质设置"
|
|
46390
|
-
},
|
|
46391
|
-
{
|
|
46392
|
-
key: "imageLayout",
|
|
46393
|
-
type: "radio",
|
|
46394
|
-
label: "解析图文动态时,遇到多张图片时的页面布局方式(动态推送图片也生效)",
|
|
46395
|
-
description: "自动布局:少于4张时逐张上下排列;4~8张时瀑布流;9张及以上九宫格",
|
|
46396
|
-
orientation: "horizontal",
|
|
46397
|
-
options: [
|
|
46398
|
-
{
|
|
46399
|
-
label: "自动布局",
|
|
46400
|
-
value: "auto"
|
|
46401
|
-
},
|
|
46402
|
-
{
|
|
46403
|
-
label: "逐张上下排列",
|
|
46404
|
-
value: "vertical"
|
|
46405
|
-
},
|
|
46406
|
-
{
|
|
46407
|
-
label: "瀑布流排列",
|
|
46408
|
-
value: "waterfall"
|
|
46409
|
-
},
|
|
46410
|
-
{
|
|
46411
|
-
label: "九宫格排列",
|
|
46412
|
-
value: "grid"
|
|
46413
|
-
}
|
|
46414
|
-
]
|
|
46415
|
-
},
|
|
46416
|
-
{
|
|
46417
|
-
key: "videoQuality",
|
|
46418
|
-
type: "radio",
|
|
46419
|
-
label: "画质偏好",
|
|
46420
|
-
description: "解析视频的分辨率偏好。",
|
|
46421
|
-
orientation: "horizontal",
|
|
46422
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "video"))),
|
|
46423
|
-
options: [
|
|
46424
|
-
{
|
|
46425
|
-
label: "自动选择",
|
|
46426
|
-
value: 0
|
|
46427
|
-
},
|
|
46428
|
-
{
|
|
46429
|
-
label: "240P 极速",
|
|
46430
|
-
value: 6
|
|
46431
|
-
},
|
|
46432
|
-
{
|
|
46433
|
-
label: "360P 流畅",
|
|
46434
|
-
value: 16
|
|
46435
|
-
},
|
|
46436
|
-
{
|
|
46437
|
-
label: "480P 清晰",
|
|
46438
|
-
value: 32,
|
|
46439
|
-
description: "需登录(配置ck)"
|
|
46440
|
-
},
|
|
46441
|
-
{
|
|
46442
|
-
label: "720P 高清",
|
|
46443
|
-
value: 64,
|
|
46444
|
-
description: "需登录(配置ck)"
|
|
46445
|
-
},
|
|
46446
|
-
{
|
|
46447
|
-
label: "720P60 高帧率",
|
|
46448
|
-
value: 74,
|
|
46449
|
-
description: "需登录(配置ck)"
|
|
46450
|
-
},
|
|
46451
|
-
{
|
|
46452
|
-
label: "1080P 高清",
|
|
46453
|
-
value: 80,
|
|
46454
|
-
description: "需登录(配置ck)"
|
|
46455
|
-
},
|
|
46456
|
-
{
|
|
46457
|
-
label: "1080P+ 高码率",
|
|
46458
|
-
value: 112,
|
|
46459
|
-
description: "需大会员&视频支持"
|
|
46460
|
-
},
|
|
46461
|
-
{
|
|
46462
|
-
label: "1080P60 高帧率",
|
|
46463
|
-
value: 116,
|
|
46464
|
-
description: "需大会员&视频支持"
|
|
46465
|
-
},
|
|
46466
|
-
{
|
|
46467
|
-
label: "4K 超清",
|
|
46468
|
-
value: 120,
|
|
46469
|
-
description: "需大会员&视频支持"
|
|
46470
|
-
},
|
|
46471
|
-
{
|
|
46472
|
-
label: "8K 超高清",
|
|
46473
|
-
value: 127,
|
|
46474
|
-
description: "需大会员&视频支持"
|
|
46475
|
-
}
|
|
46476
|
-
]
|
|
46477
|
-
},
|
|
46478
|
-
{
|
|
46479
|
-
key: "maxAutoVideoSize",
|
|
46480
|
-
type: "input",
|
|
46481
|
-
inputType: "number",
|
|
46482
|
-
label: "视频体积上限(MB)",
|
|
46483
|
-
description: "根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
46484
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "video")), $ne("videoQuality", 0)),
|
|
46485
|
-
rules: [{
|
|
46486
|
-
min: 1,
|
|
46487
|
-
max: 2e4
|
|
46488
|
-
}]
|
|
46489
|
-
},
|
|
46490
|
-
{
|
|
46491
|
-
key: "videoInfoMode",
|
|
46492
|
-
type: "radio",
|
|
46493
|
-
label: "视频信息返回形式",
|
|
46494
|
-
disabled: $not("switch"),
|
|
46495
|
-
options: [{
|
|
46496
|
-
label: "图片模式",
|
|
46497
|
-
value: "image"
|
|
46498
|
-
}, {
|
|
46499
|
-
label: "文本模式",
|
|
46500
|
-
value: "text"
|
|
46501
|
-
}]
|
|
46502
|
-
},
|
|
46503
|
-
{
|
|
46504
|
-
key: "displayContent",
|
|
46505
|
-
type: "checkbox",
|
|
46506
|
-
label: "视频信息前返回的内容",
|
|
46507
|
-
description: "若什么都不选,则不会返回任何视频相关信息",
|
|
46508
|
-
orientation: "horizontal",
|
|
46509
|
-
disabled: $or($not("switch"), $eq("videoInfoMode", "image")),
|
|
46510
|
-
options: [
|
|
46511
|
-
{
|
|
46512
|
-
label: "封面",
|
|
46513
|
-
value: "cover"
|
|
46514
|
-
},
|
|
46515
|
-
{
|
|
46516
|
-
label: "标题",
|
|
46517
|
-
value: "title"
|
|
46518
|
-
},
|
|
46519
|
-
{
|
|
46520
|
-
label: "作者",
|
|
46521
|
-
value: "author"
|
|
46522
|
-
},
|
|
46523
|
-
{
|
|
46524
|
-
label: "视频统计信息",
|
|
46525
|
-
value: "stats"
|
|
46526
|
-
},
|
|
46527
|
-
{
|
|
46528
|
-
label: "简介",
|
|
46529
|
-
value: "desc"
|
|
46530
|
-
}
|
|
46531
|
-
]
|
|
46532
|
-
},
|
|
46533
|
-
{
|
|
46534
|
-
type: "divider",
|
|
46535
|
-
title: "权限设置"
|
|
46536
|
-
},
|
|
46537
|
-
{
|
|
46538
|
-
key: "loginPerm",
|
|
46539
|
-
type: "radio",
|
|
46540
|
-
label: "谁可以触发扫码登录",
|
|
46541
|
-
description: "修改后需重启",
|
|
46542
|
-
orientation: "horizontal",
|
|
46543
|
-
options: [
|
|
46544
|
-
{
|
|
46545
|
-
label: "所有人",
|
|
46546
|
-
value: "all"
|
|
46547
|
-
},
|
|
46548
|
-
{
|
|
46549
|
-
label: "管理员",
|
|
46550
|
-
value: "admin"
|
|
46551
|
-
},
|
|
46552
|
-
{
|
|
46553
|
-
label: "主人",
|
|
46554
|
-
value: "master"
|
|
46555
|
-
},
|
|
46556
|
-
{
|
|
46557
|
-
label: "群主",
|
|
46558
|
-
value: "group.owner"
|
|
46559
|
-
},
|
|
46560
|
-
{
|
|
46561
|
-
label: "群管理员",
|
|
46562
|
-
value: "group.admin"
|
|
46563
|
-
}
|
|
46564
|
-
]
|
|
46565
|
-
},
|
|
46566
|
-
{
|
|
46567
|
-
type: "divider",
|
|
46568
|
-
title: "弹幕烧录相关"
|
|
46569
|
-
},
|
|
46570
|
-
{
|
|
46571
|
-
key: "burnDanmaku",
|
|
46572
|
-
type: "switch",
|
|
46573
|
-
label: "弹幕烧录",
|
|
46574
|
-
description: "将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长,高分辨率视频会占用较多资源",
|
|
46575
|
-
disabled: $not("switch")
|
|
46576
|
-
},
|
|
46577
|
-
{
|
|
46578
|
-
key: "danmakuArea",
|
|
46579
|
-
type: "radio",
|
|
46580
|
-
label: "弹幕区域",
|
|
46581
|
-
description: "限制弹幕的显示范围,避免遮挡视频主体内容",
|
|
46582
|
-
orientation: "horizontal",
|
|
46583
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
46584
|
-
options: [
|
|
46585
|
-
{
|
|
46586
|
-
label: "1/4 屏",
|
|
46587
|
-
value: "0.25",
|
|
46588
|
-
description: "仅顶部区域"
|
|
46589
|
-
},
|
|
46590
|
-
{
|
|
46591
|
-
label: "半屏",
|
|
46592
|
-
value: "0.5",
|
|
46593
|
-
description: "上半部分(推荐)"
|
|
46594
|
-
},
|
|
46595
|
-
{
|
|
46596
|
-
label: "3/4 屏",
|
|
46597
|
-
value: "0.75",
|
|
46598
|
-
description: "大部分区域"
|
|
46599
|
-
},
|
|
46600
|
-
{
|
|
46601
|
-
label: "全屏",
|
|
46602
|
-
value: "1",
|
|
46603
|
-
description: "铺满整个画面"
|
|
46604
|
-
}
|
|
46605
|
-
]
|
|
46606
|
-
},
|
|
46607
|
-
{
|
|
46608
|
-
key: "danmakuFontSize",
|
|
46609
|
-
type: "radio",
|
|
46610
|
-
label: "弹幕字号",
|
|
46611
|
-
description: "弹幕文字大小",
|
|
46612
|
-
orientation: "horizontal",
|
|
46613
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
46614
|
-
options: [
|
|
46615
|
-
{
|
|
46616
|
-
label: "小",
|
|
46617
|
-
value: "small"
|
|
46618
|
-
},
|
|
46619
|
-
{
|
|
46620
|
-
label: "中",
|
|
46621
|
-
value: "medium"
|
|
46622
|
-
},
|
|
46623
|
-
{
|
|
46624
|
-
label: "大",
|
|
46625
|
-
value: "large"
|
|
46626
|
-
}
|
|
46627
|
-
]
|
|
46628
|
-
},
|
|
46629
|
-
{
|
|
46630
|
-
key: "danmakuOpacity",
|
|
46631
|
-
type: "input",
|
|
46632
|
-
inputType: "number",
|
|
46633
|
-
label: "弹幕透明度",
|
|
46634
|
-
description: "0为完全透明,100为完全不透明,推荐70",
|
|
46635
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
46636
|
-
rules: [{
|
|
46637
|
-
min: 0,
|
|
46638
|
-
max: 100
|
|
46639
|
-
}]
|
|
46640
|
-
},
|
|
46641
|
-
{
|
|
46642
|
-
key: "verticalMode",
|
|
46643
|
-
type: "radio",
|
|
46644
|
-
label: "竖屏适配",
|
|
46645
|
-
description: "模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕",
|
|
46646
|
-
orientation: "horizontal",
|
|
46647
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
46648
|
-
options: [
|
|
46649
|
-
{
|
|
46650
|
-
label: "关闭",
|
|
46651
|
-
value: "off",
|
|
46652
|
-
description: "保持原始比例,不做转换"
|
|
46653
|
-
},
|
|
46654
|
-
{
|
|
46655
|
-
label: "智能",
|
|
46656
|
-
value: "standard",
|
|
46657
|
-
description: "仅对 16:9、21:9 等常见宽屏比例生效"
|
|
46658
|
-
},
|
|
46659
|
-
{
|
|
46660
|
-
label: "强制 9:16",
|
|
46661
|
-
value: "force",
|
|
46662
|
-
description: "所有视频统一转为 9:16 竖屏,弹幕大小一致"
|
|
46663
|
-
}
|
|
46664
|
-
]
|
|
46665
|
-
},
|
|
46666
|
-
{
|
|
46667
|
-
key: "videoCodec",
|
|
46668
|
-
type: "radio",
|
|
46669
|
-
label: "视频编码格式",
|
|
46670
|
-
description: "弹幕烧录时使用的视频编码格式,会自动检测硬件加速",
|
|
46671
|
-
orientation: "horizontal",
|
|
46672
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
46673
|
-
options: [
|
|
46674
|
-
{
|
|
46675
|
-
label: "H.264",
|
|
46676
|
-
value: "h264",
|
|
46677
|
-
description: "兼容性最好,支持几乎所有设备"
|
|
46678
|
-
},
|
|
46679
|
-
{
|
|
46680
|
-
label: "H.265",
|
|
46681
|
-
value: "h265",
|
|
46682
|
-
description: "压缩率更高,近几年设备支持良好(推荐)"
|
|
46683
|
-
},
|
|
46684
|
-
{
|
|
46685
|
-
label: "AV1",
|
|
46686
|
-
value: "av1",
|
|
46687
|
-
description: "最新编码格式,压缩率最高,但编码较慢"
|
|
46688
|
-
}
|
|
46689
|
-
]
|
|
46690
|
-
},
|
|
46691
|
-
{
|
|
46692
|
-
type: "divider",
|
|
46693
|
-
title: "B站推送相关"
|
|
46694
|
-
},
|
|
46695
|
-
{
|
|
46696
|
-
key: "push.switch",
|
|
46697
|
-
type: "switch",
|
|
46698
|
-
label: "推送开关",
|
|
46699
|
-
description: "推送开关,修改后需重启;使用「#设置B站推送 + UID」配置推送列表",
|
|
46700
|
-
color: "warning"
|
|
46701
|
-
},
|
|
46702
|
-
{
|
|
46703
|
-
key: "push.permission",
|
|
46704
|
-
type: "radio",
|
|
46705
|
-
label: "谁可以设置推送",
|
|
46706
|
-
description: "修改后需重启",
|
|
46707
|
-
orientation: "horizontal",
|
|
46708
|
-
color: "warning",
|
|
46709
|
-
disabled: $not("push.switch"),
|
|
46710
|
-
options: [
|
|
46711
|
-
{
|
|
46712
|
-
label: "所有人",
|
|
46713
|
-
value: "all"
|
|
46714
|
-
},
|
|
46715
|
-
{
|
|
46716
|
-
label: "管理员",
|
|
46717
|
-
value: "admin"
|
|
46718
|
-
},
|
|
46719
|
-
{
|
|
46720
|
-
label: "主人",
|
|
46721
|
-
value: "master"
|
|
46722
|
-
},
|
|
46723
|
-
{
|
|
46724
|
-
label: "群主",
|
|
46725
|
-
value: "group.owner"
|
|
46726
|
-
},
|
|
46727
|
-
{
|
|
46728
|
-
label: "群管理员",
|
|
46729
|
-
value: "group.admin"
|
|
46730
|
-
}
|
|
46731
|
-
]
|
|
46732
|
-
},
|
|
46733
|
-
{
|
|
46734
|
-
key: "push.cron",
|
|
46735
|
-
type: "input",
|
|
46736
|
-
inputType: "text",
|
|
46737
|
-
label: "定时任务表达式",
|
|
46738
|
-
description: "定时推送的时间,格式为cron表达式(默认为每十分钟执行一次)",
|
|
46739
|
-
color: "warning",
|
|
46740
|
-
disabled: $not("push.switch")
|
|
46741
|
-
},
|
|
46742
|
-
{
|
|
46743
|
-
key: "push.parsedynamic",
|
|
46744
|
-
type: "switch",
|
|
46745
|
-
label: "作品解析",
|
|
46746
|
-
description: "触发推送时是否一同解析该作品",
|
|
46747
|
-
color: "warning",
|
|
46748
|
-
disabled: $not("push.switch")
|
|
46749
|
-
},
|
|
46750
|
-
{
|
|
46751
|
-
key: "push.pushVideoQuality",
|
|
46752
|
-
type: "radio",
|
|
46753
|
-
label: "解析视频动态时的画质偏好",
|
|
46754
|
-
description: "「作品解析」开启时生效,仅对视频动态有效",
|
|
46755
|
-
orientation: "horizontal",
|
|
46756
|
-
disabled: $or($not("push.switch"), $not("push.parsedynamic")),
|
|
46757
|
-
color: "warning",
|
|
46758
|
-
options: [
|
|
46759
|
-
{
|
|
46760
|
-
label: "自动选择",
|
|
46761
|
-
value: 0
|
|
46762
|
-
},
|
|
46763
|
-
{
|
|
46764
|
-
label: "240P 极速",
|
|
46765
|
-
value: 6
|
|
46766
|
-
},
|
|
46767
|
-
{
|
|
46768
|
-
label: "360P 流畅",
|
|
46769
|
-
value: 16
|
|
46770
|
-
},
|
|
46771
|
-
{
|
|
46772
|
-
label: "480P 清晰",
|
|
46773
|
-
value: 32,
|
|
46774
|
-
description: "需登录(配置ck)"
|
|
46775
|
-
},
|
|
46776
|
-
{
|
|
46777
|
-
label: "720P 高清",
|
|
46778
|
-
value: 64,
|
|
46779
|
-
description: "需登录(配置ck)"
|
|
46780
|
-
},
|
|
46781
|
-
{
|
|
46782
|
-
label: "720P60 高帧率",
|
|
46783
|
-
value: 74,
|
|
46784
|
-
description: "需登录(配置ck)"
|
|
46785
|
-
},
|
|
46786
|
-
{
|
|
46787
|
-
label: "1080P 高清",
|
|
46788
|
-
value: 80,
|
|
46789
|
-
description: "需登录(配置ck)"
|
|
46790
|
-
},
|
|
46791
|
-
{
|
|
46792
|
-
label: "1080P+ 高码率",
|
|
46793
|
-
value: 112,
|
|
46794
|
-
description: "需大会员&视频支持"
|
|
46795
|
-
},
|
|
46796
|
-
{
|
|
46797
|
-
label: "1080P60 高帧率",
|
|
46798
|
-
value: 116,
|
|
46799
|
-
description: "需大会员&视频支持"
|
|
46800
|
-
},
|
|
46801
|
-
{
|
|
46802
|
-
label: "4K 超清",
|
|
46803
|
-
value: 120,
|
|
46804
|
-
description: "需大会员&视频支持"
|
|
46805
|
-
},
|
|
46806
|
-
{
|
|
46807
|
-
label: "8K 超高清",
|
|
46808
|
-
value: 127,
|
|
46809
|
-
description: "需大会员&视频支持"
|
|
46810
|
-
}
|
|
46811
|
-
]
|
|
46812
|
-
},
|
|
46813
|
-
{
|
|
46814
|
-
key: "push.pushMaxAutoVideoSize",
|
|
46815
|
-
type: "input",
|
|
46816
|
-
inputType: "number",
|
|
46817
|
-
label: "视频动态的视频体积上限(MB)",
|
|
46818
|
-
description: "根据该值自动选择分辨率进行下载。仅在「解析视频动态时的画质偏好」 为 \"自动选择\" 且「作品解析」开启时生效,仅对视频动态有效",
|
|
46819
|
-
disabled: $or($not("push.switch"), $not("push.parsedynamic"), $ne("push.pushVideoQuality", 0)),
|
|
46820
|
-
color: "warning",
|
|
46821
|
-
rules: [{
|
|
46822
|
-
min: 1,
|
|
46823
|
-
max: 2e4
|
|
46824
|
-
}]
|
|
46825
|
-
}
|
|
46826
|
-
]
|
|
46827
|
-
};
|
|
46828
|
-
//#endregion
|
|
46829
|
-
//#region src/module/config/cookies.schema.ts
|
|
46830
|
-
var cookiesConfigSchema = {
|
|
46831
|
-
key: "cookies",
|
|
46832
|
-
title: "Cookies 相关",
|
|
46833
|
-
subtitle: "建议配置,否则大部分功能无法使用",
|
|
46834
|
-
fields: [
|
|
46835
|
-
{
|
|
46836
|
-
key: "douyin",
|
|
46837
|
-
type: "input",
|
|
46838
|
-
inputType: "text",
|
|
46839
|
-
label: "抖音",
|
|
46840
|
-
description: "请输入你的抖音Cookies,不输入则无法使用抖音相关功能噢"
|
|
46841
|
-
},
|
|
46842
|
-
{
|
|
46843
|
-
key: "bilibili",
|
|
46844
|
-
type: "input",
|
|
46845
|
-
inputType: "text",
|
|
46846
|
-
label: "B站",
|
|
46847
|
-
description: "请输入你的B站Cookies,不输入则无法使用B站相关功能噢"
|
|
46848
|
-
},
|
|
46849
|
-
{
|
|
46850
|
-
key: "kuaishou",
|
|
46851
|
-
type: "input",
|
|
46852
|
-
inputType: "text",
|
|
46853
|
-
label: "快手",
|
|
46854
|
-
description: "请输入你的快手Cookies,不输入则无法使用快手相关功能噢"
|
|
46855
|
-
},
|
|
46856
|
-
{
|
|
46857
|
-
key: "xiaohongshu",
|
|
46858
|
-
type: "input",
|
|
46859
|
-
inputType: "text",
|
|
46860
|
-
label: "小红书",
|
|
46861
|
-
description: "请输入你的小红书Cookies,不输入则无法使用小红书相关功能噢"
|
|
46862
|
-
}
|
|
46863
|
-
]
|
|
46864
|
-
};
|
|
46865
|
-
//#endregion
|
|
46866
|
-
//#region src/module/config/douyin.schema.ts
|
|
46867
|
-
var douyinConfigSchema = {
|
|
46868
|
-
key: "douyin",
|
|
46869
|
-
title: "抖音相关",
|
|
46870
|
-
subtitle: "此处为抖音相关的用户偏好设置",
|
|
46871
|
-
fields: [
|
|
46872
|
-
{
|
|
46873
|
-
key: "switch",
|
|
46874
|
-
type: "switch",
|
|
46875
|
-
label: "解析开关",
|
|
46876
|
-
description: "抖音解析开关,此开关为单独开关"
|
|
46877
|
-
},
|
|
46878
|
-
{
|
|
46879
|
-
key: "tip",
|
|
46880
|
-
type: "switch",
|
|
46881
|
-
label: "解析提示",
|
|
46882
|
-
description: "抖音解析提示,发送提示信息:\"检测到抖音链接,开始解析\"",
|
|
46883
|
-
disabled: $not("switch")
|
|
46884
|
-
},
|
|
46885
|
-
{
|
|
46886
|
-
key: "sendContent",
|
|
46887
|
-
type: "checkbox",
|
|
46888
|
-
label: "解析时发送的内容",
|
|
46889
|
-
description: "若什么都不选,可能不会返回任何解析结果",
|
|
46890
|
-
orientation: "horizontal",
|
|
46891
|
-
disabled: $not("switch"),
|
|
46892
|
-
options: [
|
|
46893
|
-
{
|
|
46894
|
-
label: "视频信息",
|
|
46895
|
-
value: "info",
|
|
46896
|
-
description: "仅解析视频时有效"
|
|
46897
|
-
},
|
|
46898
|
-
{
|
|
46899
|
-
label: "评论列表",
|
|
46900
|
-
value: "comment"
|
|
46901
|
-
},
|
|
46902
|
-
{
|
|
46903
|
-
label: "视频文件",
|
|
46904
|
-
value: "video",
|
|
46905
|
-
description: "仅对视频作品有效"
|
|
46906
|
-
}
|
|
46907
|
-
]
|
|
46908
|
-
},
|
|
46909
|
-
{
|
|
46910
|
-
type: "divider",
|
|
46911
|
-
title: "评论详情设置"
|
|
46912
|
-
},
|
|
46913
|
-
{
|
|
46914
|
-
key: "numcomment",
|
|
46915
|
-
type: "input",
|
|
46916
|
-
inputType: "number",
|
|
46917
|
-
label: "评论解析数量",
|
|
46918
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment"))),
|
|
46919
|
-
rules: [{ min: 1 }]
|
|
46920
|
-
},
|
|
46921
|
-
{
|
|
46922
|
-
key: "subCommentLimit",
|
|
46923
|
-
type: "input",
|
|
46924
|
-
inputType: "number",
|
|
46925
|
-
label: "次级评论解析数量",
|
|
46926
|
-
description: "次级评论解析数量,当前逻辑不仅无法判断请求的来的评论的嵌套深度,而且「次级评论解析深度」会限制嵌套深度,超过深度的评论会被截断",
|
|
46927
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment"))),
|
|
46928
|
-
rules: [{
|
|
46929
|
-
min: 1,
|
|
46930
|
-
max: 20
|
|
46931
|
-
}]
|
|
46932
|
-
},
|
|
46933
|
-
{
|
|
46934
|
-
key: "commentImageCollection",
|
|
46935
|
-
type: "switch",
|
|
46936
|
-
label: "是否收集评论区的图片",
|
|
46937
|
-
description: "开启后将收集评论区的图片,以合并转发的形式返回",
|
|
46938
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment")))
|
|
46939
|
-
},
|
|
46940
|
-
{
|
|
46941
|
-
type: "divider",
|
|
46942
|
-
title: "渲染与画质设置"
|
|
46943
|
-
},
|
|
46944
|
-
{
|
|
46945
|
-
key: "liveImageMergeMode",
|
|
46946
|
-
type: "radio",
|
|
46947
|
-
label: "合辑 Live 图 BGM 合并方式",
|
|
46948
|
-
orientation: "horizontal",
|
|
46949
|
-
disabled: $not("switch"),
|
|
46950
|
-
options: [{
|
|
46951
|
-
label: "连续",
|
|
46952
|
-
value: "continuous",
|
|
46953
|
-
description: "BGM 接续播放,结束后自动循环"
|
|
46954
|
-
}, {
|
|
46955
|
-
label: "独立",
|
|
46956
|
-
value: "independent",
|
|
46957
|
-
description: "每张图 BGM 从头开始"
|
|
46958
|
-
}]
|
|
46959
|
-
},
|
|
46960
|
-
{
|
|
46961
|
-
key: "videoQuality",
|
|
46962
|
-
type: "radio",
|
|
46963
|
-
label: "画质偏好",
|
|
46964
|
-
description: "解析视频的分辨率偏好。",
|
|
46965
|
-
orientation: "horizontal",
|
|
46966
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "video"))),
|
|
46967
|
-
options: [
|
|
46968
|
-
{
|
|
46969
|
-
label: "自动选择",
|
|
46970
|
-
value: "adapt",
|
|
46971
|
-
description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
|
|
46972
|
-
},
|
|
46973
|
-
{
|
|
46974
|
-
label: "标清 540p",
|
|
46975
|
-
value: "540p"
|
|
46976
|
-
},
|
|
46977
|
-
{
|
|
46978
|
-
label: "高清 720p",
|
|
46979
|
-
value: "720p"
|
|
46980
|
-
},
|
|
46981
|
-
{
|
|
46982
|
-
label: "高清 1080p",
|
|
46983
|
-
value: "1080p"
|
|
46984
|
-
},
|
|
46985
|
-
{
|
|
46986
|
-
label: "超清 2k",
|
|
46987
|
-
value: "2k"
|
|
46988
|
-
},
|
|
46989
|
-
{
|
|
46990
|
-
label: "超清 4k",
|
|
46991
|
-
value: "4k"
|
|
46992
|
-
}
|
|
46993
|
-
]
|
|
46994
|
-
},
|
|
46995
|
-
{
|
|
46996
|
-
key: "maxAutoVideoSize",
|
|
46997
|
-
type: "input",
|
|
46998
|
-
inputType: "number",
|
|
46999
|
-
label: "视频体积上限(MB)",
|
|
47000
|
-
description: "根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
47001
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "video")), $ne("videoQuality", "adapt")),
|
|
47002
|
-
rules: [{
|
|
47003
|
-
min: 1,
|
|
47004
|
-
max: 2e4
|
|
47005
|
-
}]
|
|
47006
|
-
},
|
|
47007
|
-
{
|
|
47008
|
-
key: "videoInfoMode",
|
|
47009
|
-
type: "radio",
|
|
47010
|
-
label: "视频信息返回形式",
|
|
47011
|
-
disabled: $not("switch"),
|
|
47012
|
-
options: [{
|
|
47013
|
-
label: "图片模式",
|
|
47014
|
-
value: "image"
|
|
47015
|
-
}, {
|
|
47016
|
-
label: "文本模式",
|
|
47017
|
-
value: "text"
|
|
47018
|
-
}]
|
|
47019
|
-
},
|
|
47020
|
-
{
|
|
47021
|
-
key: "displayContent",
|
|
47022
|
-
type: "checkbox",
|
|
47023
|
-
label: "视频信息的内容",
|
|
47024
|
-
description: "若什么都不选,则不会返回任何视频相关信息",
|
|
47025
|
-
orientation: "horizontal",
|
|
47026
|
-
disabled: $or($not("switch"), $ne("videoInfoMode", "text")),
|
|
47027
|
-
options: [
|
|
47028
|
-
{
|
|
47029
|
-
label: "封面",
|
|
47030
|
-
value: "cover"
|
|
47031
|
-
},
|
|
47032
|
-
{
|
|
47033
|
-
label: "标题",
|
|
47034
|
-
value: "title"
|
|
47035
|
-
},
|
|
47036
|
-
{
|
|
47037
|
-
label: "作者",
|
|
47038
|
-
value: "author"
|
|
47039
|
-
},
|
|
47040
|
-
{
|
|
47041
|
-
label: "视频统计信息",
|
|
47042
|
-
value: "stats"
|
|
47043
|
-
}
|
|
47044
|
-
]
|
|
47045
|
-
},
|
|
47046
|
-
{
|
|
47047
|
-
type: "divider",
|
|
47048
|
-
title: "权限设置"
|
|
47049
|
-
},
|
|
47050
|
-
{
|
|
47051
|
-
key: "loginPerm",
|
|
47052
|
-
type: "radio",
|
|
47053
|
-
label: "谁可以触发扫码登录",
|
|
47054
|
-
description: "修改后需重启",
|
|
47055
|
-
orientation: "horizontal",
|
|
47056
|
-
options: [
|
|
47057
|
-
{
|
|
47058
|
-
label: "所有人",
|
|
47059
|
-
value: "all"
|
|
47060
|
-
},
|
|
47061
|
-
{
|
|
47062
|
-
label: "管理员",
|
|
47063
|
-
value: "admin"
|
|
47064
|
-
},
|
|
47065
|
-
{
|
|
47066
|
-
label: "主人",
|
|
47067
|
-
value: "master"
|
|
47068
|
-
},
|
|
47069
|
-
{
|
|
47070
|
-
label: "群主",
|
|
47071
|
-
value: "group.owner"
|
|
47072
|
-
},
|
|
47073
|
-
{
|
|
47074
|
-
label: "群管理员",
|
|
47075
|
-
value: "group.admin"
|
|
47076
|
-
}
|
|
47077
|
-
]
|
|
47078
|
-
},
|
|
47079
|
-
{
|
|
47080
|
-
type: "divider",
|
|
47081
|
-
title: "弹幕烧录相关"
|
|
47082
|
-
},
|
|
47083
|
-
{
|
|
47084
|
-
key: "burnDanmaku",
|
|
47085
|
-
type: "switch",
|
|
47086
|
-
label: "弹幕烧录",
|
|
47087
|
-
description: "将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长",
|
|
47088
|
-
disabled: $not("switch")
|
|
47089
|
-
},
|
|
47090
|
-
{
|
|
47091
|
-
key: "danmakuArea",
|
|
47092
|
-
type: "radio",
|
|
47093
|
-
label: "弹幕显示区域",
|
|
47094
|
-
description: "限制弹幕范围,避免遮挡视频主体",
|
|
47095
|
-
orientation: "horizontal",
|
|
47096
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
47097
|
-
options: [
|
|
47098
|
-
{
|
|
47099
|
-
label: "1/4 屏",
|
|
47100
|
-
value: "0.25"
|
|
47101
|
-
},
|
|
47102
|
-
{
|
|
47103
|
-
label: "半屏",
|
|
47104
|
-
value: "0.5"
|
|
47105
|
-
},
|
|
47106
|
-
{
|
|
47107
|
-
label: "3/4 屏",
|
|
47108
|
-
value: "0.75"
|
|
47109
|
-
},
|
|
47110
|
-
{
|
|
47111
|
-
label: "全屏",
|
|
47112
|
-
value: "1"
|
|
47113
|
-
}
|
|
47114
|
-
]
|
|
47115
|
-
},
|
|
47116
|
-
{
|
|
47117
|
-
key: "danmakuFontSize",
|
|
47118
|
-
type: "radio",
|
|
47119
|
-
label: "弹幕字号",
|
|
47120
|
-
description: "弹幕文字大小",
|
|
47121
|
-
orientation: "horizontal",
|
|
47122
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
47123
|
-
options: [
|
|
47124
|
-
{
|
|
47125
|
-
label: "小",
|
|
47126
|
-
value: "small"
|
|
47127
|
-
},
|
|
47128
|
-
{
|
|
47129
|
-
label: "中",
|
|
47130
|
-
value: "medium"
|
|
47131
|
-
},
|
|
47132
|
-
{
|
|
47133
|
-
label: "大",
|
|
47134
|
-
value: "large"
|
|
47135
|
-
}
|
|
47136
|
-
]
|
|
47137
|
-
},
|
|
47138
|
-
{
|
|
47139
|
-
key: "danmakuOpacity",
|
|
47140
|
-
type: "input",
|
|
47141
|
-
inputType: "number",
|
|
47142
|
-
label: "弹幕透明度",
|
|
47143
|
-
description: "0为完全透明,100为完全不透明,推荐70",
|
|
47144
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
47145
|
-
rules: [{
|
|
47146
|
-
min: 0,
|
|
47147
|
-
max: 100
|
|
47148
|
-
}]
|
|
47149
|
-
},
|
|
47150
|
-
{
|
|
47151
|
-
key: "verticalMode",
|
|
47152
|
-
type: "radio",
|
|
47153
|
-
label: "竖屏适配",
|
|
47154
|
-
description: "针对横屏视频,模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕",
|
|
47155
|
-
orientation: "horizontal",
|
|
47156
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
47157
|
-
options: [
|
|
47158
|
-
{
|
|
47159
|
-
label: "关闭",
|
|
47160
|
-
value: "off",
|
|
47161
|
-
description: "保持原始比例,不做转换"
|
|
47162
|
-
},
|
|
47163
|
-
{
|
|
47164
|
-
label: "智能",
|
|
47165
|
-
value: "standard",
|
|
47166
|
-
description: "仅对宽高比 ≥1.7 的横屏视频生效"
|
|
47167
|
-
},
|
|
47168
|
-
{
|
|
47169
|
-
label: "强制 9:16",
|
|
47170
|
-
value: "force",
|
|
47171
|
-
description: "所有视频统一转为竖屏"
|
|
47172
|
-
}
|
|
47173
|
-
]
|
|
47174
|
-
},
|
|
47175
|
-
{
|
|
47176
|
-
key: "videoCodec",
|
|
47177
|
-
type: "radio",
|
|
47178
|
-
label: "视频编码格式",
|
|
47179
|
-
description: "烧录弹幕后的视频编码格式",
|
|
47180
|
-
orientation: "horizontal",
|
|
47181
|
-
disabled: $or($not("switch"), $not("burnDanmaku")),
|
|
47182
|
-
options: [
|
|
47183
|
-
{
|
|
47184
|
-
label: "H.264",
|
|
47185
|
-
value: "h264"
|
|
47186
|
-
},
|
|
47187
|
-
{
|
|
47188
|
-
label: "H.265",
|
|
47189
|
-
value: "h265"
|
|
47190
|
-
},
|
|
47191
|
-
{
|
|
47192
|
-
label: "AV1",
|
|
47193
|
-
value: "av1"
|
|
47194
|
-
}
|
|
47195
|
-
]
|
|
47196
|
-
},
|
|
47197
|
-
{
|
|
47198
|
-
type: "divider",
|
|
47199
|
-
title: "抖音推送相关"
|
|
47200
|
-
},
|
|
47201
|
-
{
|
|
47202
|
-
key: "push.switch",
|
|
47203
|
-
type: "switch",
|
|
47204
|
-
label: "推送开关",
|
|
47205
|
-
description: "推送开关,修改后需重启;使用「#设置抖音推送 + 抖音号」配置推送列表",
|
|
47206
|
-
color: "warning"
|
|
47207
|
-
},
|
|
47208
|
-
{
|
|
47209
|
-
key: "push.permission",
|
|
47210
|
-
type: "radio",
|
|
47211
|
-
label: "谁可以设置推送",
|
|
47212
|
-
description: "修改后需重启",
|
|
47213
|
-
orientation: "horizontal",
|
|
47214
|
-
disabled: $not("push.switch"),
|
|
47215
|
-
color: "warning",
|
|
47216
|
-
options: [
|
|
47217
|
-
{
|
|
47218
|
-
label: "所有人",
|
|
47219
|
-
value: "all"
|
|
47220
|
-
},
|
|
47221
|
-
{
|
|
47222
|
-
label: "管理员",
|
|
47223
|
-
value: "admin"
|
|
47224
|
-
},
|
|
47225
|
-
{
|
|
47226
|
-
label: "主人",
|
|
47227
|
-
value: "master"
|
|
47228
|
-
},
|
|
47229
|
-
{
|
|
47230
|
-
label: "群主",
|
|
47231
|
-
value: "group.owner"
|
|
47232
|
-
},
|
|
47233
|
-
{
|
|
47234
|
-
label: "群管理员",
|
|
47235
|
-
value: "group.admin"
|
|
47236
|
-
}
|
|
47237
|
-
]
|
|
47238
|
-
},
|
|
47239
|
-
{
|
|
47240
|
-
key: "push.cron",
|
|
47241
|
-
type: "input",
|
|
47242
|
-
inputType: "text",
|
|
47243
|
-
label: "定时任务表达式",
|
|
47244
|
-
description: "定时推送的时间,格式为cron表达式(默认为每十分钟执行一次)",
|
|
47245
|
-
color: "warning",
|
|
47246
|
-
disabled: $not("push.switch")
|
|
47247
|
-
},
|
|
47248
|
-
{
|
|
47249
|
-
key: "push.parsedynamic",
|
|
47250
|
-
type: "switch",
|
|
47251
|
-
label: "作品解析",
|
|
47252
|
-
description: "触发推送时是否一同解析该作品",
|
|
47253
|
-
color: "warning",
|
|
47254
|
-
disabled: $not("push.switch")
|
|
47255
|
-
},
|
|
47256
|
-
{
|
|
47257
|
-
key: "push.shareType",
|
|
47258
|
-
type: "radio",
|
|
47259
|
-
label: "推送图二维码的类型",
|
|
47260
|
-
orientation: "horizontal",
|
|
47261
|
-
color: "warning",
|
|
47262
|
-
disabled: $not("push.switch"),
|
|
47263
|
-
options: [{
|
|
47264
|
-
label: "网页链接",
|
|
47265
|
-
value: "web",
|
|
47266
|
-
description: "识别后访问抖音官网对应的作品地址"
|
|
47267
|
-
}, {
|
|
47268
|
-
label: "下载链接",
|
|
47269
|
-
value: "download",
|
|
47270
|
-
description: "识别后访问无水印作品下载地址"
|
|
47271
|
-
}]
|
|
47272
|
-
},
|
|
47273
|
-
{
|
|
47274
|
-
key: "push.pushVideoQuality",
|
|
47275
|
-
type: "radio",
|
|
47276
|
-
label: "画质偏好",
|
|
47277
|
-
description: "推送解析时解析视频的分辨率偏好。",
|
|
47278
|
-
orientation: "horizontal",
|
|
47279
|
-
disabled: $not("push.switch"),
|
|
47280
|
-
color: "warning",
|
|
47281
|
-
options: [
|
|
47282
|
-
{
|
|
47283
|
-
label: "自动选择",
|
|
47284
|
-
value: "adapt",
|
|
47285
|
-
description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
|
|
47286
|
-
},
|
|
47287
|
-
{
|
|
47288
|
-
label: "标清 540p",
|
|
47289
|
-
value: "540p"
|
|
47290
|
-
},
|
|
47291
|
-
{
|
|
47292
|
-
label: "高清 720p",
|
|
47293
|
-
value: "720p"
|
|
47294
|
-
},
|
|
47295
|
-
{
|
|
47296
|
-
label: "高清 1080p",
|
|
47297
|
-
value: "1080p"
|
|
47298
|
-
},
|
|
47299
|
-
{
|
|
47300
|
-
label: "超清 2k",
|
|
47301
|
-
value: "2k"
|
|
47302
|
-
},
|
|
47303
|
-
{
|
|
47304
|
-
label: "超清 4k",
|
|
47305
|
-
value: "4k"
|
|
47306
|
-
}
|
|
47307
|
-
]
|
|
47308
|
-
},
|
|
47309
|
-
{
|
|
47310
|
-
key: "push.pushMaxAutoVideoSize",
|
|
47311
|
-
type: "input",
|
|
47312
|
-
inputType: "number",
|
|
47313
|
-
label: "视频体积上限(MB)",
|
|
47314
|
-
description: "推送解析时根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
47315
|
-
disabled: $or($not("push.switch"), $ne("push.pushVideoQuality", "adapt")),
|
|
47316
|
-
color: "warning",
|
|
47317
|
-
rules: [{
|
|
47318
|
-
min: 1,
|
|
47319
|
-
max: 2e4
|
|
47320
|
-
}]
|
|
47321
|
-
}
|
|
47322
|
-
]
|
|
47323
|
-
};
|
|
47324
|
-
//#endregion
|
|
47325
|
-
//#region src/module/config/kuaishou.schema.ts
|
|
47326
|
-
var kuaishouConfigSchema = {
|
|
47327
|
-
key: "kuaishou",
|
|
47328
|
-
title: "快手相关",
|
|
47329
|
-
subtitle: "此处为快手相关的用户偏好设置",
|
|
47330
|
-
fields: [
|
|
47331
|
-
{
|
|
47332
|
-
key: "switch",
|
|
47333
|
-
type: "switch",
|
|
47334
|
-
label: "解析开关",
|
|
47335
|
-
description: "快手解析开关,此开关为单独开关"
|
|
47336
|
-
},
|
|
47337
|
-
{
|
|
47338
|
-
key: "tip",
|
|
47339
|
-
type: "switch",
|
|
47340
|
-
label: "解析提示",
|
|
47341
|
-
description: "快手解析提示,发送提示信息:\"检测到快手链接,开始解析\"",
|
|
47342
|
-
disabled: $not("switch")
|
|
47343
|
-
},
|
|
47344
|
-
{
|
|
47345
|
-
type: "divider",
|
|
47346
|
-
title: "评论详情设置"
|
|
47347
|
-
},
|
|
47348
|
-
{
|
|
47349
|
-
key: "comment",
|
|
47350
|
-
type: "switch",
|
|
47351
|
-
label: "评论解析",
|
|
47352
|
-
description: "快手评论解析,开启后可发送快手作品评论图",
|
|
47353
|
-
disabled: $not("switch")
|
|
47354
|
-
},
|
|
47355
|
-
{
|
|
47356
|
-
key: "numcomment",
|
|
47357
|
-
type: "input",
|
|
47358
|
-
inputType: "number",
|
|
47359
|
-
label: "评论解析数量",
|
|
47360
|
-
disabled: $or($not("switch"), $not("comment")),
|
|
47361
|
-
rules: [{ min: 1 }]
|
|
47362
|
-
}
|
|
47363
|
-
]
|
|
47364
|
-
};
|
|
47365
|
-
//#endregion
|
|
47366
|
-
//#region src/module/config/request.schema.ts
|
|
47367
|
-
var requestConfigSchema = {
|
|
47368
|
-
key: "request",
|
|
47369
|
-
title: "解析库请求配置相关",
|
|
47370
|
-
subtitle: "此处用于管理解析库的网络请求配置",
|
|
47371
|
-
fields: [
|
|
47372
|
-
{
|
|
47373
|
-
key: "timeout",
|
|
47374
|
-
type: "input",
|
|
47375
|
-
inputType: "number",
|
|
47376
|
-
label: "请求超时时间",
|
|
47377
|
-
description: "网络请求的超时时间,单位:毫秒",
|
|
47378
|
-
rules: [{
|
|
47379
|
-
min: 1e3,
|
|
47380
|
-
max: 3e5,
|
|
47381
|
-
error: "请输入一个范围在 1000 到 300000 之间的数字"
|
|
47382
|
-
}]
|
|
47383
|
-
},
|
|
47384
|
-
{
|
|
47385
|
-
key: "User-Agent",
|
|
47386
|
-
type: "input",
|
|
47387
|
-
inputType: "text",
|
|
47388
|
-
label: "User-Agent",
|
|
47389
|
-
description: "请求头中的User-Agent字段,用于标识客户端类型",
|
|
47390
|
-
placeholder: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
|
47391
|
-
},
|
|
47392
|
-
{
|
|
47393
|
-
type: "divider",
|
|
47394
|
-
title: "代理配置(可选)"
|
|
47395
|
-
},
|
|
47396
|
-
{
|
|
47397
|
-
key: "proxy.switch",
|
|
47398
|
-
type: "switch",
|
|
47399
|
-
label: "代理开关",
|
|
47400
|
-
description: "开启后需要配置「代理主机」「代理端口」"
|
|
47401
|
-
},
|
|
47402
|
-
{
|
|
47403
|
-
key: "proxy.host",
|
|
47404
|
-
type: "input",
|
|
47405
|
-
inputType: "text",
|
|
47406
|
-
label: "代理主机",
|
|
47407
|
-
description: "代理服务器的主机地址,如:127.0.0.1",
|
|
47408
|
-
placeholder: "127.0.0.1",
|
|
47409
|
-
disabled: $not("proxy.switch")
|
|
47410
|
-
},
|
|
47411
|
-
{
|
|
47412
|
-
key: "proxy.port",
|
|
47413
|
-
type: "input",
|
|
47414
|
-
inputType: "number",
|
|
47415
|
-
label: "代理端口",
|
|
47416
|
-
description: "代理服务器的端口号",
|
|
47417
|
-
disabled: $not("proxy.switch"),
|
|
47418
|
-
rules: [{
|
|
47419
|
-
min: 1,
|
|
47420
|
-
max: 65535,
|
|
47421
|
-
error: "请输入一个范围在 1 到 65535 之间的数字"
|
|
47422
|
-
}]
|
|
47423
|
-
},
|
|
47424
|
-
{
|
|
47425
|
-
key: "proxy.protocol",
|
|
47426
|
-
type: "radio",
|
|
47427
|
-
label: "代理协议",
|
|
47428
|
-
orientation: "horizontal",
|
|
47429
|
-
disabled: $not("proxy.switch"),
|
|
47430
|
-
options: [{
|
|
47431
|
-
label: "HTTP",
|
|
47432
|
-
value: "http"
|
|
47433
|
-
}, {
|
|
47434
|
-
label: "HTTPS",
|
|
47435
|
-
value: "https"
|
|
47436
|
-
}]
|
|
47437
|
-
},
|
|
47438
|
-
{
|
|
47439
|
-
key: "proxy.auth.username",
|
|
47440
|
-
type: "input",
|
|
47441
|
-
inputType: "text",
|
|
47442
|
-
label: "代理用户名",
|
|
47443
|
-
description: "代理服务器的认证用户名(如果需要)",
|
|
47444
|
-
disabled: $not("proxy.switch")
|
|
47445
|
-
},
|
|
47446
|
-
{
|
|
47447
|
-
key: "proxy.auth.password",
|
|
47448
|
-
type: "input",
|
|
47449
|
-
inputType: "password",
|
|
47450
|
-
label: "代理密码",
|
|
47451
|
-
description: "代理服务器的认证密码(如果需要)",
|
|
47452
|
-
disabled: $not("proxy.switch")
|
|
47453
|
-
}
|
|
47454
|
-
]
|
|
47455
|
-
};
|
|
47456
|
-
//#endregion
|
|
47457
|
-
//#region src/module/config/upload.schema.ts
|
|
47458
|
-
var uploadConfigSchema = {
|
|
47459
|
-
key: "upload",
|
|
47460
|
-
title: "上传和下载相关",
|
|
47461
|
-
subtitle: "此处为视频上传和下载相关的用户偏好设置",
|
|
47462
|
-
fields: [
|
|
47463
|
-
{
|
|
47464
|
-
type: "divider",
|
|
47465
|
-
title: "发送方式配置"
|
|
47466
|
-
},
|
|
47467
|
-
{
|
|
47468
|
-
key: "videoSendMode",
|
|
47469
|
-
type: "radio",
|
|
47470
|
-
label: "本地视频发送方式",
|
|
47471
|
-
description: "选择发送本地视频的方式:\n• File - 使用 file 协议发送(需 Karin 与协议端同系统)\n• Base64 - 转 base64 发送(传输数据量增大 1/3,不在同一网络环境可能导致额外带宽成本,适合 karin 和协议端不在同一网络环境)",
|
|
47472
|
-
disabled: $var("usegroupfile"),
|
|
47473
|
-
options: [{
|
|
47474
|
-
label: "File 协议(本地文件)",
|
|
47475
|
-
value: "file"
|
|
47476
|
-
}, {
|
|
47477
|
-
label: "Base64(编码传输)",
|
|
47478
|
-
value: "base64"
|
|
47479
|
-
}]
|
|
47480
|
-
},
|
|
47481
|
-
{
|
|
47482
|
-
key: "usegroupfile",
|
|
47483
|
-
type: "switch",
|
|
47484
|
-
label: "群文件上传",
|
|
47485
|
-
description: "使用群文件上传,开启后会将视频文件上传到群文件中,需配置「群文件上传阈值」。与「本地视频发送方式 = Base64」互斥。",
|
|
47486
|
-
disabled: $eq("videoSendMode", "base64")
|
|
47487
|
-
},
|
|
47488
|
-
{
|
|
47489
|
-
key: "groupfilevalue",
|
|
47490
|
-
type: "input",
|
|
47491
|
-
inputType: "number",
|
|
47492
|
-
label: "群文件上传阈值",
|
|
47493
|
-
description: "当文件大小超过该值时将使用群文件上传,单位:MB,「使用群文件上传」开启后才会生效",
|
|
47494
|
-
disabled: $or($not("usegroupfile"), $eq("videoSendMode", "base64")),
|
|
47495
|
-
rules: [{ min: 1 }]
|
|
47496
|
-
},
|
|
47497
|
-
{
|
|
47498
|
-
key: "imageSendMode",
|
|
47499
|
-
type: "radio",
|
|
47500
|
-
label: "网络图片发送方式",
|
|
47501
|
-
description: "选择发送网络图片的方式:\n• URL - 直接传递链接给上游(可能因上游网络问题超时)\n• File - 下载后用 file 协议发送(需 Karin 与协议端同系统)\n• Base64 - 转 base64 发送(传输数据量增大 1/3,不在同一网络环境可能导致额外带宽成本)",
|
|
47502
|
-
options: [
|
|
47503
|
-
{
|
|
47504
|
-
label: "URL 链接(直接传递)",
|
|
47505
|
-
value: "url"
|
|
47506
|
-
},
|
|
47507
|
-
{
|
|
47508
|
-
label: "File 协议(本地文件)",
|
|
47509
|
-
value: "file"
|
|
47510
|
-
},
|
|
47511
|
-
{
|
|
47512
|
-
label: "Base64(编码传输)",
|
|
47513
|
-
value: "base64"
|
|
47514
|
-
}
|
|
47515
|
-
]
|
|
47516
|
-
},
|
|
47517
|
-
{
|
|
47518
|
-
type: "divider",
|
|
47519
|
-
title: "上传拦截配置"
|
|
47520
|
-
},
|
|
47521
|
-
{
|
|
47522
|
-
key: "usefilelimit",
|
|
47523
|
-
type: "switch",
|
|
47524
|
-
label: "视频上传拦截",
|
|
47525
|
-
description: "开启后会根据视频文件大小判断是否需要上传,需配置「视频拦截阈值」。"
|
|
47526
|
-
},
|
|
47527
|
-
{
|
|
47528
|
-
key: "filelimit",
|
|
47529
|
-
type: "input",
|
|
47530
|
-
inputType: "number",
|
|
47531
|
-
label: "视频拦截阈值",
|
|
47532
|
-
description: "视频文件大于该数值则直接结束任务,不会上传,单位: MB,「视频上传拦截」开启后才会生效。",
|
|
47533
|
-
disabled: $not("usefilelimit"),
|
|
47534
|
-
rules: [{ min: 1 }]
|
|
47535
|
-
},
|
|
47536
|
-
{
|
|
47537
|
-
type: "divider",
|
|
47538
|
-
title: "视频压缩配置"
|
|
47539
|
-
},
|
|
47540
|
-
{
|
|
47541
|
-
key: "compress",
|
|
47542
|
-
type: "switch",
|
|
47543
|
-
label: "压缩视频",
|
|
47544
|
-
description: "开启后会将视频文件压缩后再上传,适合上传大文件,任务过程中会吃满CPU,对低配服务器不友好。需配置「压缩触发阈值」与「压缩后的值」"
|
|
47545
|
-
},
|
|
47546
|
-
{
|
|
47547
|
-
key: "compresstrigger",
|
|
47548
|
-
type: "input",
|
|
47549
|
-
inputType: "number",
|
|
47550
|
-
label: "压缩触发阈值",
|
|
47551
|
-
description: "触发视频压缩的阈值,单位:MB。当文件大小超过该值时,才会压缩视频,「压缩视频」开启后才会生效",
|
|
47552
|
-
disabled: $not("compress"),
|
|
47553
|
-
rules: [{ min: 1 }]
|
|
47554
|
-
},
|
|
47555
|
-
{
|
|
47556
|
-
key: "compressvalue",
|
|
47557
|
-
type: "input",
|
|
47558
|
-
inputType: "number",
|
|
47559
|
-
label: "压缩后的值",
|
|
47560
|
-
description: "单位:MB,若视频文件大小大于「压缩触发阈值」的值,则会进行压缩至该值(±5%),「压缩视频」开启后才会生效",
|
|
47561
|
-
disabled: $not("compress"),
|
|
47562
|
-
rules: [{ min: 1 }]
|
|
47563
|
-
},
|
|
47564
|
-
{
|
|
47565
|
-
type: "divider",
|
|
47566
|
-
title: "下载限速配置"
|
|
47567
|
-
},
|
|
47568
|
-
{
|
|
47569
|
-
key: "downloadThrottle",
|
|
47570
|
-
type: "switch",
|
|
47571
|
-
label: "下载限速",
|
|
47572
|
-
description: "开启后会限制下载速度,避免触发服务器风控导致连接被重置(ECONNRESET)。如果下载时经常报错\"连接被重置\",建议开启"
|
|
47573
|
-
},
|
|
47574
|
-
{
|
|
47575
|
-
key: "downloadMaxSpeed",
|
|
47576
|
-
type: "input",
|
|
47577
|
-
inputType: "number",
|
|
47578
|
-
label: "最大下载速度",
|
|
47579
|
-
description: "单位:MB/s,建议设置为 5-20 之间。设置过高可能触发风控,设置过低会影响下载体验",
|
|
47580
|
-
disabled: $not("downloadThrottle"),
|
|
47581
|
-
rules: [{
|
|
47582
|
-
min: 1,
|
|
47583
|
-
max: 1e3,
|
|
47584
|
-
error: "请输入一个范围在 1 到 1000 之间的数字"
|
|
47585
|
-
}]
|
|
47586
|
-
},
|
|
47587
|
-
{
|
|
47588
|
-
key: "downloadAutoReduce",
|
|
47589
|
-
type: "switch",
|
|
47590
|
-
label: "断流自动降速",
|
|
47591
|
-
description: "当检测到连接被重置时自动降低下载速度,每次断流后速度会降低到当前的 60%",
|
|
47592
|
-
disabled: $not("downloadThrottle")
|
|
47593
|
-
},
|
|
47594
|
-
{
|
|
47595
|
-
key: "downloadMinSpeed",
|
|
47596
|
-
type: "input",
|
|
47597
|
-
inputType: "number",
|
|
47598
|
-
label: "最低下载速度",
|
|
47599
|
-
description: "单位:MB/s,自动降速时不会低于此值",
|
|
47600
|
-
disabled: $or($not("downloadThrottle"), $not("downloadAutoReduce")),
|
|
47601
|
-
rules: [{
|
|
47602
|
-
min: .1,
|
|
47603
|
-
max: 100,
|
|
47604
|
-
error: "请输入一个范围在 0.1 到 100 之间的数字"
|
|
47605
|
-
}]
|
|
47606
|
-
}
|
|
47607
|
-
]
|
|
47608
|
-
};
|
|
47609
|
-
//#endregion
|
|
47610
|
-
//#region src/module/config/xiaohongshu.schema.ts
|
|
47611
|
-
var xiaohongshuConfigSchema = {
|
|
47612
|
-
key: "xiaohongshu",
|
|
47613
|
-
title: "小红书相关",
|
|
47614
|
-
subtitle: "此处为小红书相关的用户偏好设置",
|
|
47615
|
-
fields: [
|
|
47616
|
-
{
|
|
47617
|
-
key: "switch",
|
|
47618
|
-
type: "switch",
|
|
47619
|
-
label: "解析开关",
|
|
47620
|
-
description: "小红书解析开关,此开关为单独开关"
|
|
47621
|
-
},
|
|
47622
|
-
{
|
|
47623
|
-
key: "tip",
|
|
47624
|
-
type: "switch",
|
|
47625
|
-
label: "解析提示",
|
|
47626
|
-
description: "小红书解析提示,发送提示信息:\"检测到小红书链接,开始解析\"",
|
|
47627
|
-
disabled: $not("switch")
|
|
47628
|
-
},
|
|
47629
|
-
{
|
|
47630
|
-
key: "sendContent",
|
|
47631
|
-
type: "checkbox",
|
|
47632
|
-
label: "解析时发送的内容",
|
|
47633
|
-
description: "若什么都不选,可能不会返回任何解析结果",
|
|
47634
|
-
orientation: "horizontal",
|
|
47635
|
-
disabled: $not("switch"),
|
|
47636
|
-
options: [
|
|
47637
|
-
{
|
|
47638
|
-
label: "笔记信息",
|
|
47639
|
-
value: "info"
|
|
47640
|
-
},
|
|
47641
|
-
{
|
|
47642
|
-
label: "评论列表",
|
|
47643
|
-
value: "comment"
|
|
47644
|
-
},
|
|
47645
|
-
{
|
|
47646
|
-
label: "笔记图片",
|
|
47647
|
-
value: "image"
|
|
47648
|
-
},
|
|
47649
|
-
{
|
|
47650
|
-
label: "视频文件",
|
|
47651
|
-
value: "video",
|
|
47652
|
-
description: "仅对视频笔记有效"
|
|
47653
|
-
}
|
|
47654
|
-
]
|
|
47655
|
-
},
|
|
47656
|
-
{
|
|
47657
|
-
key: "numcomment",
|
|
47658
|
-
type: "input",
|
|
47659
|
-
inputType: "number",
|
|
47660
|
-
label: "评论解析数量",
|
|
47661
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "comment"))),
|
|
47662
|
-
rules: [{ min: 1 }]
|
|
47663
|
-
},
|
|
47664
|
-
{
|
|
47665
|
-
type: "divider",
|
|
47666
|
-
title: "渲染与画质设置"
|
|
47667
|
-
},
|
|
47668
|
-
{
|
|
47669
|
-
key: "videoQuality",
|
|
47670
|
-
type: "radio",
|
|
47671
|
-
label: "画质偏好",
|
|
47672
|
-
description: "解析视频的分辨率偏好。",
|
|
47673
|
-
orientation: "horizontal",
|
|
47674
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "video"))),
|
|
47675
|
-
options: [
|
|
47676
|
-
{
|
|
47677
|
-
label: "自动选择",
|
|
47678
|
-
value: "adapt",
|
|
47679
|
-
description: "根据「视频体积上限(MB)」自动选择分辨率进行下载"
|
|
47680
|
-
},
|
|
47681
|
-
{
|
|
47682
|
-
label: "标清 540p",
|
|
47683
|
-
value: "540p"
|
|
47684
|
-
},
|
|
47685
|
-
{
|
|
47686
|
-
label: "高清 720p",
|
|
47687
|
-
value: "720p"
|
|
47688
|
-
},
|
|
47689
|
-
{
|
|
47690
|
-
label: "高清 1080p",
|
|
47691
|
-
value: "1080p"
|
|
47692
|
-
},
|
|
47693
|
-
{
|
|
47694
|
-
label: "超清 2k",
|
|
47695
|
-
value: "2k"
|
|
47696
|
-
},
|
|
47697
|
-
{
|
|
47698
|
-
label: "超清 4k",
|
|
47699
|
-
value: "4k"
|
|
47700
|
-
}
|
|
47701
|
-
]
|
|
47702
|
-
},
|
|
47703
|
-
{
|
|
47704
|
-
key: "maxAutoVideoSize",
|
|
47705
|
-
type: "input",
|
|
47706
|
-
inputType: "number",
|
|
47707
|
-
label: "视频体积上限(MB)",
|
|
47708
|
-
description: "根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 \"自动选择\" 时生效",
|
|
47709
|
-
disabled: $or($not("switch"), $not($includes("sendContent", "video")), $ne("videoQuality", "adapt")),
|
|
47710
|
-
rules: [{
|
|
47711
|
-
min: 1,
|
|
47712
|
-
max: 2e4
|
|
47713
|
-
}]
|
|
47714
|
-
}
|
|
47715
|
-
]
|
|
47716
|
-
};
|
|
47717
|
-
//#endregion
|
|
47718
|
-
//#region src/module/config/index.ts
|
|
47719
|
-
/** 所有配置区块 Schema */
|
|
47720
|
-
var allSectionSchemas = {
|
|
47721
|
-
cookies: cookiesConfigSchema,
|
|
47722
|
-
app: appConfigSchema,
|
|
47723
|
-
douyin: douyinConfigSchema,
|
|
47724
|
-
bilibili: bilibiliConfigSchema,
|
|
47725
|
-
kuaishou: kuaishouConfigSchema,
|
|
47726
|
-
xiaohongshu: xiaohongshuConfigSchema,
|
|
47727
|
-
upload: uploadConfigSchema,
|
|
47728
|
-
request: requestConfigSchema
|
|
47729
|
-
};
|
|
47730
|
-
/** 获取完整配置 Schema(用于 API 返回) */
|
|
47731
|
-
function getConfigSchema() {
|
|
47732
|
-
return { modules: [
|
|
47733
|
-
{
|
|
47734
|
-
key: "cookies",
|
|
47735
|
-
label: "Cookies 相关",
|
|
47736
|
-
sections: [cookiesConfigSchema]
|
|
47737
|
-
},
|
|
47738
|
-
{
|
|
47739
|
-
key: "app",
|
|
47740
|
-
label: "插件应用相关",
|
|
47741
|
-
sections: [appConfigSchema]
|
|
47742
|
-
},
|
|
47743
|
-
{
|
|
47744
|
-
key: "douyin",
|
|
47745
|
-
label: "抖音相关",
|
|
47746
|
-
sections: [douyinConfigSchema]
|
|
47747
|
-
},
|
|
47748
|
-
{
|
|
47749
|
-
key: "bilibili",
|
|
47750
|
-
label: "B站相关",
|
|
47751
|
-
sections: [bilibiliConfigSchema]
|
|
47752
|
-
},
|
|
47753
|
-
{
|
|
47754
|
-
key: "kuaishou",
|
|
47755
|
-
label: "快手相关",
|
|
47756
|
-
sections: [kuaishouConfigSchema]
|
|
47757
|
-
},
|
|
47758
|
-
{
|
|
47759
|
-
key: "xiaohongshu",
|
|
47760
|
-
label: "小红书相关",
|
|
47761
|
-
sections: [xiaohongshuConfigSchema]
|
|
47762
|
-
},
|
|
47763
|
-
{
|
|
47764
|
-
key: "upload",
|
|
47765
|
-
label: "视频文件上传相关",
|
|
47766
|
-
sections: [uploadConfigSchema]
|
|
47767
|
-
},
|
|
47768
|
-
{
|
|
47769
|
-
key: "request",
|
|
47770
|
-
label: "解析库请求配置相关",
|
|
47771
|
-
sections: [requestConfigSchema]
|
|
47772
|
-
}
|
|
47773
|
-
] };
|
|
47774
|
-
}
|
|
47775
|
-
/** 获取指定模块的 Schema */
|
|
47776
|
-
function getModuleSchema(moduleKey) {
|
|
47777
|
-
return allSectionSchemas[moduleKey];
|
|
47778
|
-
}
|
|
47779
|
-
//#endregion
|
|
47780
|
-
//#region src/module/server/api/schema.ts
|
|
47781
|
-
/**
|
|
47782
|
-
* 获取完整配置 Schema
|
|
47783
|
-
* GET /api/kkk/v1/schema
|
|
47784
|
-
*/
|
|
47785
|
-
var getFullSchema = async (_req, res) => {
|
|
47786
|
-
try {
|
|
47787
|
-
const schema = getConfigSchema();
|
|
47788
|
-
res.json({
|
|
47789
|
-
success: true,
|
|
47790
|
-
message: "获取配置 Schema 成功",
|
|
47791
|
-
data: schema
|
|
47792
|
-
});
|
|
47793
|
-
} catch (error) {
|
|
47794
|
-
res.status(500).json({
|
|
47795
|
-
success: false,
|
|
47796
|
-
message: `获取配置 Schema 失败: ${error.message}`,
|
|
47797
|
-
data: null
|
|
47798
|
-
});
|
|
47799
|
-
}
|
|
47800
|
-
};
|
|
47801
|
-
/**
|
|
47802
|
-
* 获取指定模块的 Schema
|
|
47803
|
-
* GET /api/kkk/v1/schema/:module
|
|
47804
|
-
*/
|
|
47805
|
-
var getModuleSchemaApi = async (req, res) => {
|
|
47806
|
-
try {
|
|
47807
|
-
const { module } = req.params;
|
|
47808
|
-
const schema = getModuleSchema(Array.isArray(module) ? module[0] : module);
|
|
47809
|
-
if (!schema) return res.status(404).json({
|
|
47810
|
-
success: false,
|
|
47811
|
-
message: `配置模块 "${module}" 的 Schema 不存在`,
|
|
47812
|
-
data: null
|
|
47813
|
-
});
|
|
47814
|
-
res.json({
|
|
47815
|
-
success: true,
|
|
47816
|
-
message: "获取配置 Schema 成功",
|
|
47817
|
-
data: schema
|
|
47818
|
-
});
|
|
47819
|
-
} catch (error) {
|
|
47820
|
-
res.status(500).json({
|
|
47821
|
-
success: false,
|
|
47822
|
-
message: `获取配置 Schema 失败: ${error.message}`,
|
|
47823
|
-
data: null
|
|
47824
|
-
});
|
|
47825
|
-
}
|
|
47826
|
-
};
|
|
47827
|
-
//#endregion
|
|
47828
44017
|
//#region src/module/server/api/index.ts
|
|
47829
44018
|
/**
|
|
47830
44019
|
* API 路由聚合
|
|
@@ -47832,7 +44021,9 @@ var getModuleSchemaApi = async (req, res) => {
|
|
|
47832
44021
|
var apiRouter = express.Router();
|
|
47833
44022
|
var authMiddlewares = [authMiddleware, signatureVerificationMiddleware];
|
|
47834
44023
|
apiRouter.get("/bots", ...authMiddlewares, getBots);
|
|
44024
|
+
apiRouter.get("/bots/:botId", ...authMiddlewares, getBotInfo);
|
|
47835
44025
|
apiRouter.get("/bots/:botId/groups", ...authMiddlewares, getBotGroups);
|
|
44026
|
+
apiRouter.get("/bots/:botId/groups/:groupId", ...authMiddlewares, getBotGroupInfo);
|
|
47836
44027
|
apiRouter.get("/groups", ...authMiddlewares, getGroups);
|
|
47837
44028
|
apiRouter.post("/groups/batch", ...authMiddlewares, getGroupsBatch);
|
|
47838
44029
|
apiRouter.post("/link/resolve", ...authMiddlewares, resolveLink);
|
|
@@ -47843,8 +44034,6 @@ apiRouter.get("/config/:module", ...authMiddlewares, getConfigModule);
|
|
|
47843
44034
|
apiRouter.put("/config/:module", ...authMiddlewares, updateConfigModule);
|
|
47844
44035
|
apiRouter.post("/config/:module", ...authMiddlewares, updateConfigModule);
|
|
47845
44036
|
apiRouter.patch("/config/:module", ...authMiddlewares, patchConfigItem);
|
|
47846
|
-
apiRouter.get("/schema", ...authMiddlewares, getFullSchema);
|
|
47847
|
-
apiRouter.get("/schema/:module", ...authMiddlewares, getModuleSchemaApi);
|
|
47848
44037
|
apiRouter.use("/platforms/douyin", ...authMiddlewares, router);
|
|
47849
44038
|
apiRouter.use("/platforms/bilibili", ...authMiddlewares, router$1);
|
|
47850
44039
|
//#endregion
|
|
@@ -48037,6 +44226,19 @@ var proxyOptions = {
|
|
|
48037
44226
|
target: "https://developer.huawei.com",
|
|
48038
44227
|
changeOrigin: true
|
|
48039
44228
|
};
|
|
44229
|
+
var webDistPath = path.join(Root.pluginPath, "lib", "web");
|
|
44230
|
+
var webIndexPath = path.join(webDistPath, "index.html");
|
|
44231
|
+
var sendWebIndex = (res) => {
|
|
44232
|
+
try {
|
|
44233
|
+
const html = fs.readFileSync(webIndexPath, "utf-8");
|
|
44234
|
+
res.setHeader("Cache-Control", "no-cache");
|
|
44235
|
+
res.type("html").send(html);
|
|
44236
|
+
} catch (error) {
|
|
44237
|
+
const message = `[karin-plugin-kkk] Failed to read Web UI entry: ${webIndexPath}`;
|
|
44238
|
+
logger.error(error instanceof Error ? `${message}\n${error.stack ?? error.message}` : `${message}\n${String(error)}`);
|
|
44239
|
+
res.status(500).type("text/plain").send(message);
|
|
44240
|
+
}
|
|
44241
|
+
};
|
|
48040
44242
|
server.use(import_lib.default());
|
|
48041
44243
|
server.use("/", createProxyMiddleware(proxyOptions));
|
|
48042
44244
|
if (process.env.NODE_ENV !== "test") checkPort(3780).then((isOpen) => {
|
|
@@ -48067,11 +44269,27 @@ app$1.get("/stream/:filename", videoStreamRouter);
|
|
|
48067
44269
|
app$1.get("/video/:filename", getVideoRouter);
|
|
48068
44270
|
app$1.get("/video/:filename/events", videoPreviewEventsRouter);
|
|
48069
44271
|
app$1.use("/v1", apiRouter);
|
|
44272
|
+
var staticRouter = express.Router();
|
|
44273
|
+
var webStatic = express.static(webDistPath, {
|
|
44274
|
+
redirect: false,
|
|
44275
|
+
setHeaders: (res, filePath) => {
|
|
44276
|
+
if (filePath.endsWith(".html")) {
|
|
44277
|
+
res.setHeader("Cache-Control", "no-cache");
|
|
44278
|
+
return;
|
|
44279
|
+
}
|
|
44280
|
+
res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
|
|
44281
|
+
}
|
|
44282
|
+
});
|
|
44283
|
+
staticRouter.use(webStatic);
|
|
44284
|
+
staticRouter.use((_req, res) => {
|
|
44285
|
+
sendWebIndex(res);
|
|
44286
|
+
});
|
|
48070
44287
|
/** 将子路由挂载到主路由上 */
|
|
44288
|
+
app.use("/kkk", staticRouter);
|
|
48071
44289
|
app.use("/api/kkk", app$1);
|
|
48072
44290
|
//#endregion
|
|
48073
44291
|
//#region src/setup.ts
|
|
48074
|
-
var requireVersion = "1.
|
|
44292
|
+
var requireVersion = "1.16.1";
|
|
48075
44293
|
if (process.env.NODE_ENV !== "development" && isSemverGreater(requireVersion, Root.karinVersion)) {
|
|
48076
44294
|
const msg = `[karin-plugin-kkk] 插件构建时的 karin 版本 (${requireVersion}) 高于当前运行版本 (${Root.karinVersion}),可能会出现兼容性问题!`;
|
|
48077
44295
|
logger.warn(msg);
|