zhiyu1998 / nonebot-plugin-resolver

适用于nonebot2 链接分享解析视频、图片链接/小程序插件,tiktok、bilibili、twitter等实时发送!
https://registry.nonebot.dev/plugin/nonebot-plugin-resolver:nonebot-plugin-resolver
Mulan Permissive Software License, Version 2
45 stars 9 forks source link

[Bug]: B站视频无法下载 #12

Closed enKl03B closed 2 weeks ago

enKl03B commented 3 weeks ago

这个问题是否已经存在?

如何复现

使用docker方式部署的napcat 用户发送B站链接后,不能发送视频,后台发现是视频下载失败

预期结果

No response

实际结果

错误代码:

10-03 04:42:09 [INFO] nonebot-plugin-resolver | ==================480
10-03 04:42:11 [INFO] nonebot-plugin-resolver | 0
326504
10-03 04:42:11 [INFO] nonebot-plugin-resolver | 下载进度:0.048
10-03 04:42:12 [INFO] nonebot-plugin-resolver | 下载进度:0.098
10-03 04:42:12 [INFO] nonebot-plugin-resolver | 下载进度:0.149
10-03 04:42:12 [INFO] nonebot-plugin-resolver | 下载进度:0.19
.
.
.
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.951
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.958
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.965
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.972
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.979
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.986
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:0.994
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 下载进度:1.0
10-03 04:42:14 [INFO] nonebot-plugin-resolver | 正在合并:['/home/lxm/桌面/Bot/nb01/nb01/BV1vGxtefEka-res.mp4']
10-03 04:42:15 [INFO] nonebot-plugin-resolver | {'BV1vGxtefEka-video.m4s': 'remove', 'BV1vGxtefEka-audio.m4s': 'remove'}
10-03 04:42:15 [ERROR] nonebot-plugin-resolver | 下载出现错误,具体为
ActionFailed(status='failed', retcode=1200, data=None, message="Error: ENOENT: no such file or directory, copyfile '/home/lxm/桌面/Bot/nb01/nb01/BV1vGxtefEka-res.mp4' -> '/app/.config/QQ/NapCat/temp/b6ec51f3-f484-4b6a-9180-d7b0a3e6979f.mp4'\n    at Object.copyFileSync (node:fs:3013:11)\n    at Object.func [as copyFileSync] (node:electron/js2c/node_init:2:3119)\n    at uri2local (file:///app/napcat/napcat.mjs:5621:10)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async OneBotMsgApi.handleOb11FileLikeMessage (file:///app/napcat/napcat.mjs:29997:9)\n    at async Object.video (file:///app/napcat/napcat.mjs:29698:34)\n    at async Promise.all (index 0)\n    at async OneBotMsgApi.createSendElements (file:///app/napcat/napcat.mjs:29942:17)\n    at async SendGroupMsg._handle (file:///app/napcat/napcat.mjs:36714:52)\n    at async SendGroupMsg.websocketHandle (file:///app/napcat/napcat.mjs:36614:23)", wording="Error: ENOENT: no such file or directory, copyfile '/home/lxm/桌面/Bot/nb01/nb01/BV1vGxtefEka-res.mp4' -> '/app/.config/QQ/NapCat/temp/b6ec51f3-f484-4b6a-9180-d7b0a3e6979f.mp4'\n    at Object.copyFileSync (node:fs:3013:11)\n    at Object.func [as copyFileSync] (node:electron/js2c/node_init:2:3119)\n    at uri2local (file:///app/napcat/napcat.mjs:5621:10)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async OneBotMsgApi.handleOb11FileLikeMessage (file:///app/napcat/napcat.mjs:29997:9)\n    at async Object.video (file:///app/napcat/napcat.mjs:29698:34)\n    at async Promise.all (index 0)\n    at async OneBotMsgApi.createSendElements (file:///app/napcat/napcat.mjs:29942:17)\n    at async SendGroupMsg._handle (file:///app/napcat/napcat.mjs:36714:52)\n    at async SendGroupMsg.websocketHandle (file:///app/napcat/napcat.mjs:36614:23)", echo='3')
10-03 04:42:15 [INFO] nonebot | Matcher(type='message', module=nonebot-plugin-resolver, lineno=57) running complete

截图或视频

[在这里上传图片]

插件版本号

nonebot-plugin-resolver1.2.16

适配器类型

napcat

Python版本

Python3.9~3.12之间

系统

linux

zhiyu1998 commented 3 weeks ago

👋 你好!感谢你提交了第一个问题!🔍 你的细心帮助我们发现了新的改进机会,我们会尽快处理。🚀 如果你有更多的想法或疑问,请继续分享,我们非常乐意听取你的声音!🌟 感谢你的支持!

zhiyu1998 commented 3 weeks ago

有没有可能你没装ffmpeg,文档没看完吗?

最简单的安装办法,如果是Ubuntu / Debian:

apt-get install ffmpeg

如果安装了话,那我感觉是你没有映射文件的原因,把nb目录映射给napcat大概率能解出来,不然你docker装的napcat我也没法给你解决,实在不行就不用docker的napcat

loveliveao commented 3 weeks ago

朋友你好,我曾通过docker部署NapCat和Nonebot2,是需要在两个容器都配置一下映射目录的。 从你的日志我猜测你的NoneBot机器人实例存储在以下路径/home/lxm/桌面/Bot/nb01/ 你可以将此路径映射进NapCat的docker中,这样在R插件通过路径发送文件时可正常运行。 提供一个映射到NapCat中的参数作为参考-v /home/lxm/桌面/Bot/nb01/:/home/lxm/桌面/Bot/nb01/ 如还有问题,请将docker部署NapCat容器的指令附在回复中,祝运行顺利。