rc-plugin/guoba.support.js
zhiyu1998 b70b5f5e89 feat: 1.6.6 [#I9E25J] 增强downloadVideo下载函数功能 & 删除青年大学习 & 格式化PR代码
1. `downloadVideo`函数现在支持多线程下载,速度巨tm快,比之前的速度快了200%以上
2. `青年大学习`功能退役
3. 格式化PR代码
2024-04-04 11:53:36 +08:00

164 lines
7.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import path from "path";
import model from "./model/index.js";
import _ from "lodash";
const _path = process.cwd() + "/plugins/rconsole-plugin";
export function supportGuoba() {
return {
pluginInfo: {
name: "R插件",
title: "rconsole-plugin",
author: "@zhiyu",
authorLink: "https://gitee.com/kyrzy0416",
link: "https://gitee.com/kyrzy0416/rconsole-plugin",
isV3: true,
isV2: false,
description: "专门为朋友们写的Yunzai-Bot插件专注图片分享和生活的插件",
// 显示图标,此为个性化配置
// 图标可在 https://icon-sets.iconify.design 这里进行搜索
// icon: "mdi:share-reviews-sharp",
// 图标颜色,例:#FF0000 或 rgb(255, 0, 0)
// iconColor: "#3498db",
// 如果想要显示成图片,也可以填写图标路径(绝对路径)
iconPath: path.join(_path, "resources/img/rank/top.png"),
},
configInfo: {
schemas: [
{
field: "tools.proxyAddr",
label: "魔法地址",
bottomHelpMessage: "tiktok/小蓝鸟等要使用魔法时需要填写",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入魔法地址默认127.0.0.1",
},
},
{
field: "tools.proxyPort",
label: "魔法端口",
bottomHelpMessage: "tiktok/小蓝鸟等要使用魔法时需要填写",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入端口默认7890",
},
},
{
field: "tools.translateAppId",
label: "百度翻译APP ID",
bottomHelpMessage: "使用百度翻译需要的APP ID需要申请",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入APP ID",
},
},
{
field: "tools.translateSecret",
label: "百度翻译密匙",
bottomHelpMessage: "使用百度翻译需要的密匙(需要申请)",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入密匙",
},
},
{
field: "tools.defaultPath",
label: "视频暂存位置",
bottomHelpMessage:
"视频暂存位置(如果你对你系统我的文件非常了解可以修改,不然不建议)",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入视频暂存位置",
},
},
{
field: "tools.biliSessData",
label: "哔哩哔哩SESSDATA",
bottomHelpMessage:
"如何获取具体参考我的文档说明https://gitee.com/kyrzy0416/rconsole-plugin#Q&A",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入哔哩哔哩SESSDATA",
},
},
{
field: "tools.biliDuration",
label: "哔哩哔哩的视频最大限制时长",
bottomHelpMessage:
"超过时长无法解析,保护服务器性能",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入哔哩哔哩的视频最大限制时长默认15分钟",
},
},
{
field: "tools.biliIntroLenLimit",
label: "哔哩哔哩的简介长度限制",
bottomHelpMessage:
"防止简介过长刷屏",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入哔哩哔哩的简介长度限制默认50个字符填 0 或者 -1 可以不做任何限制,显示完整简介",
},
},
{
field: "tools.douyinCookie",
label: "抖音的Cookie",
bottomHelpMessage:
"登陆https://www.douyin.com/ - F12 - 自己替换一下odin_tt=xxx;sessionid_ss=xxx;ttwid=xxx;passport_csrf_token=xxx;msToken=xxx;",
component: "Input",
required: false,
componentProps: {
placeholder: "请输入抖音的Cookie",
},
},
{
field: "tools.queueConcurrency",
label: "允许多用户下载个数",
bottomHelpMessage:
"【目前只涉及哔哩哔哩的下载功能】根据服务器性能设置可以并发下载的个数如果你的服务器比较强劲就选择4~12较弱就一个一个下载选择1",
component: "Input",
required: false,
componentProps: {
placeholder: "如果你的服务器比较强劲就写4~12比如4就是可以4个人同时下载较弱就一个一个下载写1",
},
},
{
field: "tools.videoDownloadConcurrency",
label: "使用下载视频的并发个数",
bottomHelpMessage:
"与【允许多用户下载个数】不同这个功能影响下载速度。默认是1使用根据服务器性能进行选择如果不确定是否可以用1即可高性能服务器随意4~12都可以看CPU的实力",
component: "Input",
required: false,
componentProps: {
placeholder: "不确定用1即可高性能服务器随意4~12都可以看CPU的实力",
},
},
],
getConfigData() {
const toolsData = {
tools: model.getConfig("tools"),
};
return toolsData;
},
setConfigData(data, { Result }) {
let config = {};
for (let [key, value] of Object.entries(data)) {
_.set(config, key, value);
}
// TODO 目前只有一个文件的配置,暂时这样写
config = _.merge({}, model.getConfig("tools"), config.tools);
model.saveSet("tools", config);
return Result.ok({}, "保存成功~");
},
},
};
}