LagrangeDev / Lagrange.Core

An Implementation of NTQQ Protocol, with Pure C#, Derived from Konata.Core
GNU General Public License v3.0
2.12k stars 262 forks source link

[Bug?]: 发送短视频消息报错Upload resources for VideoEntity failed #432

Closed chuanSir123 closed 1 month ago

chuanSir123 commented 4 months ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

Lagrange项目

OneBot

所使用/依赖的Lagrange项目对应的commit

839c225

运行环境

Windows

运行架构

x64

连接方式

反向 WebSocket

重现步骤

bot发送短视频给用户时,会报错Upload resources for VideoEntity failed,message为{"type": "video", "data": { "file": "https://aweme.snssdk.com/aweme/v1/play/?video_id=v0d00fg10000cnc5mejc77u07dfmt3ug&ratio=1080p&line=0"}}

期望的结果是什么?

正确发送短视频

实际的结果是什么?

发送失败,报错Upload resources for VideoEntity failed

简单的复现代码/链接(可选)

No response

Trace 级别日志记录(可选)

trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[3]
      [ReverseWSService] Receive(aa2276b4-f82b-4fef-999b-a90cee90fc74): {"action":"send_msg","params":{"message_type":"group","group_id":837816964,"user_id":416448943,"message":{"type":"video","data":{"file":"https:\/\/aweme.snssdk.com\/aweme\/v1\/play\/?video_id=v0d00fg10000cocg81bc77uat2hqj910&ratio=1080p&line=0"}}},"echo":{"seq":12}}
trce: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:47] [ServiceContext] [DEBUG]: Outgoing SSOFrame: OidbSvcTrpcTcp.0x11ea_100
warn: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:47] [BusinessContext] [WARNING]: Error when processing the event: Lagrange.Core.Internal.Event.Message.VideoGroupUploadEvent
warn: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:47] [BusinessContext] [WARNING]: Object reference not set to an instance of an object.
warn: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:47] [BusinessContext] [WARNING]:    at Lagrange.Core.Internal.Service.Message.VideoGroupUploadService.Parse(Span`1 input, BotKeystore keystore, BotAppInfo appInfo, BotDeviceInfo device, VideoGroupUploadEvent& output, List`1& extraEvents)
         at Lagrange.Core.Internal.Service.BaseService`1.Lagrange.Core.Internal.Service.IService.Parse(Span`1 input, BotKeystore keystore, BotAppInfo appInfo, BotDeviceInfo device, ProtocolEvent& output, List`1& extraEvents)
         at Lagrange.Core.Internal.Context.ServiceContext.ResolveEventByPacket(SsoPacket packet)
         at Lagrange.Core.Internal.Context.BusinessContext.SendEvent(ProtocolEvent event)
fail: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:47] [HighwayContext] [FATAL]: Upload resources for VideoEntity failed
trce: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:47] [ServiceContext] [DEBUG]: Outgoing SSOFrame: MessageSvc.PbSendMsg
trce: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:48] [ServiceContext] [DEBUG]: Incoming SSOFrame: MessageSvc.PbSendMsg
trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[2]
      [ReverseWSService] Send(aa2276b4-f82b-4fef-999b-a90cee90fc74): {"status":"ok","retcode":0,"data":{"message_id":288383762},"echo":{"seq":12}}
trce: Lagrange.Core.BotContext[0]
      [2024-07-09 16:24:48] [ServiceContext] [DEBUG]: Incoming SSOFrame: trpc.msg.olpush.OlPushService.MsgPush
trce: Lagrange.OneBot.Core.Network.Service.ReverseWSService[3]

补充说明(可选)

No response

chuanSir123 commented 4 months ago

这个问题的原因找到了,因为指定的url返回的302,需要forward才能获取base64,另外发现新的问题,发送的视频偶尔出现资源已过期,也没报错

ZM-J commented 2 months ago

同样碰到这个问题,发送的消息为

[{"type":"video","data":{"file":"http://ap.hanhan.icu:4006?category=diaodai"}}]

直接访问api,就下载视频;但是将该消息推到 lagrange 这边没任何显示,QQ 客户端上查看为

image

ZM-J commented 2 months ago

Lagrange后台日志会有

info: Lagrange.Core.BotContext[0]
      [2024-08-24 18:01:06] [MessagingLogic] [VERBOSE]: [MessageChain(xxx)(xxx)] [Video 1920x1080]: 1719655 https://multimedia.nt.qq.com.cn/download?appid=1415&format=origin&orgfmt=t264&spec=0&rkey=xxx

但是直接用浏览器访问地址,返回

{"retcode":-5502009,"retmsg":"file does not exist","retryflag":0}
sisi0318 commented 2 months ago

Lagrange后台日志会有


info: Lagrange.Core.BotContext[0]

      [2024-08-24 18:01:06] [MessagingLogic] [VERBOSE]: [MessageChain(xxx)(xxx)] [Video 1920x1080]: 1719655 https://multimedia.nt.qq.com.cn/download?appid=1415&format=origin&orgfmt=t264&spec=0&rkey=xxx

但是直接用浏览器访问地址,返回


{"retcode":-5502009,"retmsg":"file does not exist","retryflag":0}

请尝试更新最新版本

wess09 commented 2 months ago

+1

DarkRRb commented 1 month ago

目前 VideoEntity 只支持小于 1M 的视频(忘了 owner 修复了没有

已修复

akchiji888 commented 1 month ago

同问,但在 #397 里说已实现,但用907772e版本构建后,仍然无法发送1M以上的视频

DarkRRb commented 1 month ago

同问,但在 #397 里说已实现,但用907772e版本构建后,仍然无法发送1M以上的视频

询问后并测试后确定可以发送 1M 以上视频

DarkRRb commented 1 month ago

这个问题的原因找到了,因为指定的url返回的302,需要forward才能获取base64,另外发现新的问题,发送的视频偶尔出现资源已过期,也没报错

该问题已解决, 其余问题请单开 issue 处理

pk5ls20 commented 1 month ago

同问,但在 #397 里说已实现,但用907772e版本构建后,仍然无法发送1M以上的视频

若使用 https://github.com/LagrangeDev/Lagrange.Core/commit/907772e82101b196305ea2d8903e4553f22443ec 仍无法发送1M以上视频,请单开一个 issue