Lagrange.Core icon indicating copy to clipboard operation
Lagrange.Core copied to clipboard

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

Open chuanSir123 opened this issue 1 year ago • 1 comments

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

  • [X] 我已经仔细阅读上述内容
  • [X] 我已经使用 最新构建 测试过,问题依旧存在。
  • [X] 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • [X] 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(其它疑问请考虑加入TG群询问或在discussions中提问)

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 avatar Jul 09 '24 08:07 chuanSir123

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

chuanSir123 avatar Jul 11 '24 08:07 chuanSir123

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

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

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

image

ZM-J avatar Aug 21 '24 12:08 ZM-J

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}

ZM-J avatar Aug 24 '24 10:08 ZM-J

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 avatar Aug 28 '24 14:08 sisi0318

+1

wess09 avatar Sep 10 '24 09:09 wess09

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

已修复

DarkRRb avatar Sep 18 '24 17:09 DarkRRb

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

akchiji888 avatar Sep 22 '24 02:09 akchiji888

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

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

DarkRRb avatar Sep 22 '24 02:09 DarkRRb

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

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

DarkRRb avatar Sep 22 '24 02:09 DarkRRb

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

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

pk5ls20 avatar Sep 22 '24 02:09 pk5ls20