mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-13 23:59:19 +00:00
💩
This commit is contained in:
parent
42e02fc381
commit
b523fafdeb
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,7 +7,6 @@ node_modules/
|
|||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
# OS generated files
|
# OS generated files
|
||||||
.DS_Store
|
|
||||||
.DS_Store?
|
.DS_Store?
|
||||||
._*
|
._*
|
||||||
.Spotlight-V100
|
.Spotlight-V100
|
||||||
@ -20,7 +19,6 @@ package-lock.json
|
|||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
yarn.lock
|
yarn.lock
|
||||||
.prettierrc.json
|
.prettierrc.json
|
||||||
.vitepress
|
|
||||||
bun.lockb
|
bun.lockb
|
||||||
.next
|
.next
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
|
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"semi": true,
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "es5"
|
||||||
|
}
|
1371
apps/RCtools.js
Normal file
1371
apps/RCtools.js
Normal file
File diff suppressed because it is too large
Load Diff
3529
apps/tools.js
3529
apps/tools.js
File diff suppressed because it is too large
Load Diff
@ -3,96 +3,37 @@
|
|||||||
*
|
*
|
||||||
* @type {{英: string, 日: string, 文: string, 中: string}}
|
* @type {{英: string, 日: string, 文: string, 中: string}}
|
||||||
*/
|
*/
|
||||||
export const transMap = { 中: "zh", 日: "jp", 文: "wyw", 英: "en", 俄: "ru", 韩: "kr" };
|
export const transMap = { 中: 'zh', 日: 'jp', 文: 'wyw', 英: 'en', 俄: 'ru', 韩: 'kr' };
|
||||||
/**
|
/**
|
||||||
* 用于腾讯交互式翻译的常量控制
|
* 用于腾讯交互式翻译的常量控制
|
||||||
*
|
*
|
||||||
* @type {{英: string, 俄: string, 日: string, 韩: string, 中: string}}
|
* @type {{英: string, 俄: string, 日: string, 韩: string, 中: string}}
|
||||||
*/
|
*/
|
||||||
export const tencentTransMap = { 中: "zh", 日: "ja", 韩: "ko", 英: "en", 俄: "ru" };
|
export const tencentTransMap = { 中: 'zh', 日: 'ja', 韩: 'ko', 英: 'en', 俄: 'ru' };
|
||||||
/**
|
|
||||||
* 用于腾讯交互式翻译的常量控制
|
|
||||||
*
|
|
||||||
* @type {{英: string, 俄: string, 日: string, 韩: string, 中: string}}
|
|
||||||
*/
|
|
||||||
export const googleTransMap = { 中: "zh-CN", 日: "jp", 韩: "ko", 英: "en", 俄: "ru" };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 以下为抖音/TikTok类型代码
|
|
||||||
*
|
|
||||||
* @type {{"0": string, "55": string, "2": string, "68": string, "58": string, "4": string, "61": string, "51": string, "150": string}}
|
|
||||||
*/
|
|
||||||
export const douyinTypeMap = {
|
|
||||||
2: "image",
|
|
||||||
4: "video",
|
|
||||||
68: "image",
|
|
||||||
0: "video",
|
|
||||||
51: "video",
|
|
||||||
55: "video",
|
|
||||||
58: "video",
|
|
||||||
61: "video",
|
|
||||||
150: "image",
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 固定值 1w,目前用于哔哩哔哩的数值渲染
|
* 固定值 1w,目前用于哔哩哔哩的数值渲染
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
export const TEN_THOUSAND = 10000;
|
export const TEN_THOUSAND = 10000;
|
||||||
|
|
||||||
/**
|
|
||||||
* #cat 指令的限制
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
export const CAT_LIMIT = 10;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共的 User-Agent
|
* 公共的 User-Agent
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const COMMON_USER_AGENT = "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36";
|
export const COMMON_USER_AGENT =
|
||||||
|
'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36';
|
||||||
/**
|
|
||||||
* 无水印的头请求
|
|
||||||
* @type {{cookie: string, "User-Agent": string, accept: string}}
|
|
||||||
*/
|
|
||||||
export const XHS_NO_WATERMARK_HEADER = {
|
|
||||||
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
|
|
||||||
'cookie': '',
|
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36',
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分割线
|
* 分割线
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const DIVIDING_LINE = "\n━━━{}━━━"
|
export const DIVIDING_LINE = '\n━━━{}━━━';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存判断机子是否是海外服务器的key
|
* 保存判断机子是否是海外服务器的key
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const REDIS_YUNZAI_ISOVERSEA = "Yz:rconsole:tools:oversea";
|
export const REDIS_YUNZAI_ISOVERSEA = 'Yz:rconsole:tools:oversea';
|
||||||
|
|
||||||
/**
|
|
||||||
* 缓存音乐搜索列表
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const REDIS_YUNZAI_SONGINFO = "Yz:rconsole:tools:songinfo";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缓存网易云云盘列表
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const REDIS_YUNZAI_CLOUDSONGLIST = "Yz:rconsole:tools:cloudsonglist";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 某些功能的解析白名单
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const REDIS_YUNZAI_WHITELIST = "Yz:rconsole:tools:whitelist";
|
|
||||||
|
|
||||||
export const TWITTER_BEARER_TOKEN = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 哔哩哔哩简介默认长度限制
|
* 哔哩哔哩简介默认长度限制
|
||||||
@ -100,118 +41,76 @@ export const TWITTER_BEARER_TOKEN = "";
|
|||||||
*/
|
*/
|
||||||
export const BILI_DEFAULT_INTRO_LEN_LIMIT = 50;
|
export const BILI_DEFAULT_INTRO_LEN_LIMIT = 50;
|
||||||
|
|
||||||
/**
|
|
||||||
* 总结的prompt
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const SUMMARY_PROMPT = `# Role: Web Content Summarization Assistant
|
|
||||||
|
|
||||||
## Profile
|
|
||||||
- author: R-plugin
|
|
||||||
- version: 1.0
|
|
||||||
- language: 中文
|
|
||||||
- description: 一个专门用于网页内容摘要的AI助手,能够提取关键点,总结文章,并提供复杂主题的简洁概览。
|
|
||||||
|
|
||||||
## Skills
|
|
||||||
1. 精通自然语言理解和摘要技术。
|
|
||||||
2. 能够从各种网页内容格式(文章、博客、报告)中提取关键信息。
|
|
||||||
3. 能够总结短篇和长篇内容。
|
|
||||||
4. 适应不同的写作风格和语调。
|
|
||||||
|
|
||||||
## Rules
|
|
||||||
1. 确保摘要捕捉到网页的主要思想和关键点。
|
|
||||||
2. 摘要应简洁、清晰、准确,避免不必要的细节。
|
|
||||||
3. 根据原始内容的复杂性和长度调整摘要的长度和细节。
|
|
||||||
4. 保持原始内容的上下文和意图,不添加个人解释。
|
|
||||||
|
|
||||||
## Workflows
|
|
||||||
1. 分析网页的结构和主要部分。
|
|
||||||
2. 识别并提取内容中的关键点、论点或信息。
|
|
||||||
3. 首先,生成一个标题,格式约束为:"标题: {title}"。
|
|
||||||
4. 然后,生成一个包含最重要细节的简洁摘要。
|
|
||||||
5. 接下来,生成一个"关键段落"标题,内容包括你认为文章中一些关键信息点,每个关键点前都带有一个表情符号。
|
|
||||||
6. 接下来,审查摘要的准确性和完整性。不要在摘要审查中包含当前网页的URL。
|
|
||||||
7. 最后,输出内容保证为中文。
|
|
||||||
|
|
||||||
## Init
|
|
||||||
在第一次对话中,请直接输出以下:您好!我将联合R插件为您提供简洁明了的网页内容。`
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片翻译 prompt
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const IMAGE_TRANSLATION_PROMPT = `Begin each of the following with a triangle symbol (▲ U+25B2): First, a brief description of the image to be used as alt text. Do not describe or extract text in the description. Second, the text extracted from the image, with newlines where applicable. Un-obstruct text if it is covered by something, to make it readable. If there is no text in the image, only respond with the description. Do not include any other information. Example: ▲ Lines of code in a text editor.▲ const x = 5; const y = 10; const z = x + y; console.log(z); Finally, answer in Chinese.`
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 帮助文档提示
|
* 帮助文档提示
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const HELP_DOC = "\n文档:https://zhiyu1998.github.io/rconsole-plugin/"
|
export const HELP_DOC = '\n如果您对功能有任何问题欢迎参阅文档奥~\nhttps://docs.crystelf.top/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总结内容评估器的正则
|
* 总结内容评估器的正则
|
||||||
* @type {{reg: RegExp, name: string}[]}
|
* @type {{reg: RegExp, name: string}[]}
|
||||||
*/
|
*/
|
||||||
export const SUMMARY_CONTENT_ESTIMATOR_PATTERNS = [
|
export const SUMMARY_CONTENT_ESTIMATOR_PATTERNS = [
|
||||||
{ reg: /(?:https?:\/\/)?mp\.weixin\.qq\.com\/[A-Za-z\d._?%&+\-=\/#]*/, name: '微信文章' },
|
{ reg: /(?:https?:\/\/)?mp\.weixin\.qq\.com\/[A-Za-z\d._?%&+\-=\/#]*/, name: '微信文章' },
|
||||||
{ reg: /(?:https?:\/\/)?arxiv.org\/[a-zA-Z\d._?%&+\-=\/#]*/, name: 'ArXiv论文' },
|
{ reg: /(?:https?:\/\/)?arxiv.org\/[a-zA-Z\d._?%&+\-=\/#]*/, name: 'ArXiv论文' },
|
||||||
{ reg: /(?:https?:\/\/)?sspai.com\/[a-zA-Z\d._?%&+\-=\/#]*/, name: '少数派' },
|
{ reg: /(?:https?:\/\/)?sspai.com\/[a-zA-Z\d._?%&+\-=\/#]*/, name: '少数派' },
|
||||||
{ reg: /(?:https?:\/\/)?www\.bilibili\.com\/read\/[A-Za-z\d._?%&+\-=\/#]*/, name: '哔哩哔哩专栏' },
|
{
|
||||||
{ reg: /(?:https?:\/\/)?www\.zhihu\.com\/question\/[A-Za-z\d._?%&+\-=\/#]*/, name: '知乎问题' },
|
reg: /(?:https?:\/\/)?www\.bilibili\.com\/read\/[A-Za-z\d._?%&+\-=\/#]*/,
|
||||||
{ reg: /(?:https?:\/\/)?(www\.)chinadaily.com.cn\/a\/[a-zA-Z0-9\d._?%&+\-=\/#]*/, name: 'ChinaDaily' },
|
name: '哔哩哔哩专栏',
|
||||||
{ reg: /(?:https?:\/\/)?(www\.)?github.com\/[a-zA-Z0-9\d._?%&+\-=\/#]*/, name: 'Github' }
|
},
|
||||||
|
{ reg: /(?:https?:\/\/)?www\.zhihu\.com\/question\/[A-Za-z\d._?%&+\-=\/#]*/, name: '知乎问题' },
|
||||||
|
{
|
||||||
|
reg: /(?:https?:\/\/)?(www\.)chinadaily.com.cn\/a\/[a-zA-Z0-9\d._?%&+\-=\/#]*/,
|
||||||
|
name: 'ChinaDaily',
|
||||||
|
},
|
||||||
|
{ reg: /(?:https?:\/\/)?(www\.)?github.com\/[a-zA-Z0-9\d._?%&+\-=\/#]*/, name: 'Github' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const BILI_CDN_TEMPLATE = "upos-sz-mirror{}.bilivideo.com";
|
const BILI_CDN_TEMPLATE = 'upos-sz-mirror{}.bilivideo.com';
|
||||||
export const BILI_CDN_SELECT_LIST = Object.freeze([
|
export const BILI_CDN_SELECT_LIST = Object.freeze([
|
||||||
{ label: '不使用', value: 0, sign: '' },
|
{ label: '不使用', value: 0, sign: '' },
|
||||||
{ label: '腾讯CDN【推荐】', value: 1, sign: BILI_CDN_TEMPLATE.replace('{}', 'cos') },
|
{ label: '腾讯CDN【推荐】', value: 1, sign: BILI_CDN_TEMPLATE.replace('{}', 'cos') },
|
||||||
{ label: '百度CDN', value: 2, sign: BILI_CDN_TEMPLATE.replace('{}', 'bd') },
|
{ label: '百度CDN', value: 2, sign: BILI_CDN_TEMPLATE.replace('{}', 'bd') },
|
||||||
{ label: '华为CDN', value: 3, sign: BILI_CDN_TEMPLATE.replace('{}', 'hw') },
|
{ label: '华为CDN', value: 3, sign: BILI_CDN_TEMPLATE.replace('{}', 'hw') },
|
||||||
{ label: '阿卡迈(海外)', value: 4 , sign: BILI_CDN_TEMPLATE.replace('{}', 'akamai')},
|
{ label: '阿卡迈(海外)', value: 4, sign: BILI_CDN_TEMPLATE.replace('{}', 'akamai') },
|
||||||
{ label: 'HK-CDN', value: 5, sign: BILI_CDN_TEMPLATE.replace('{}', 'aliov') }
|
{ label: 'HK-CDN', value: 5, sign: BILI_CDN_TEMPLATE.replace('{}', 'aliov') },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const BILI_DOWNLOAD_METHOD = Object.freeze([
|
export const BILI_DOWNLOAD_METHOD = Object.freeze([
|
||||||
{ label: '稳定(原生)', value: 0 },
|
{ label: '稳定(原生)', value: 0 },
|
||||||
{ label: '性能(Aria2)', value: 1 },
|
{ label: '性能(Aria2)', value: 1 },
|
||||||
{ label: '轻量(axel/wget)', value: 2 }
|
{ label: '轻量(axel/wget)', value: 2 },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const BILI_RESOLUTION_LIST = Object.freeze([
|
export const BILI_RESOLUTION_LIST = Object.freeze([
|
||||||
{ label: '8K 超高清', value: 0, qn: 127 },
|
{ label: '8K 超高清', value: 0, qn: 127 },
|
||||||
{ label: '4K 超清', value: 1, qn: 120 },
|
{ label: '4K 超清', value: 1, qn: 120 },
|
||||||
{ label: '1080P 高码率', value: 2, qn: 112 },
|
{ label: '1080P 高码率', value: 2, qn: 112 },
|
||||||
{ label: '1080P 高清', value: 3, qn: 80 },
|
{ label: '1080P 高清', value: 3, qn: 80 },
|
||||||
{ label: '720P 高清', value: 4, qn: 64 },
|
{ label: '720P 高清', value: 4, qn: 64 },
|
||||||
{ label: '480P 清晰', value: 5, qn: 32 },
|
{ label: '480P 清晰', value: 5, qn: 32 },
|
||||||
{ label: '360P 流畅', value: 6, qn: 16 },
|
{ label: '360P 流畅', value: 6, qn: 16 },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const YOUTUBE_GRAPHICS_LIST = Object.freeze([
|
export const YOUTUBE_GRAPHICS_LIST = Object.freeze([
|
||||||
{ label: 'Best', value: 0 },
|
{ label: 'Best', value: 0 },
|
||||||
{ label: '1080P 高清', value: 1080 },
|
{ label: '1080P 高清', value: 1080 },
|
||||||
{ label: '720P 高清', value: 720 },
|
{ label: '720P 高清', value: 720 },
|
||||||
{ label: '480P 清晰', value: 480 },
|
{ label: '480P 清晰', value: 480 },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const NETEASECLOUD_QUALITY_LIST = Object.freeze([
|
export const NETEASECLOUD_QUALITY_LIST = Object.freeze([
|
||||||
{ label: '标准', value: 'standard' },
|
{ label: '标准', value: 'standard' },
|
||||||
{ label: '较高', value: 'higher' },
|
{ label: '较高', value: 'higher' },
|
||||||
{ label: '极高', value: 'exhigh' },
|
{ label: '极高', value: 'exhigh' },
|
||||||
{ label: '无损', value: 'lossless' },
|
{ label: '无损', value: 'lossless' },
|
||||||
{ label: 'Hi-Res', value: 'hires' },
|
{ label: 'Hi-Res', value: 'hires' },
|
||||||
{ label: '高清环绕声', value: 'jyeffect' },
|
{ label: '高清环绕声', value: 'jyeffect' },
|
||||||
{ label: '沉浸环绕声', value: 'sky' },
|
{ label: '沉浸环绕声', value: 'sky' },
|
||||||
{ label: '杜比全景声(不推荐)', value: 'dolby' },
|
{ label: '杜比全景声(不推荐)', value: 'dolby' },
|
||||||
{ label: '超清母带', value: 'jymaster' },
|
{ label: '超清母带', value: 'jymaster' },
|
||||||
]);
|
]);
|
||||||
/**
|
|
||||||
* 消息撤回时间
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
export const MESSAGE_RECALL_TIME = 60;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 针对 Aria2 和 Alex 的下载检测文件时间
|
* 针对 Aria2 和 Alex 的下载检测文件时间
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@ -222,4 +121,4 @@ export const DOWNLOAD_WAIT_DETECT_FILE_TIME = 3000;
|
|||||||
* 短链接接口
|
* 短链接接口
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const SHORT_LINKS = "https://smolurl.com/api/links";
|
export const SHORT_LINKS = 'https://smolurl.com/api/links';
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
export const REDIS_YUNZAI_RESOLVE_CONTROLLER = "Yz:rconsole:resolve:controller"
|
|
||||||
|
|
||||||
export const RESOLVE_CONTROLLER_NAME_ENUM = {
|
export const RESOLVE_CONTROLLER_NAME_ENUM = {
|
||||||
"douyin": "抖音",
|
douyin: '抖音',
|
||||||
"bili": "哔哩哔哩",
|
bili: '哔哩哔哩',
|
||||||
"tiktok": "TikTok",
|
tiktok: 'TikTok',
|
||||||
"twitter_x": "Twitter",
|
twitter_x: 'Twitter',
|
||||||
"acfun": "Acfun",
|
acfun: 'Acfun',
|
||||||
"xhs": "小红书",
|
xhs: '小红书',
|
||||||
"bodianMusic": "波点",
|
bodianMusic: '波点',
|
||||||
"general": "通用(包含快手等)",
|
general: '通用(包含快手等)',
|
||||||
"sy2b": "YouTube",
|
sy2b: 'YouTube',
|
||||||
"miyoushe": "米游社",
|
miyoushe: '米游社',
|
||||||
"netease": "网易云音乐",
|
netease: '网易云音乐',
|
||||||
"weibo": "微博",
|
weibo: '微博',
|
||||||
"weishi": "微视",
|
weishi: '微视',
|
||||||
"zuiyou": "最右",
|
zuiyou: '最右',
|
||||||
"freyr": "AM+Spotify",
|
freyr: 'AM+Spotify',
|
||||||
"qqMusic": "扣扣音乐",
|
qqMusic: '扣扣音乐',
|
||||||
"qishuiMusic": "汽水音乐",
|
qishuiMusic: '汽水音乐',
|
||||||
"aircraft": "小飞机",
|
aircraft: '小飞机',
|
||||||
"tieba": "贴吧",
|
tieba: '贴吧',
|
||||||
}
|
};
|
||||||
|
@ -3,282 +3,149 @@
|
|||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/misc/sign/wbi.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/misc/sign/wbi.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_SUMMARY = "https://api.bilibili.com/x/web-interface/view/conclusion/get";
|
export const BILI_SUMMARY = 'https://api.bilibili.com/x/web-interface/view/conclusion/get';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频流URL
|
* 视频流URL
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_PLAY_STREAM = "https://api.bilibili.com/x/player/wbi/playurl?cid={cid}&bvid={bvid}&qn={qn}&fnval=16";
|
export const BILI_PLAY_STREAM =
|
||||||
|
'https://api.bilibili.com/x/player/wbi/playurl?cid={cid}&bvid={bvid}&qn={qn}&fnval=16';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态信息
|
* 动态信息
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/dynamic/get_dynamic_detail.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/dynamic/get_dynamic_detail.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_DYNAMIC = "https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/get_dynamic_detail?dynamic_id={}";
|
export const BILI_DYNAMIC =
|
||||||
|
'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/get_dynamic_detail?dynamic_id={}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BVID -> CID
|
* BVID -> CID
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/33bde6f6afcac2ff8c6f7069f08ce84065a6cff6/docs/video/info.md?plain=1#L4352
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/33bde6f6afcac2ff8c6f7069f08ce84065a6cff6/docs/video/info.md?plain=1#L4352
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_BVID_TO_CID = "https://api.bilibili.com/x/player/pagelist?bvid={bvid}&jsonp=jsonp";
|
export const BILI_BVID_TO_CID =
|
||||||
|
'https://api.bilibili.com/x/player/pagelist?bvid={bvid}&jsonp=jsonp';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频基本信息API
|
* 视频基本信息API
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/info.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/info.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_VIDEO_INFO = "http://api.bilibili.com/x/web-interface/view";
|
export const BILI_VIDEO_INFO = 'http://api.bilibili.com/x/web-interface/view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录基本信息
|
* 登录基本信息
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/login/login_info.md#%E5%AF%BC%E8%88%AA%E6%A0%8F%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/login/login_info.md#%E5%AF%BC%E8%88%AA%E6%A0%8F%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_NAV = "https://api.bilibili.com/x/web-interface/nav";
|
export const BILI_NAV = 'https://api.bilibili.com/x/web-interface/nav';
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录用户状态数(双端)
|
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect?tab=readme-ov-file
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const BILI_NAV_STAT = "https://api.bilibili.com/x/web-interface/nav/stat";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码登录的二维码生成
|
* 扫码登录的二维码生成
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/login/login_action/QR.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/login/login_action/QR.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_SCAN_CODE_GENERATE = "https://passport.bilibili.com/x/passport-login/web/qrcode/generate";
|
export const BILI_SCAN_CODE_GENERATE =
|
||||||
|
'https://passport.bilibili.com/x/passport-login/web/qrcode/generate';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码登录检测然后发送令牌数据
|
* 扫码登录检测然后发送令牌数据
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/login/login_action/QR.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/login/login_action/QR.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_SCAN_CODE_DETECT = "https://passport.bilibili.com/x/passport-login/web/qrcode/poll?qrcode_key={}";
|
export const BILI_SCAN_CODE_DETECT =
|
||||||
|
'https://passport.bilibili.com/x/passport-login/web/qrcode/poll?qrcode_key={}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间信息获取
|
* 直播间信息获取
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/info.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/info.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_STREAM_INFO = "https://api.live.bilibili.com/room/v1/Room/get_info";
|
export const BILI_STREAM_INFO = 'https://api.live.bilibili.com/room/v1/Room/get_info';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据真实直播间号获取直播视频流
|
* 根据真实直播间号获取直播视频流
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/live_stream.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/live_stream.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_STREAM_FLV = "https://api.live.bilibili.com/room/v1/Room/playUrl";
|
export const BILI_STREAM_FLV = 'https://api.live.bilibili.com/room/v1/Room/playUrl';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取视频在线人数_web端
|
* 获取视频在线人数_web端
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/online.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/online.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_ONLINE = "https://api.bilibili.com/x/player/online/total?bvid={0}&cid={1}";
|
export const BILI_ONLINE = 'https://api.bilibili.com/x/player/online/total?bvid={0}&cid={1}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 剧集基本信息
|
* 剧集基本信息
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/bangumi/info.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/bangumi/info.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_EP_INFO = "https://api.bilibili.com/pgc/view/web/season?ep_id={}";
|
export const BILI_EP_INFO = 'https://api.bilibili.com/pgc/view/web/season?ep_id={}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 剧集基本信息
|
* 剧集基本信息
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/bangumi/info.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/bangumi/info.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_SSID_INFO = "https://api.bilibili.com/pgc/web/season/section?season_id={}";
|
export const BILI_SSID_INFO = 'https://api.bilibili.com/pgc/web/season/section?season_id={}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专栏信息
|
* 专栏信息
|
||||||
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/article/info.md
|
* https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/article/info.md
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const BILI_ARTICLE_INFO = "https://api.bilibili.com/x/article/viewinfo?id={}";
|
export const BILI_ARTICLE_INFO = 'https://api.bilibili.com/x/article/viewinfo?id={}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 米游社网页端获取文章
|
* 米游社网页端获取文章
|
||||||
* https://github.com/UIGF-org/mihoyo-api-collect/blob/main/hoyolab/article/article.md#%E8%8E%B7%E5%8F%96%E5%AE%8C%E6%95%B4%E6%96%87%E7%AB%A0%E4%BF%A1%E6%81%AF
|
* https://github.com/UIGF-org/mihoyo-api-collect/blob/main/hoyolab/article/article.md#%E8%8E%B7%E5%8F%96%E5%AE%8C%E6%95%B4%E6%96%87%E7%AB%A0%E4%BF%A1%E6%81%AF
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const MIYOUSHE_ARTICLE = "https://bbs-api.miyoushe.com/post/wapi/getPostFull?post_id={}";
|
export const MIYOUSHE_ARTICLE = 'https://bbs-api.miyoushe.com/post/wapi/getPostFull?post_id={}';
|
||||||
|
|
||||||
/**
|
|
||||||
* 视频请求链接CDN
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const XHS_VIDEO = "http://sns-video-bd.xhscdn.com/";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dy API
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const DY_INFO = "https://www.douyin.com/aweme/v1/web/aweme/detail/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id={}&pc_client_type=1&version_code=190500&version_name=19.5.0&cookie_enabled=true&screen_width=1344&screen_height=756&browser_language=zh-CN&browser_platform=Win32&browser_name=Firefox&browser_version=118.0&browser_online=true&engine_name=Gecko&engine_version=109.0&os_name=Windows&os_version=10&cpu_core_num=16&device_memory=&platform=PC";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DY COMMENT API
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const DY_COMMENT = "https://www.douyin.com/aweme/v1/web/comment/list/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id={}&cursor=0&count=20&item_type=0&insert_ids=&whale_cut_token=&cut_version=1&rcFT=&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=124.0.0.0&browser_online=true&engine_name=Blink&engine_version=124.0.0.0&os_name=Windows&os_version=10&cpu_core_num=20&device_memory=8&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7361743797237679616";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 今日头条 DY API
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const DY_TOUTIAO_INFO = "https://aweme.snssdk.com/aweme/v1/play/?video_id={}&ratio=1080p&line=0";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DY 直播信息
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const DY_LIVE_INFO = "https://live.douyin.com/webcast/room/web/enter/?device_platform=webapp&aid=6383&channel=channel_pc_web&pc_client_type=1&version_code=190500&version_name=19.5.0&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=zh-CN&browser_platform=Win32&browser_name=Firefox&browser_version=124.0&browser_online=true&engine_name=Gecko&engine_version=122.0.0.0&os_name=Windows&os_version=10&cpu_core_num=12&device_memory=8&platform=PC&web_rid={}&room_id_str={}";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DY 直播信息 二类型
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const DY_LIVE_INFO_2 = "https://webcast.amemv.com/webcast/room/reflow/info/?type_id=0&live_id=1&sec_user_id=&version_code=99.99.99&app_id=1128&room_id={}";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* X API
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const TWITTER_TWEET_INFO = "https://api.twitter.com/2/tweets?ids={}";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* XHS 的请求链接
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const XHS_REQ_LINK = "https://www.xiaohongshu.com/explore/";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用解析的请求链接
|
* 通用解析的请求链接
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const GENERAL_REQ_LINK = {
|
export const GENERAL_REQ_LINK = {
|
||||||
link: "http://47.99.158.118/video-crack/v2/parse?content={}",
|
link: 'http://47.99.158.118/video-crack/v2/parse?content={}',
|
||||||
sign: 1
|
sign: 1,
|
||||||
};
|
};
|
||||||
export const GENERAL_REQ_LINK_2 = {
|
export const GENERAL_REQ_LINK_2 = {
|
||||||
link: "https://acid.jiuzige.com.cn/web/index/analysis?url={}",
|
link: 'https://acid.jiuzige.com.cn/web/index/analysis?url={}',
|
||||||
sign: 2
|
sign: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GENERAL_REQ_LINK_3 = {
|
export const GENERAL_REQ_LINK_3 = {
|
||||||
link: "https://picseed.com/v1/parser?auth_key=1E9DC25C-E75F-11EE-A0DD-0A5A298C6C2D&content={}",
|
link: 'https://picseed.com/v1/parser?auth_key=1E9DC25C-E75F-11EE-A0DD-0A5A298C6C2D&content={}',
|
||||||
sign: 3
|
sign: 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取网易云歌曲下载链接
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const NETEASE_SONG_DOWNLOAD = "https://neteasecloudmusicapi.vercel.app";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取网易云歌曲详情
|
|
||||||
* 致谢 NeteaseCloudMusicApi:https://gitlab.com/Binaryify/neteasecloudmusicapi
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const NETEASE_SONG_DETAIL = "https://neteasecloudmusicapi.vercel.app";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国内网易云服务,如果有大佬可以有闲置的服务器可以到群里赞助
|
|
||||||
* 致谢 NeteaseCloudMusicApi:https://gitlab.com/Binaryify/neteasecloudmusicapi
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const NETEASE_API_CN = 'http://118.89.80.17:3000';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载VIP的临时接口
|
|
||||||
* 备用:https://api.lolimi.cn/API/wydg/api.php?msg={}&n=1
|
|
||||||
* 备用2: http://kilz.top/api/wangyi_music.php?msg={}&n=1
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const NETEASE_TEMP_API = "https://www.hhlqilongzhu.cn/api/dg_wyymusic.php?gm={}&n=1&type=json";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载VIP的临时接口2
|
|
||||||
* 备用:https://www.hhlqilongzhu.cn/api/dg_qqmusic.php?gm={}&n=1&type=json
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const QQ_MUSIC_TEMP_API = "https://www.hhlqilongzhu.cn/api/dg_QQmusicflac.php?msg={}&n=1&type=json";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载VIP的临时接口3
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const QISHUI_MUSIC_TEMP_API = "https://api.cenguigui.cn/api/qishui/?msg={}&limit=1&type=json&n=1";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单条微博的接口
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const WEIBO_SINGLE_INFO = "https://m.weibo.cn/statuses/show?id={}";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 微视接口
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const WEISHI_VIDEO_INFO = "https://h5.weishi.qq.com/webapp/json/weishi/WSH5GetPlayPage?feedid={}";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 番剧搜索链接
|
* 番剧搜索链接
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const ANIME_SERIES_SEARCH_LINK = "https://ylu.cc/so.php?wd=";
|
export const ANIME_SERIES_SEARCH_LINK = 'https://ylu.cc/so.php?wd=';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 番剧搜索链接2
|
* 番剧搜索链接2
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const ANIME_SERIES_SEARCH_LINK2 = "https://yhdm.one/search?q=";
|
export const ANIME_SERIES_SEARCH_LINK2 = 'https://yhdm.one/search?q=';
|
||||||
|
|
||||||
/**
|
|
||||||
* HIBI API
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
export const HIBI_API_SERVICE = "http://0d00.us.kg:8080/api";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 临时 AI LLM爬虫
|
* 临时 AI LLM爬虫
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const PearAPI_CRAWLER = "https://api.pearktrue.cn/api/llmreader/?url={}&type=json";
|
export const PearAPI_CRAWLER = 'https://api.pearktrue.cn/api/llmreader/?url={}&type=json';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 临时 AI 总结
|
* 临时 AI 总结
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export const PearAPI_DEEPSEEK = "https://api.pearktrue.cn/api/deepseek/";
|
export const PearAPI_DEEPSEEK = 'https://api.pearktrue.cn/api/deepseek/';
|
||||||
|
|
||||||
/**
|
|
||||||
* TOOL_CALL 爬虫工具
|
|
||||||
* 用于Kimi模型Tool-Calling的爬虫工具
|
|
||||||
* 当Kimi模型判断需要从网页获取信息时,会调用此工具。
|
|
||||||
*/
|
|
||||||
export const CRAWL_TOOL = {
|
|
||||||
type: "function",
|
|
||||||
function: {
|
|
||||||
name: "crawl",
|
|
||||||
description: "根据网站地址(URL)获取网页内容。",
|
|
||||||
parameters: {
|
|
||||||
type: "object",
|
|
||||||
required: ["url"],
|
|
||||||
properties: {
|
|
||||||
url: {
|
|
||||||
type: "string",
|
|
||||||
description: "需要获取内容的网站地址(URL),通常情况下从搜索结果中可以获取网站的地址。"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
940
guoba.support.js
940
guoba.support.js
@ -1,480 +1,476 @@
|
|||||||
import _ from "lodash";
|
import _ from 'lodash';
|
||||||
import path from "path";
|
import path from 'path';
|
||||||
import { BILI_CDN_SELECT_LIST, BILI_DOWNLOAD_METHOD, BILI_RESOLUTION_LIST, YOUTUBE_GRAPHICS_LIST, NETEASECLOUD_QUALITY_LIST } from "./constants/constant.js";
|
import {
|
||||||
import { RESOLVE_CONTROLLER_NAME_ENUM } from "./constants/resolve.js";
|
BILI_CDN_SELECT_LIST,
|
||||||
import model from "./model/config.js";
|
BILI_DOWNLOAD_METHOD,
|
||||||
|
BILI_RESOLUTION_LIST,
|
||||||
|
NETEASECLOUD_QUALITY_LIST,
|
||||||
|
YOUTUBE_GRAPHICS_LIST,
|
||||||
|
} from './constants/constant.js';
|
||||||
|
import { RESOLVE_CONTROLLER_NAME_ENUM } from './constants/resolve.js';
|
||||||
|
import model from './model/config.js';
|
||||||
|
|
||||||
const pluginName = `rconsole-plugin`;
|
const pluginName = `rconsole-plugin`;
|
||||||
|
|
||||||
const _path = process.cwd() + `/plugins/${pluginName}`;
|
const _path = process.cwd() + `/plugins/${pluginName}`;
|
||||||
export function supportGuoba() {
|
export function supportGuoba() {
|
||||||
let globalWhitelist = Object.values(RESOLVE_CONTROLLER_NAME_ENUM).map(value => ({ value }));
|
let globalWhitelist = Object.values(RESOLVE_CONTROLLER_NAME_ENUM).map((value) => ({ value }));
|
||||||
const globalWhitelistComponent = globalWhitelist.length === 0 ? 'GTags' : 'Select'
|
const globalWhitelistComponent = globalWhitelist.length === 0 ? 'GTags' : 'Select';
|
||||||
return {
|
return {
|
||||||
pluginInfo: {
|
pluginInfo: {
|
||||||
name: "R插件",
|
name: 'R插件',
|
||||||
title: pluginName,
|
title: pluginName,
|
||||||
author: "@zhiyu",
|
author: '@zhiyu',
|
||||||
authorLink: "https://gitee.com/kyrzy0416",
|
authorLink: 'https://gitee.com/kyrzy0416',
|
||||||
link: "https://gitee.com/kyrzy0416/rconsole-plugin",
|
link: 'https://gitee.com/kyrzy0416/rconsole-plugin',
|
||||||
isV3: true,
|
isV3: true,
|
||||||
isV2: false,
|
isV2: false,
|
||||||
description: "专门为朋友们写的Yunzai-Bot插件,专注图片分享和生活的插件!",
|
description: '专门为朋友们写的Yunzai-Bot插件,专注图片分享和生活的插件!',
|
||||||
// 是否显示在左侧菜单,可选值:auto、true、false
|
// 是否显示在左侧菜单,可选值:auto、true、false
|
||||||
// 当为 auto 时,如果配置项大于等于 3 个,则显示在左侧菜单
|
// 当为 auto 时,如果配置项大于等于 3 个,则显示在左侧菜单
|
||||||
showInMenu: 'auto',
|
showInMenu: 'auto',
|
||||||
// 显示图标,此为个性化配置
|
// 显示图标,此为个性化配置
|
||||||
// 图标可在 https://icon-sets.iconify.design 这里进行搜索
|
// 图标可在 https://icon-sets.iconify.design 这里进行搜索
|
||||||
icon: 'mdi:stove',
|
icon: 'mdi:stove',
|
||||||
// 图标颜色,例:#FF0000 或 rgb(255, 0, 0)
|
// 图标颜色,例:#FF0000 或 rgb(255, 0, 0)
|
||||||
iconColor: '#d19f56',
|
iconColor: '#d19f56',
|
||||||
iconPath: path.join(_path, "resources/img/rank/logo.png"),
|
iconPath: path.join(_path, 'resources/img/rank/logo.png'),
|
||||||
|
},
|
||||||
|
configInfo: {
|
||||||
|
schemas: [
|
||||||
|
{
|
||||||
|
field: 'tools.globalBlackList',
|
||||||
|
label: '全局解析黑名单',
|
||||||
|
component: globalWhitelistComponent,
|
||||||
|
bottomHelpMessage: '添加后将全局禁用',
|
||||||
|
componentProps: {
|
||||||
|
allowAdd: true,
|
||||||
|
allowDel: true,
|
||||||
|
mode: 'multiple',
|
||||||
|
options: globalWhitelist,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
configInfo: {
|
{
|
||||||
schemas: [
|
field: 'globalImageLimit',
|
||||||
{
|
label: '解析图片是否合并转发',
|
||||||
field: 'tools.globalBlackList',
|
bottomHelpMessage:
|
||||||
label: '全局解析黑名单',
|
'超过配置的数字就会折叠。目前实现了此能的主要有米游社、b站动态专栏、微博、小红书',
|
||||||
component: globalWhitelistComponent,
|
component: 'InputNumber',
|
||||||
bottomHelpMessage: '添加后将全局禁用',
|
required: false,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
allowAdd: true,
|
placeholder: '请输入合并转发最大阈值',
|
||||||
allowDel: true,
|
},
|
||||||
mode: 'multiple',
|
|
||||||
options: globalWhitelist,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "globalImageLimit",
|
|
||||||
label: "解析图片是否合并转发",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"超过配置的数字就会折叠。目前实现了此能的主要有米游社、b站动态专栏、微博、小红书",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入合并转发最大阈值",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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.forceOverseasServer",
|
|
||||||
label: "强制使用海外服务器",
|
|
||||||
bottomHelpMessage: "设置为开启时,Twitter、TikTok等平台将强制不使用代理",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.identifyPrefix",
|
|
||||||
label: "识别前缀",
|
|
||||||
bottomHelpMessage: "识别前缀,比如你识别哔哩哔哩,那么就有:✅ 识别:哔哩哔哩",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入识别前缀",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.deeplApiUrls",
|
|
||||||
label: "DeeplX API地址集合",
|
|
||||||
bottomHelpMessage: "可以参考:https://github.com/OwO-Network/DeepLX,进行搭建,也可以使用内置",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入DeeplX API地址集合",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.streamDuration",
|
|
||||||
label: "解析直播时长",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"解析直播(目前涉及哔哩哔哩、抖音)时长,单位:秒(默认:10秒),建议时间为10~60,不然也没人看",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入最大解析直播时长",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.streamCompatibility",
|
|
||||||
label: "直播是否开启兼容模式",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"兼容模式,NCQQ不用开,其他ICQQ、LLO需要开启",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.defaultPath",
|
|
||||||
label: "视频暂存位置",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"视频暂存位置(如果你对你系统我的文件非常了解可以修改,不然不建议)",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入视频暂存位置",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.videoSizeLimit",
|
|
||||||
label: "视频大小限制",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"视频大小限制(单位MB),超过大小则转换成群文件上传",
|
|
||||||
component: "InputNumber",
|
|
||||||
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:
|
|
||||||
"超过时长无法解析(单位:秒),保护服务器性能,计算公式:8分钟 x 60秒 = 480秒",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入哔哩哔哩的视频最大限制时长(默认8分钟)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliIntroLenLimit",
|
|
||||||
label: "哔哩哔哩的简介长度限制",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"防止简介过长刷屏",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入哔哩哔哩的简介长度限制(默认50个字符),填 0 或者 -1 可以不做任何限制,显示完整简介",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliDisplayCover",
|
|
||||||
label: "是否显示封面",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认显示,哔哩哔哩是否显示封面",
|
|
||||||
component: "Switch",
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliDisplayInfo",
|
|
||||||
label: "是否显示相关信息",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认显示,哔哩哔哩是否显示相关信息(点赞、硬币、收藏、分享、播放数、弹幕数、评论数)",
|
|
||||||
component: "Switch",
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliDisplayIntro",
|
|
||||||
label: "是否显示简介",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认显示,哔哩哔哩是否显示简介",
|
|
||||||
component: "Switch",
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliDisplayOnline",
|
|
||||||
label: "是否显示在线人数",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认显示,哔哩哔哩是否显示在线人数",
|
|
||||||
component: "Switch",
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliDisplaySummary",
|
|
||||||
label: "是否显示总结",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认不显示,哔哩哔哩是否显示总结",
|
|
||||||
component: "Switch",
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliUseBBDown",
|
|
||||||
label: "BBDown接管下载",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"【默认不开启,涉及范围只有哔哩哔哩,开启后默认最高画质发送】如果不爱折腾就使用默认下载方式,如果喜欢折腾就开启,开启后下载更强劲,并且一劳永逸!",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliCDN",
|
|
||||||
label: "强制使用CDN",
|
|
||||||
bottomHelpMessage: "BBDown强制使用CDN:【只影响开启后的BBDown,一定程度可以影响BBDown速度】哔哩哔哩的CDN地址更换,如果不需要默认不使用,如果选择了其他的CDN将会使用",
|
|
||||||
component: "Select",
|
|
||||||
componentProps: {
|
|
||||||
options: BILI_CDN_SELECT_LIST,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliDownloadMethod",
|
|
||||||
label: "bili下载方式",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"哔哩哔哩的下载方式:默认使用原生稳定的下载方式,如果你在乎内存可以使用轻量的wget和axel下载方式,如果在乎性能可以使用Aria2下载",
|
|
||||||
component: "Select",
|
|
||||||
componentProps: {
|
|
||||||
options: BILI_DOWNLOAD_METHOD,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.biliResolution",
|
|
||||||
label: "bili最高分辨率",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"【开不开BBDown都同步】哔哩哔哩的最高分辨率,默认为480p,可以自行根据服务器进行调整",
|
|
||||||
component: "Select",
|
|
||||||
componentProps: {
|
|
||||||
options: BILI_RESOLUTION_LIST,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.youtubeDuration",
|
|
||||||
label: "油管最大解析时长",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"超过时长不解析(单位:秒),保护魔法的流量,计算公式:8分钟 x 60秒 = 480秒,默认8分钟,最好不超过30分钟",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入YouTuBe视频最大时长限制",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.youtubeClipTime",
|
|
||||||
label: "油管截取时长",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"超过时长会截取指定时间(单位:秒),保护魔法的流量,计算公式:3分钟 x 60秒 = 180秒,默认不开启,最好不超过5分钟,0表无限or不开启",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入截取时长",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.youtubeGraphicsOptions",
|
|
||||||
label: "油管最高分辨率",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"油管下载的最高分辨率(默认720p,请根据自己魔法流量和服务器承载能力进行调整)",
|
|
||||||
component: "Select",
|
|
||||||
componentProps: {
|
|
||||||
options: YOUTUBE_GRAPHICS_LIST,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.youtubeCookiePath",
|
|
||||||
label: "油管Cookie文件路径",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"【!重要:这里填写的是路径,例如/path/to/cookies.txt】如果无法解析油管就填写这个Cookie",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入Youtube Cookie所在的路径,例如:/path/to/cookies.txt",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.isSendVocal",
|
|
||||||
label: "网易云开启发送音频",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认开启,识别音乐之后是否转化群语音发送,关闭将获得一定的性能提升",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.useNeteaseSongRequest",
|
|
||||||
label: "开启网易云点歌功能",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认不开启,建议搭配自建网易云API使用,以获得最佳体验",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.songRequestMaxList",
|
|
||||||
label: "点歌列表长度",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"网易云点歌选择列表长度默认10",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "填入长度",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.useLocalNeteaseAPI",
|
|
||||||
label: "使用自建网易云API",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认不开启,有条件可以查看https://gitlab.com/Binaryify/neteasecloudmusicapi进行搭建",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.neteaseCloudAPIServer",
|
|
||||||
label: "自建网易云API地址",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"填入自建API地址,例:http://localhost:3000",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "填入自建API地址",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.neteaseCookie",
|
|
||||||
label: "网易云Cookie",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"可以发送 #RNQ / #rnq 快捷获取 或 者在网易云官网自己获取,格式为:MUSIC_U=xxx",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "使用vip账号登陆获取更高音质解析",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.neteaseCloudAudioQuality",
|
|
||||||
label: "网易云解析最高音质",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"网易云解析最高音质(目前仅针对自建最新API服务器生效!!需vip账号ck!!默认极高,杜比全景声由于编码特殊需要设备支持,更高请根据登陆的账号和服务器承载能力进行选择)",
|
|
||||||
component: "Select",
|
|
||||||
componentProps: {
|
|
||||||
options: NETEASECLOUD_QUALITY_LIST,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.douyinCookie",
|
|
||||||
label: "抖音的Cookie",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"登陆https://www.douyin.com/ - F12 - 自己替换一下:odin_tt=xxx;passport_fe_beating_status=xxx;sid_guard=xxx;uid_tt=xxx;uid_tt_ss=xxx;sid_tt=xxx;sessionid=xxx;sessionid_ss=xxx;sid_ucp_v1=xxx;ssid_ucp_v1=xxx;passport_assist_user=xxx;ttwid=xxx;",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入抖音的Cookie",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.douyinCompression",
|
|
||||||
label: "抖音是否使用压缩格式",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.douyinComments",
|
|
||||||
label: "抖音是否开启评论",
|
|
||||||
component: "Switch",
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.xiaohongshuCookie",
|
|
||||||
label: "小红书的Cookie",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"2024-8-2后反馈必须使用ck,不然无法解析",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入小红书的Cookie",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.queueConcurrency",
|
|
||||||
label: "(高级)队列长度",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"【目前只涉及哔哩哔哩的下载功能】允许队列下载个数:根据服务器性能设置可以并发下载的个数,如果你的服务器比较强劲,就选择4~12,较弱就一个一个下载,选择1",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "如果你的服务器比较强劲,就写4~12(比如4,就是可以4个人同时下载),较弱就一个一个下载,写1",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.videoDownloadConcurrency",
|
|
||||||
label: "(高级)下载并发个数",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"【涉及哔哩哔哩、抖音、YouTuBe、tiktok】下载并发个数:与【允许多用户下载个数】不同,这个功能影响下载速度。默认是1表示不使用,使用根据服务器性能进行选择,如果不确定是否可以用1即可,高性能服务器随意4~12都可以,看CPU的实力",
|
|
||||||
component: "InputNumber",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "不确定用1即可,高性能服务器随意4~12都可以,看CPU的实力",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.aiBaseURL",
|
|
||||||
label: "AI接口地址",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"支持Kimi、OpenAI、Claude等,例如官方的可以填写:https://api.moonshot.cn,如果是本机可以填写:http://localhost:8000",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入AI接口地址",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.aiApiKey",
|
|
||||||
label: "AI的key",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"服务商提供的api key,如果是官方的就是sk-....,如果是本机的就是ey...(推荐使用ey因为sk没有联网功能)",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入AI的key",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: "tools.aiModel",
|
|
||||||
label: "AI的模型",
|
|
||||||
bottomHelpMessage:
|
|
||||||
"默认使用的是moonshot-v1-8k,也可以自定义模型,只要能联网就能使用!",
|
|
||||||
component: "Input",
|
|
||||||
required: false,
|
|
||||||
componentProps: {
|
|
||||||
placeholder: "请输入AI的模型,例如:moonshot-v1-8k,使用kimi则不用填写",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
getConfigData() {
|
|
||||||
const toolsData = {
|
|
||||||
tools: model.getConfig("tools"),
|
|
||||||
};
|
|
||||||
return toolsData;
|
|
||||||
},
|
|
||||||
setConfigData(data, { Result }) {
|
|
||||||
let config = {};
|
|
||||||
let cfg = model.getConfig("tools");
|
|
||||||
for (let [key, value] of Object.entries(data)) {
|
|
||||||
// 特殊处理这个,需要全覆盖
|
|
||||||
if (key === "tools.globalBlackList") {
|
|
||||||
_.set(cfg, "globalBlackList", value);
|
|
||||||
}
|
|
||||||
_.set(config, key, value);
|
|
||||||
}
|
|
||||||
// 合并配置项
|
|
||||||
config = _.merge({}, cfg, config.tools);
|
|
||||||
// 保存
|
|
||||||
model.saveAllConfig("tools", config);
|
|
||||||
return Result.ok({}, "保存成功~");
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
{
|
||||||
|
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.forceOverseasServer',
|
||||||
|
label: '强制使用海外服务器',
|
||||||
|
bottomHelpMessage: '设置为开启时,Twitter、TikTok等平台将强制不使用代理',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.identifyPrefix',
|
||||||
|
label: '识别前缀',
|
||||||
|
bottomHelpMessage: '识别前缀,比如你识别哔哩哔哩,那么就有:✅ 识别:哔哩哔哩',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入识别前缀',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.deeplApiUrls',
|
||||||
|
label: 'DeeplX API地址集合',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'可以参考:https://github.com/OwO-Network/DeepLX,进行搭建,也可以使用内置',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入DeeplX API地址集合',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.streamDuration',
|
||||||
|
label: '解析直播时长',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'解析直播(目前涉及哔哩哔哩、抖音)时长,单位:秒(默认:10秒),建议时间为10~60,不然也没人看',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入最大解析直播时长',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.streamCompatibility',
|
||||||
|
label: '直播是否开启兼容模式',
|
||||||
|
bottomHelpMessage: '兼容模式,NCQQ不用开,其他ICQQ、LLO需要开启',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.defaultPath',
|
||||||
|
label: '视频暂存位置',
|
||||||
|
bottomHelpMessage: '视频暂存位置(如果你对你系统我的文件非常了解可以修改,不然不建议)',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入视频暂存位置',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.videoSizeLimit',
|
||||||
|
label: '视频大小限制',
|
||||||
|
bottomHelpMessage: '视频大小限制(单位MB),超过大小则转换成群文件上传',
|
||||||
|
component: 'InputNumber',
|
||||||
|
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:
|
||||||
|
'超过时长无法解析(单位:秒),保护服务器性能,计算公式:8分钟 x 60秒 = 480秒',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入哔哩哔哩的视频最大限制时长(默认8分钟)',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliIntroLenLimit',
|
||||||
|
label: '哔哩哔哩的简介长度限制',
|
||||||
|
bottomHelpMessage: '防止简介过长刷屏',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder:
|
||||||
|
'请输入哔哩哔哩的简介长度限制(默认50个字符),填 0 或者 -1 可以不做任何限制,显示完整简介',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliDisplayCover',
|
||||||
|
label: '是否显示封面',
|
||||||
|
bottomHelpMessage: '默认显示,哔哩哔哩是否显示封面',
|
||||||
|
component: 'Switch',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliDisplayInfo',
|
||||||
|
label: '是否显示相关信息',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'默认显示,哔哩哔哩是否显示相关信息(点赞、硬币、收藏、分享、播放数、弹幕数、评论数)',
|
||||||
|
component: 'Switch',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliDisplayIntro',
|
||||||
|
label: '是否显示简介',
|
||||||
|
bottomHelpMessage: '默认显示,哔哩哔哩是否显示简介',
|
||||||
|
component: 'Switch',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliDisplayOnline',
|
||||||
|
label: '是否显示在线人数',
|
||||||
|
bottomHelpMessage: '默认显示,哔哩哔哩是否显示在线人数',
|
||||||
|
component: 'Switch',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliDisplaySummary',
|
||||||
|
label: '是否显示总结',
|
||||||
|
bottomHelpMessage: '默认不显示,哔哩哔哩是否显示总结',
|
||||||
|
component: 'Switch',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliUseBBDown',
|
||||||
|
label: 'BBDown接管下载',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'【默认不开启,涉及范围只有哔哩哔哩,开启后默认最高画质发送】如果不爱折腾就使用默认下载方式,如果喜欢折腾就开启,开启后下载更强劲,并且一劳永逸!',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliCDN',
|
||||||
|
label: '强制使用CDN',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'BBDown强制使用CDN:【只影响开启后的BBDown,一定程度可以影响BBDown速度】哔哩哔哩的CDN地址更换,如果不需要默认不使用,如果选择了其他的CDN将会使用',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: BILI_CDN_SELECT_LIST,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliDownloadMethod',
|
||||||
|
label: 'bili下载方式',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'哔哩哔哩的下载方式:默认使用原生稳定的下载方式,如果你在乎内存可以使用轻量的wget和axel下载方式,如果在乎性能可以使用Aria2下载',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: BILI_DOWNLOAD_METHOD,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.biliResolution',
|
||||||
|
label: 'bili最高分辨率',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'【开不开BBDown都同步】哔哩哔哩的最高分辨率,默认为480p,可以自行根据服务器进行调整',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: BILI_RESOLUTION_LIST,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.youtubeDuration',
|
||||||
|
label: '油管最大解析时长',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'超过时长不解析(单位:秒),保护魔法的流量,计算公式:8分钟 x 60秒 = 480秒,默认8分钟,最好不超过30分钟',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入YouTuBe视频最大时长限制',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.youtubeClipTime',
|
||||||
|
label: '油管截取时长',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'超过时长会截取指定时间(单位:秒),保护魔法的流量,计算公式:3分钟 x 60秒 = 180秒,默认不开启,最好不超过5分钟,0表无限or不开启',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入截取时长',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.youtubeGraphicsOptions',
|
||||||
|
label: '油管最高分辨率',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'油管下载的最高分辨率(默认720p,请根据自己魔法流量和服务器承载能力进行调整)',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: YOUTUBE_GRAPHICS_LIST,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.youtubeCookiePath',
|
||||||
|
label: '油管Cookie文件路径',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'【!重要:这里填写的是路径,例如/path/to/cookies.txt】如果无法解析油管就填写这个Cookie',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入Youtube Cookie所在的路径,例如:/path/to/cookies.txt',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.isSendVocal',
|
||||||
|
label: '网易云开启发送音频',
|
||||||
|
bottomHelpMessage: '默认开启,识别音乐之后是否转化群语音发送,关闭将获得一定的性能提升',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.useNeteaseSongRequest',
|
||||||
|
label: '开启网易云点歌功能',
|
||||||
|
bottomHelpMessage: '默认不开启,建议搭配自建网易云API使用,以获得最佳体验',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.songRequestMaxList',
|
||||||
|
label: '点歌列表长度',
|
||||||
|
bottomHelpMessage: '网易云点歌选择列表长度默认10',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '填入长度',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.useLocalNeteaseAPI',
|
||||||
|
label: '使用自建网易云API',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'默认不开启,有条件可以查看https://gitlab.com/Binaryify/neteasecloudmusicapi进行搭建',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.neteaseCloudAPIServer',
|
||||||
|
label: '自建网易云API地址',
|
||||||
|
bottomHelpMessage: '填入自建API地址,例:http://localhost:3000',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '填入自建API地址',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.neteaseCookie',
|
||||||
|
label: '网易云Cookie',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'可以发送 #RNQ / #rnq 快捷获取 或 者在网易云官网自己获取,格式为:MUSIC_U=xxx',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '使用vip账号登陆获取更高音质解析',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.neteaseCloudAudioQuality',
|
||||||
|
label: '网易云解析最高音质',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'网易云解析最高音质(目前仅针对自建最新API服务器生效!!需vip账号ck!!默认极高,杜比全景声由于编码特殊需要设备支持,更高请根据登陆的账号和服务器承载能力进行选择)',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: NETEASECLOUD_QUALITY_LIST,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.douyinCookie',
|
||||||
|
label: '抖音的Cookie',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'登陆https://www.douyin.com/ - F12 - 自己替换一下:odin_tt=xxx;passport_fe_beating_status=xxx;sid_guard=xxx;uid_tt=xxx;uid_tt_ss=xxx;sid_tt=xxx;sessionid=xxx;sessionid_ss=xxx;sid_ucp_v1=xxx;ssid_ucp_v1=xxx;passport_assist_user=xxx;ttwid=xxx;',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入抖音的Cookie',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.douyinCompression',
|
||||||
|
label: '抖音是否使用压缩格式',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.douyinComments',
|
||||||
|
label: '抖音是否开启评论',
|
||||||
|
component: 'Switch',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.xiaohongshuCookie',
|
||||||
|
label: '小红书的Cookie',
|
||||||
|
bottomHelpMessage: '2024-8-2后反馈必须使用ck,不然无法解析',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入小红书的Cookie',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.queueConcurrency',
|
||||||
|
label: '(高级)队列长度',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'【目前只涉及哔哩哔哩的下载功能】允许队列下载个数:根据服务器性能设置可以并发下载的个数,如果你的服务器比较强劲,就选择4~12,较弱就一个一个下载,选择1',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder:
|
||||||
|
'如果你的服务器比较强劲,就写4~12(比如4,就是可以4个人同时下载),较弱就一个一个下载,写1',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.videoDownloadConcurrency',
|
||||||
|
label: '(高级)下载并发个数',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'【涉及哔哩哔哩、抖音、YouTuBe、tiktok】下载并发个数:与【允许多用户下载个数】不同,这个功能影响下载速度。默认是1表示不使用,使用根据服务器性能进行选择,如果不确定是否可以用1即可,高性能服务器随意4~12都可以,看CPU的实力',
|
||||||
|
component: 'InputNumber',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '不确定用1即可,高性能服务器随意4~12都可以,看CPU的实力',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.aiBaseURL',
|
||||||
|
label: 'AI接口地址',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'支持Kimi、OpenAI、Claude等,例如官方的可以填写:https://api.moonshot.cn,如果是本机可以填写:http://localhost:8000',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入AI接口地址',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.aiApiKey',
|
||||||
|
label: 'AI的key',
|
||||||
|
bottomHelpMessage:
|
||||||
|
'服务商提供的api key,如果是官方的就是sk-....,如果是本机的就是ey...(推荐使用ey因为sk没有联网功能)',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入AI的key',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tools.aiModel',
|
||||||
|
label: 'AI的模型',
|
||||||
|
bottomHelpMessage: '默认使用的是moonshot-v1-8k,也可以自定义模型,只要能联网就能使用!',
|
||||||
|
component: 'Input',
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入AI的模型,例如:moonshot-v1-8k,使用kimi则不用填写',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
getConfigData() {
|
||||||
|
const toolsData = {
|
||||||
|
tools: model.getConfig('RCtools'),
|
||||||
|
};
|
||||||
|
return toolsData;
|
||||||
|
},
|
||||||
|
setConfigData(data, { Result }) {
|
||||||
|
let config = {};
|
||||||
|
let cfg = model.getConfig('RCtools');
|
||||||
|
for (let [key, value] of Object.entries(data)) {
|
||||||
|
// 特殊处理这个,需要全覆盖
|
||||||
|
if (key === 'tools.globalBlackList') {
|
||||||
|
_.set(cfg, 'globalBlackList', value);
|
||||||
|
}
|
||||||
|
_.set(config, key, value);
|
||||||
|
}
|
||||||
|
// 合并配置项
|
||||||
|
config = _.merge({}, cfg, config.tools);
|
||||||
|
// 保存
|
||||||
|
model.saveAllConfig('RCtools', config);
|
||||||
|
return Result.ok({}, '保存成功~');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
39
index.js
39
index.js
@ -1,39 +1,44 @@
|
|||||||
import fs from "node:fs";
|
import fs from 'node:fs';
|
||||||
import path from "path";
|
import path from 'path';
|
||||||
import config from "./model/config.js";
|
import config from './model/config.js';
|
||||||
|
|
||||||
if (!global.segment) {
|
if (!global.segment) {
|
||||||
global.segment = (await import("oicq")).segment
|
global.segment = (await import('oicq')).segment;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载版本号
|
// 加载版本号
|
||||||
const versionData = config.getConfig("version");
|
const versionData = config.getConfig('version');
|
||||||
// 加载名称
|
// 加载名称
|
||||||
const packageJsonPath = path.join('./plugins', 'rconsole-plugin', 'package.json');
|
const packageJsonPath = path.join('./plugins', 'rc-plugin', 'package.json');
|
||||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||||
const pluginName = packageJson.name;
|
const pluginName = packageJson.name;
|
||||||
// 初始化输出
|
// 初始化输出
|
||||||
logger.info(logger.yellow(`R插件${versionData[0].version}初始化,欢迎加入【R插件和它的朋友们】秋秋群:575663150`));
|
logger.info(
|
||||||
|
logger.yellow(
|
||||||
|
`R插件${versionData[0].version}初始化,欢迎加入【R插件和它的朋友们】秋秋群:575663150`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const files = fs.readdirSync(`./plugins/${pluginName}/apps`).filter(file => file.endsWith(".js"));
|
const files = fs.readdirSync(`./plugins/${pluginName}/apps`).filter((file) => file.endsWith('.js'));
|
||||||
|
|
||||||
let ret = [];
|
let ret = [];
|
||||||
|
|
||||||
files.forEach(file => {
|
files.forEach((file) => {
|
||||||
ret.push(import(`./apps/${file}`));
|
ret.push(import(`./apps/${file}`));
|
||||||
});
|
});
|
||||||
|
|
||||||
ret = await Promise.allSettled(ret);
|
ret = await Promise.allSettled(ret);
|
||||||
|
|
||||||
let apps = {};
|
let apps = {};
|
||||||
for (let i in files) {
|
for (let i in files) {
|
||||||
let name = files[i].replace(".js", "");
|
let name = files[i].replace('.js', '');
|
||||||
|
|
||||||
if (ret[i].status !== "fulfilled") {
|
if (ret[i].status !== 'fulfilled') {
|
||||||
logger.error(`[rc-plugin] 载入插件错误:${logger.red(name)}`);
|
logger.error(`[rc-plugin] 载入插件错误:${logger.red(name)}`);
|
||||||
logger.error(ret[i].reason);
|
logger.error(ret[i].reason);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
apps[name] = ret[i].value[Object.keys(ret[i].value)[0]];
|
apps[name] = ret[i].value[Object.keys(ret[i].value)[0]];
|
||||||
}
|
}
|
||||||
|
|
||||||
export { apps };
|
export { apps };
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from "fs";
|
import fs from 'fs';
|
||||||
|
|
||||||
export default class Base {
|
export default class Base {
|
||||||
static pluginName = (() => {
|
static pluginName = (() => {
|
||||||
const packageJsonPath = path.join('./plugins', 'rconsole-plugin', 'package.json');
|
const packageJsonPath = path.join('./plugins', 'rc-plugin', 'package.json');
|
||||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||||
return packageJson.name;
|
return packageJson.name;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
constructor (e = {}) {
|
constructor(e = {}) {
|
||||||
this.e = e
|
this.e = e;
|
||||||
this.userId = e?.user_id
|
this.userId = e?.user_id;
|
||||||
this.model = Base.pluginName
|
this.model = Base.pluginName;
|
||||||
this._path = process.cwd().replace(/\\/g, '/')
|
this._path = process.cwd().replace(/\\/g, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
get prefix () {
|
get prefix() {
|
||||||
return `Yz:${Base.pluginName}:${this.model}:`
|
return `Yz:${Base.pluginName}:${this.model}:`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,12 +25,12 @@ export default class Base {
|
|||||||
* @param tplFile 模板html路径
|
* @param tplFile 模板html路径
|
||||||
* @param pluResPath 插件资源路径
|
* @param pluResPath 插件资源路径
|
||||||
*/
|
*/
|
||||||
get screenData () {
|
get screenData() {
|
||||||
return {
|
return {
|
||||||
saveId: this.userId,
|
saveId: this.userId,
|
||||||
tplFile: `./plugins/${Base.pluginName}/resources/html/${this.model}/${this.model}.html`,
|
tplFile: `./plugins/${Base.pluginName}/resources/html/${this.model}/${this.model}.html`,
|
||||||
/** 绝对路径 */
|
/** 绝对路径 */
|
||||||
pluResPath: `${this._path}/plugins/${Base.pluginName}/resources/`
|
pluResPath: `${this._path}/plugins/${Base.pluginName}/resources/`,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
package.json
11
package.json
@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "rconsole-plugin",
|
"name": "rc-plugin",
|
||||||
"description": "R-Plugin",
|
"description": "rebuild-ver",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
"form-data": "^4.0.1",
|
"form-data": "^4.0.1",
|
||||||
"node-id3": "^0.2.6",
|
"node-id3": "^0.2.6",
|
||||||
"qrcode": "^1.5.3",
|
"p-queue": "^8.0.1",
|
||||||
"p-queue": "^8.0.1"
|
"qrcode": "^1.5.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "^3.6.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,23 +0,0 @@
|
|||||||
export function formatTime(timestamp) {
|
|
||||||
const totalSeconds = Math.floor(timestamp / 1000); // 转换为秒
|
|
||||||
const minutes = Math.floor(totalSeconds / 60); // 分钟
|
|
||||||
const seconds = totalSeconds % 60; // 秒钟
|
|
||||||
|
|
||||||
// 补零格式化
|
|
||||||
const formattedMinutes = String(minutes).padStart(2, '0');
|
|
||||||
const formattedSeconds = String(seconds).padStart(2, '0');
|
|
||||||
|
|
||||||
return `${formattedMinutes}:${formattedSeconds}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function toGBorTB(Bytes) {
|
|
||||||
const GB = 1024 ** 3;
|
|
||||||
let sizeInGB = Bytes / GB;
|
|
||||||
let unit = "GB";
|
|
||||||
if (sizeInGB > 1024) {
|
|
||||||
sizeInGB /= 1024;
|
|
||||||
unit = "TB";
|
|
||||||
}
|
|
||||||
sizeInGB = sizeInGB % 1 === 0 ? sizeInGB.toString() : sizeInGB.toFixed(2);
|
|
||||||
return sizeInGB + unit;
|
|
||||||
}
|
|
@ -50,39 +50,4 @@ export async function redisExistAndGetKey(key) {
|
|||||||
return redisGetKey(key);
|
return redisGetKey(key);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 在某个 key 的末尾插入一个对象
|
|
||||||
* @param key
|
|
||||||
* @param obj
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
* @example
|
|
||||||
* await redisExistAndInsertObject('myKey', { newKey: 'newValue' });
|
|
||||||
*/
|
|
||||||
export async function redisExistAndInsertObject(key, obj) {
|
|
||||||
let objs = await redisExistAndGetKey(key);
|
|
||||||
if (objs) {
|
|
||||||
objs = { ...objs, ...obj };
|
|
||||||
await redisSetKey(key, objs);
|
|
||||||
} else {
|
|
||||||
await redisSetKey(key, obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新Redis中某个对象的值
|
|
||||||
* @param key
|
|
||||||
* @param updateKey
|
|
||||||
* @param updateObj
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
* @example
|
|
||||||
* await redisExistAndUpdateObject('myKey', 'updateKey', { foo: 'bar' });
|
|
||||||
*/
|
|
||||||
export async function redisExistAndUpdateObject(key, updateKey, updateObj) {
|
|
||||||
let objs = await redisExistAndGetKey(key);
|
|
||||||
if (Object.keys(objs).includes(updateKey)) {
|
|
||||||
objs[updateKey] = updateObj;
|
|
||||||
await redisSetKey(key, objs);
|
|
||||||
}
|
|
||||||
}
|
|
@ -55,28 +55,3 @@ export async function saveTDL(url, isOversea, proxyAddr) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传文件到飞机收藏夹
|
|
||||||
* @param filePath
|
|
||||||
* @param isOversea
|
|
||||||
* @param proxyAddr
|
|
||||||
* @returns {Promise<void>}
|
|
||||||
*/
|
|
||||||
export async function uploadTDL(filePath, isOversea, proxyAddr) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const proxyStr = isOversea ? `` : `--proxy ${ proxyAddr }`;
|
|
||||||
const command = `tdl up -p ${ filePath } ${ proxyStr }`;
|
|
||||||
exec(command, (error, stdout, stderr) => {
|
|
||||||
if (error) {
|
|
||||||
reject(`[R插件][TDL上传]执行出错: ${ error.message }`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (stderr) {
|
|
||||||
reject(`[R插件][TDL上传]错误信息: ${ stderr }`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resolve(stdout);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { exec } from "child_process";
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建梯子参数
|
* 构建梯子参数
|
||||||
@ -7,7 +7,7 @@ import { exec } from "child_process";
|
|||||||
* @returns {string|string}
|
* @returns {string|string}
|
||||||
*/
|
*/
|
||||||
function constructProxyParam(isOversea, proxy) {
|
function constructProxyParam(isOversea, proxy) {
|
||||||
return isOversea ? "" : `--proxy ${proxy}`;
|
return isOversea ? '' : `--proxy ${proxy}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,7 +18,7 @@ function constructProxyParam(isOversea, proxy) {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function constructCookiePath(url, cookiePath) {
|
function constructCookiePath(url, cookiePath) {
|
||||||
return (cookiePath !== "" && url.includes("youtu")) ? `--cookies ${ cookiePath }` : "";
|
return cookiePath !== '' && url.includes('youtu') ? `--cookies ${cookiePath}` : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,10 +27,9 @@ function constructCookiePath(url, cookiePath) {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function constructEncodingParam(url) {
|
function constructEncodingParam(url) {
|
||||||
return "--encoding UTF-8"; // 始终为标题获取使用 UTF-8 编码
|
return '--encoding UTF-8'; // 始终为标题获取使用 UTF-8 编码
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取时长
|
* 获取时长
|
||||||
* @param url
|
* @param url
|
||||||
@ -39,20 +38,22 @@ function constructEncodingParam(url) {
|
|||||||
* @param cookiePath
|
* @param cookiePath
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
export function ytDlpGetDuration(url, isOversea, proxy, cookiePath = "") {
|
export function ytDlpGetDuration(url, isOversea, proxy, cookiePath = '') {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// 构造 cookie 参数
|
// 构造 cookie 参数
|
||||||
const cookieParam = constructCookiePath(url, cookiePath);
|
const cookieParam = constructCookiePath(url, cookiePath);
|
||||||
const command = `yt-dlp --get-duration --skip-download ${cookieParam} ${constructProxyParam(isOversea, proxy)} "${url}"`;
|
const command = `yt-dlp --get-duration --skip-download ${cookieParam} ${constructProxyParam(isOversea, proxy)} "${url}"`;
|
||||||
exec(command, (error, stdout, stderr) => {
|
exec(command, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
logger.error(`[R插件][yt-dlp审计] Error executing ytDlpGetDuration: ${error}. Stderr: ${stderr}`);
|
logger.error(
|
||||||
reject(error);
|
`[R插件][yt-dlp审计] Error executing ytDlpGetDuration: ${error}. Stderr: ${stderr}`
|
||||||
} else {
|
);
|
||||||
resolve(stdout.trim());
|
reject(error);
|
||||||
}
|
} else {
|
||||||
});
|
resolve(stdout.trim());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,22 +64,24 @@ export function ytDlpGetDuration(url, isOversea, proxy, cookiePath = "") {
|
|||||||
* @param cookiePath
|
* @param cookiePath
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
export function ytDlpGetTilt(url, isOversea, proxy, cookiePath = "") {
|
export async function ytDlpGetTilt(url, isOversea, proxy, cookiePath = '') {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// 构造 cookie 参数
|
// 构造 cookie 参数
|
||||||
const cookieParam = constructCookiePath(url, cookiePath);
|
const cookieParam = constructCookiePath(url, cookiePath);
|
||||||
// 构造 编码 参数
|
// 构造 编码 参数
|
||||||
const encodingParam = constructEncodingParam(url);
|
const encodingParam = constructEncodingParam(url);
|
||||||
const command = `yt-dlp --get-title --skip-download ${cookieParam} ${ constructProxyParam(isOversea, proxy) } "${url}" ${encodingParam}`;
|
const command = `yt-dlp --get-title --skip-download ${cookieParam} ${constructProxyParam(isOversea, proxy)} "${url}" ${encodingParam}`;
|
||||||
exec(command, (error, stdout, stderr) => {
|
exec(command, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
logger.error(`[R插件][yt-dlp审计] Error executing ytDlpGetTilt: ${error}. Stderr: ${stderr}`);
|
logger.error(
|
||||||
reject(error);
|
`[R插件][yt-dlp审计] Error executing ytDlpGetTilt: ${error}. Stderr: ${stderr}`
|
||||||
} else {
|
);
|
||||||
resolve(stdout.trim());
|
reject(error);
|
||||||
}
|
} else {
|
||||||
});
|
resolve(stdout.trim());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,34 +93,45 @@ export function ytDlpGetTilt(url, isOversea, proxy, cookiePath = "") {
|
|||||||
* @param cookiePath
|
* @param cookiePath
|
||||||
* @param thumbnailFilenamePrefix 缩略图文件名前缀 (不含扩展名)
|
* @param thumbnailFilenamePrefix 缩略图文件名前缀 (不含扩展名)
|
||||||
*/
|
*/
|
||||||
export function ytDlpGetThumbnail(path, url, isOversea, proxy, cookiePath = "", thumbnailFilenamePrefix = "thumbnail") {
|
export function ytDlpGetThumbnail(
|
||||||
return new Promise((resolve, reject) => {
|
path,
|
||||||
const cookieParam = constructCookiePath(url, cookiePath);
|
url,
|
||||||
const finalThumbnailName = thumbnailFilenamePrefix || "thumbnail";
|
isOversea,
|
||||||
const command = `yt-dlp --write-thumbnail --convert-thumbnails png --skip-download ${cookieParam} ${constructProxyParam(isOversea, proxy)} "${url}" -P "${path}" -o "${finalThumbnailName}.%(ext)s"`;
|
proxy,
|
||||||
|
cookiePath = '',
|
||||||
|
thumbnailFilenamePrefix = 'thumbnail'
|
||||||
|
) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const cookieParam = constructCookiePath(url, cookiePath);
|
||||||
|
const finalThumbnailName = thumbnailFilenamePrefix || 'thumbnail';
|
||||||
|
const command = `yt-dlp --write-thumbnail --convert-thumbnails png --skip-download ${cookieParam} ${constructProxyParam(isOversea, proxy)} "${url}" -P "${path}" -o "${finalThumbnailName}.%(ext)s"`;
|
||||||
|
|
||||||
exec(command, (error, stdout, stderr) => {
|
exec(command, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
logger.error(`[R插件][yt-dlp审计] Error executing ytDlpGetThumbnail: ${error}. Stderr: ${stderr}`);
|
logger.error(
|
||||||
return reject(error);
|
`[R插件][yt-dlp审计] Error executing ytDlpGetThumbnail: ${error}. Stderr: ${stderr}`
|
||||||
}
|
);
|
||||||
// 从yt-dlp的输出中提取文件名
|
return reject(error);
|
||||||
const match = stdout.match(/Writing thumbnail to: (.*)/);
|
}
|
||||||
if (match && match[1]) {
|
// 从yt-dlp的输出中提取文件名
|
||||||
const thumbnailPath = match[1].trim();
|
const match = stdout.match(/Writing thumbnail to: (.*)/);
|
||||||
// 只返回文件名部分
|
if (match && match[1]) {
|
||||||
const thumbnailFilename = thumbnailPath.split(/[\\/]/).pop();
|
const thumbnailPath = match[1].trim();
|
||||||
logger.info(`[R插件][yt-dlp审计] Thumbnail downloaded: ${thumbnailFilename}`);
|
// 只返回文件名部分
|
||||||
resolve(thumbnailFilename);
|
const thumbnailFilename = thumbnailPath.split(/[\\/]/).pop();
|
||||||
} else {
|
logger.info(`[R插件][yt-dlp审计] Thumbnail downloaded: ${thumbnailFilename}`);
|
||||||
// 兜底方案:如果无法从输出中解析,则按原逻辑拼接
|
resolve(thumbnailFilename);
|
||||||
logger.warn("[R插件][yt-dlp审计] Could not parse thumbnail filename from stdout. Falling back to default.");
|
} else {
|
||||||
// 尝试查找文件,因为yt-dlp可能没有输出我们期望的格式
|
// 兜底方案:如果无法从输出中解析,则按原逻辑拼接
|
||||||
const expectedPngPath = `${finalThumbnailName}.png`;
|
logger.warn(
|
||||||
resolve(expectedPngPath);
|
'[R插件][yt-dlp审计] Could not parse thumbnail filename from stdout. Falling back to default.'
|
||||||
}
|
);
|
||||||
});
|
// 尝试查找文件,因为yt-dlp可能没有输出我们期望的格式
|
||||||
|
const expectedPngPath = `${finalThumbnailName}.png`;
|
||||||
|
resolve(expectedPngPath);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -134,34 +148,47 @@ export function ytDlpGetThumbnail(path, url, isOversea, proxy, cookiePath = "",
|
|||||||
* @param outputFilename 输出文件名 (不含扩展名)
|
* @param outputFilename 输出文件名 (不含扩展名)
|
||||||
* @param cookiePath Cookie所在位置
|
* @param cookiePath Cookie所在位置
|
||||||
*/
|
*/
|
||||||
export async function ytDlpHelper(path, url, isOversea, proxy, maxThreads, outputFilename, merge = false, graphics, timeRange, cookiePath = "") {
|
export async function ytDlpHelper(
|
||||||
return new Promise((resolve, reject) => {
|
path,
|
||||||
let command = "";
|
url,
|
||||||
// 构造 cookie 参数
|
isOversea,
|
||||||
const cookieParam = constructCookiePath(url, cookiePath);
|
proxy,
|
||||||
// 确保 outputFilename 不为空,提供一个默认值以防万一
|
maxThreads,
|
||||||
const finalOutputFilename = outputFilename || "temp_download";
|
outputFilename,
|
||||||
|
merge = false,
|
||||||
|
graphics,
|
||||||
|
timeRange,
|
||||||
|
cookiePath = ''
|
||||||
|
) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let command = '';
|
||||||
|
// 构造 cookie 参数
|
||||||
|
const cookieParam = constructCookiePath(url, cookiePath);
|
||||||
|
// 确保 outputFilename 不为空,提供一个默认值以防万一
|
||||||
|
const finalOutputFilename = outputFilename || 'temp_download';
|
||||||
|
|
||||||
if (url.includes("music")) {
|
if (url.includes('music')) {
|
||||||
// 这里是 YouTube Music的处理逻辑
|
// 这里是 YouTube Music的处理逻辑
|
||||||
// e.g yt-dlp -x --audio-format mp3 https://youtu.be/5wEtefq9VzM -o test.mp3
|
// e.g yt-dlp -x --audio-format mp3 https://youtu.be/5wEtefq9VzM -o test.mp3
|
||||||
command = `yt-dlp -x --audio-format flac -f ba ${cookieParam} ${constructProxyParam(isOversea, proxy)} -P "${path}" -o "${finalOutputFilename}.flac" "${url}"`;
|
command = `yt-dlp -x --audio-format flac -f ba ${cookieParam} ${constructProxyParam(isOversea, proxy)} -P "${path}" -o "${finalOutputFilename}.flac" "${url}"`;
|
||||||
} else {
|
} else {
|
||||||
// 正常情况下的处理逻辑
|
// 正常情况下的处理逻辑
|
||||||
const fParam = url.includes("youtu") ? `--download-sections "*${timeRange}" -f "bv${graphics}[ext=mp4]+ba[ext=m4a]" ` : "";
|
const fParam = url.includes('youtu')
|
||||||
|
? `--download-sections "*${timeRange}" -f "bv${graphics}[ext=mp4]+ba[ext=m4a]" `
|
||||||
|
: '';
|
||||||
|
|
||||||
command = `yt-dlp -N ${maxThreads} ${fParam} --concurrent-fragments ${maxThreads} ${cookieParam} ${constructProxyParam(isOversea, proxy)} -P "${path}" -o "${finalOutputFilename}.%(ext)s" "${url}"`;
|
command = `yt-dlp -N ${maxThreads} ${fParam} --concurrent-fragments ${maxThreads} ${cookieParam} ${constructProxyParam(isOversea, proxy)} -P "${path}" -o "${finalOutputFilename}.%(ext)s" "${url}"`;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(`[R插件][yt-dlp审计] ${command}`);
|
logger.info(`[R插件][yt-dlp审计] ${command}`);
|
||||||
|
|
||||||
exec(command, (error, stdout) => {
|
exec(command, (error, stdout) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
logger.error(`[R插件][yt-dlp审计] 执行命令时出错: ${error}`);
|
logger.error(`[R插件][yt-dlp审计] 执行命令时出错: ${error}`);
|
||||||
reject(error);
|
reject(error);
|
||||||
} else {
|
} else {
|
||||||
resolve(stdout);
|
resolve(stdout);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user