feat: 新增 视频大小限制(单位MB) 选项

This commit is contained in:
zhiyu1998 2024-08-05 09:27:26 +08:00
parent 0792cd2451
commit d589898ffd
3 changed files with 16 additions and 1 deletions

View File

@ -199,6 +199,8 @@ export class tools extends plugin {
this.toolsConfig = config.getConfig("tools"); this.toolsConfig = config.getConfig("tools");
// 视频保存路径 // 视频保存路径
this.defaultPath = this.toolsConfig.defaultPath; this.defaultPath = this.toolsConfig.defaultPath;
// 视频限制大小
this.videoSizeLimit = this.toolsConfig.videoSizeLimit;
// 魔法接口 // 魔法接口
this.proxyAddr = this.toolsConfig.proxyAddr; this.proxyAddr = this.toolsConfig.proxyAddr;
this.proxyPort = this.toolsConfig.proxyPort; this.proxyPort = this.toolsConfig.proxyPort;
@ -2067,7 +2069,8 @@ export class tools extends plugin {
* @param path 视频所在路径 * @param path 视频所在路径
* @param videoSizeLimit 发送转上传视频的大小限制默认70MB * @param videoSizeLimit 发送转上传视频的大小限制默认70MB
*/ */
async sendVideoToUpload(e, path, videoSizeLimit = 70) { async sendVideoToUpload(e, path, videoSizeLimit = this.videoSizeLimit) {
// logger.info(videoSizeLimit);
const isLag = await this.isLagRangeDriver(); const isLag = await this.isLagRangeDriver();
// 判断是否是拉格朗日 // 判断是否是拉格朗日
if (isLag === 1) { if (isLag === 1) {

View File

@ -1,4 +1,5 @@
defaultPath: './data/rcmp4/' # 保存视频的位置 defaultPath: './data/rcmp4/' # 保存视频的位置
videoSizeLimit: 70 # 视频大小限制单位MB超过大小则转换成群文件上传
proxyAddr: '127.0.0.1' # 魔法地址 proxyAddr: '127.0.0.1' # 魔法地址
proxyPort: '7890' # 魔法端口 proxyPort: '7890' # 魔法端口

View File

@ -77,6 +77,17 @@ export function supportGuoba() {
placeholder: "请输入视频暂存位置", placeholder: "请输入视频暂存位置",
}, },
}, },
{
field: "tools.videoSizeLimit",
label: "视频大小限制",
bottomHelpMessage:
"视频大小限制单位MB超过大小则转换成群文件上传",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入视频大小限制",
},
},
{ {
field: "tools.biliSessData", field: "tools.biliSessData",
label: "哔哩哔哩SESSDATA", label: "哔哩哔哩SESSDATA",