koishi-plugin-video-parser-all 1.0.1 → 1.0.2
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 +6 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
29
29
|
videoDownloadTimeout: koishi_1.Schema.number().default(120000).description('视频下载超时(毫秒)'),
|
|
30
30
|
tempDir: koishi_1.Schema.string().default('./temp_videos').description('临时视频存储目录'),
|
|
31
31
|
maxVideoSize: koishi_1.Schema.number().min(0).step(1).default(0).description('最大下载视频大小(MB),0 为不限制大小'),
|
|
32
|
-
forceDownloadVideo: koishi_1.Schema.boolean().default(true).description('
|
|
32
|
+
forceDownloadVideo: koishi_1.Schema.boolean().default(true).description('强制下载视频后发送(解决B站、小红书等平台URL无法直接发送的问题)'),
|
|
33
33
|
}).description('内容显示设置'),
|
|
34
34
|
koishi_1.Schema.object({
|
|
35
35
|
timeout: koishi_1.Schema.number().min(0).default(180000).description('API 请求超时(毫秒)'),
|
|
@@ -668,6 +668,11 @@ function apply(ctx, config) {
|
|
|
668
668
|
ctx.on('message', async (session) => {
|
|
669
669
|
if (!config.enable)
|
|
670
670
|
return;
|
|
671
|
+
// 修复:使用正确的小写subtype属性名
|
|
672
|
+
if (session.subtype === 'file_upload')
|
|
673
|
+
return;
|
|
674
|
+
if (session.elements?.some(elem => elem.type === 'file' || elem.type === 'folder'))
|
|
675
|
+
return;
|
|
671
676
|
const urls = extractAllUrlsFromMessage(session);
|
|
672
677
|
if (!urls.length)
|
|
673
678
|
return;
|
package/package.json
CHANGED