koishi-plugin-video-parser-all 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +19 -19
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -14,26 +14,26 @@ const promises_1 = require("stream/promises");
|
|
|
14
14
|
const worker_threads_1 = require("worker_threads");
|
|
15
15
|
exports.name = 'video-parser-all';
|
|
16
16
|
exports.Config = koishi_1.Schema.object({
|
|
17
|
-
enable: koishi_1.Schema.boolean().default(true),
|
|
18
|
-
showWaitingTip: koishi_1.Schema.boolean().default(true),
|
|
19
|
-
waitingTipText: koishi_1.Schema.string().default('正在解析视频,请稍候...'),
|
|
20
|
-
sameLinkInterval: koishi_1.Schema.number().default(180).min(0),
|
|
21
|
-
imageParseFormat: koishi_1.Schema.string().role('textarea').default('${标题}\n${UP主}'),
|
|
17
|
+
enable: koishi_1.Schema.boolean().default(true).description('【基础设置】启用插件'),
|
|
18
|
+
showWaitingTip: koishi_1.Schema.boolean().default(true).description('【基础设置】解析时显示等待提示'),
|
|
19
|
+
waitingTipText: koishi_1.Schema.string().default('正在解析视频,请稍候...').description('【基础设置】解析等待时发送的提示文本'),
|
|
20
|
+
sameLinkInterval: koishi_1.Schema.number().default(180).min(0).description('【基础设置】重复解析间隔:相同链接的最小解析间隔,防止重复解析(秒)'),
|
|
21
|
+
imageParseFormat: koishi_1.Schema.string().role('textarea').default('${标题}\n${UP主}').description('【格式设置】解析结果格式:解析结果的文本格式\n支持变量:${标题} ${UP主} ${简介} ${tab}(制表符) ${~~~}(换行)'),
|
|
22
22
|
returnContent: koishi_1.Schema.object({
|
|
23
|
-
showImageText: koishi_1.Schema.boolean().default(true),
|
|
24
|
-
showVideoUrl: koishi_1.Schema.boolean().default(false),
|
|
25
|
-
showVideoFile: koishi_1.Schema.boolean().default(true),
|
|
26
|
-
}),
|
|
27
|
-
maxDescLength: koishi_1.Schema.number().default(200),
|
|
28
|
-
timeout: koishi_1.Schema.number().default(180000).min(0),
|
|
29
|
-
ignoreSendError: koishi_1.Schema.boolean().default(true),
|
|
30
|
-
enableForward: koishi_1.Schema.boolean().default(false),
|
|
31
|
-
downloadVideoBeforeSend: koishi_1.Schema.boolean().default(false),
|
|
32
|
-
messageBufferDelay: koishi_1.Schema.number().default(0).min(0),
|
|
33
|
-
retryTimes: koishi_1.Schema.number().default(0).min(0),
|
|
34
|
-
retryInterval: koishi_1.Schema.number().default(0).min(0),
|
|
35
|
-
videoSendTimeout: koishi_1.Schema.number().default(0).min(0),
|
|
36
|
-
autoClearCacheInterval: koishi_1.Schema.number().default(60).min(0),
|
|
23
|
+
showImageText: koishi_1.Schema.boolean().default(true).description('【返回内容】显示文本与封面:是否显示解析后的文本和封面图'),
|
|
24
|
+
showVideoUrl: koishi_1.Schema.boolean().default(false).description('【返回内容】显示无水印链接:是否显示无水印视频的直链'),
|
|
25
|
+
showVideoFile: koishi_1.Schema.boolean().default(true).description('【返回内容】发送视频文件:是否发送视频文件(关闭则仅显示链接)'),
|
|
26
|
+
}).description('【返回内容设置】控制解析结果的返回内容'),
|
|
27
|
+
maxDescLength: koishi_1.Schema.number().default(200).description('【内容限制】简介最大长度:内容简介的最大字符长度,超出部分会被截断'),
|
|
28
|
+
timeout: koishi_1.Schema.number().default(180000).min(0).description('【网络设置】API请求超时:API请求的超时时间(毫秒),0表示不限制'),
|
|
29
|
+
ignoreSendError: koishi_1.Schema.boolean().default(true).description('【容错设置】忽略发送错误:忽略消息发送失败的错误,避免插件崩溃'),
|
|
30
|
+
enableForward: koishi_1.Schema.boolean().default(false).description('【展示设置】启用合并转发:启用OneBot平台的合并转发功能,优化多内容展示'),
|
|
31
|
+
downloadVideoBeforeSend: koishi_1.Schema.boolean().default(false).description('【展示设置】发送前下载视频:发送前先下载视频到本地,再发送文件(仅OneBot)'),
|
|
32
|
+
messageBufferDelay: koishi_1.Schema.number().default(0).min(0).description('【性能设置】消息缓冲延迟:消息缓冲延迟,合并短时间内的多个解析请求(秒)'),
|
|
33
|
+
retryTimes: koishi_1.Schema.number().default(0).min(0).description('【容错设置】接口重试次数:API解析失败时的重试次数,0表示不重试'),
|
|
34
|
+
retryInterval: koishi_1.Schema.number().default(0).min(0).description('【容错设置】重试间隔:每次重试的间隔时间(毫秒)'),
|
|
35
|
+
videoSendTimeout: koishi_1.Schema.number().default(0).min(0).description('【网络设置】视频发送超时:视频消息发送的超时时间(毫秒),0表示不限制'),
|
|
36
|
+
autoClearCacheInterval: koishi_1.Schema.number().default(60).min(0).description('【缓存设置】自动清理缓存间隔:自动清理解析缓存和临时视频文件的间隔(分钟),0表示不自动清理'),
|
|
37
37
|
});
|
|
38
38
|
if (!worker_threads_1.isMainThread) {
|
|
39
39
|
const { url, filePath } = worker_threads_1.workerData;
|
package/package.json
CHANGED