Tsuk1ko / cq-picsearcher-bot

🤖 基于 saucenao / ascii2d / whatanime 的搜图机器人
https://moe.best/projects/qq-robot-picfinder.html
GNU General Public License v3.0
1.54k stars 216 forks source link

原图模式失效 #459

Closed A2Sumie closed 8 months ago

A2Sumie commented 8 months ago
  1. Bug 描述 自己的部署下,原图模式不起作用(而且几天前似乎起作用) 私聊触发原图模式后,发送表情没有任何反应,再发送一次被按照搜图处理 群聊下为没有反应

搜图和涩图并没有受影响,图片是可以发送的

  1. 截图、日志、配置(issue 内上传图片或文件可直接粘贴) llonebot调整cq/消息段,base64和自机消息上报无效 人不在家,手机远程不方便,日志到家贴
2024/3/29 11:27:06 Bot的昵称y(yyyyyyyyyy): ws 消息上报  {"self_id":yyyyyyyyyy,"user_id":xxxxxxxxxx,"time":1711679239,"message_id":-2147466011,"real_id":-2147466011,"message_type":"private","sender":{"user_id":xxxxxxxxxx,"nickname":"我的昵称x","card":""},"raw_message":"原图","font":14,"sub_type":"friend","message":[{"data":{"text":"原图"},"type":"text"}],"message_format":"array","post_type":"message","raw":{"msgId":"7351606336853861850","msgRandom":"650041080","msgSeq":"797","cntSeq":"0","chatType":1,"msgType":2,"subMsgType":1,"sendType":0,"senderUid":"u_YF7BXvq8zeOD5pccfCoM6w","peerUid":"u_YF7BXvq8zeOD5pccfCoM6w","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1711679239","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7351606336853861849","extBufForUI":"0x","textElement":{"content":"原图","atType":0,"atUid":"0","atTinyId":"0","atNtUid":"","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":true,"generalFlags":"0x","clientSeq":"28312","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"xxxxxxxxxx","peerUin":"xxxxxxxxxx","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgEventInfo":null,"msgShortId":-2147466011}} 

2024/3/29 11:27:06 Bot的昵称y(yyyyyyyyyy): 收到正向Websocket消息 {"action":"send_private_msg","params":{"user_id":xxxxxxxxxx,"message":"已临时切换至【原图】搜图模式√"},"echo":{"reqid":"ql4f0DouM"}} 

2024/3/29 11:27:06 Bot的昵称y(yyyyyyyyyy): ws 消息上报  {"self_id":yyyyyyyyyy,"user_id":yyyyyyyyyy,"time":1711679235,"message_id":-2147466009,"real_id":-2147466009,"message_type":"private","sender":{"user_id":yyyyyyyyyy,"nickname":"Bot的昵称y","card":""},"raw_message":"已临时切换至【原图】搜图模式√","font":14,"sub_type":"friend","message":[{"data":{"text":"已临时切换至【原图】搜图模式√"},"type":"text"}],"message_format":"array","post_type":"message_sent","raw":{"msgId":"7351606336853861851","msgRandom":"1371184282","msgSeq":"797","cntSeq":"0","chatType":1,"msgType":2,"subMsgType":1,"sendType":1,"senderUid":"u_ALModDFgppzw2QV5vVmVmw","peerUid":"u_YF7BXvq8zeOD5pccfCoM6w","channelId":"","guildId":"undefined","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1711679235","msgMeta":"0x","sendStatus":1,"sendRemarkName":"","sendMemberName":"","sendNickName":"Bot的昵称y","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7351606336853861852","extBufForUI":"0x","textElement":{"content":"已临时切换至【原图】搜图模式√","atType":0,"atUid":"0","atTinyId":"0","atNtUid":"","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"","freqLimitInfo":null,"editable":true,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":false,"generalFlags":"0x","clientSeq":"55306","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"yyyyyyyyyy","peerUin":"xxxxxxxxxx","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgEventInfo":null,"msgShortId":-2147466009},"target_id":xxxxxxxxxx} 

2024/3/29 11:27:06 Bot的昵称y(yyyyyyyyyy): 消息发送结果 {"msgId":"7351606336853861851","msgRandom":"1371184282","msgSeq":"798","cntSeq":"0","chatType":1,"msgType":2,"subMsgType":1,"sendType":1,"senderUid":"u_ALModDFgppzw2QV5vVmVmw","peerUid":"u_YF7BXvq8zeOD5pccfCoM6w","channelId":"","guildId":"undefined","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1711679239","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"Bot的昵称y","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7351606336853861852","extBufForUI":"0x","textElement":{"content":"已临时切换至【原图】搜图模式√","atType":0,"atUid":"0","atTinyId":"0","atNtUid":"","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"","freqLimitInfo":null,"editable":true,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":false,"generalFlags":"0x","clientSeq":"55306","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"yyyyyyyyyy","peerUin":"xxxxxxxxxx","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgEventInfo":null,"msgShortId":-2147466009} 

2024/3/29 11:27:06 Bot的昵称y(yyyyyyyyyy): ws 消息上报  {"status":"ok","retcode":0,"data":{"message_id":-2147466009},"message":"","wording":"","echo":{"reqid":"ql4f0DouM"}} 

2024/3/29 11:27:11 Bot的昵称y(yyyyyyyyyy): ws 消息上报  {"self_id":yyyyyyyyyy,"user_id":xxxxxxxxxx,"time":1711679244,"message_id":-2147466007,"real_id":-2147466007,"message_type":"private","sender":{"user_id":xxxxxxxxxx,"nickname":"我的昵称x","card":""},"raw_message":"[CQ:image,file=4CB57D597C73007E4767C510D611EF16.jpg,url=https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0,file_size=149381]","font":14,"sub_type":"friend","message":[{"data":{"file":"4CB57D597C73007E4767C510D611EF16.jpg","url":"https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0","file_size":"149381"},"type":"image"}],"message_format":"array","post_type":"message","raw":{"msgId":"7351606357893876001","msgRandom":"994689641","msgSeq":"799","cntSeq":"0","chatType":1,"msgType":2,"subMsgType":4096,"sendType":0,"senderUid":"u_YF7BXvq8zeOD5pccfCoM6w","peerUid":"u_YF7BXvq8zeOD5pccfCoM6w","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1711679244","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"","guildName":"","channelName":"","elements":[{"elementType":2,"elementId":"7351606357893876000","extBufForUI":"0x","textElement":null,"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":{"picSubType":1,"fileName":"4CB57D597C73007E4767C510D611EF16.jpg","fileSize":"149381","picWidth":1280,"picHeight":718,"original":true,"md5HexStr":"4cb57d597c73007e4767c510d611ef16","sourcePath":"C:\\Users\\kaito\\OneDrive\\文档\\Tencent Files\\yyyyyyyyyy\\nt_qq\\nt_data\\Emoji\\emoji-recv\\2024-03\\Ori\\4cb57d597c73007e4767c510d611ef16.jpg","thumbPath":{},"transferStatus":0,"progress":0,"picType":1000,"invalidState":0,"fileUuid":"CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM","fileSubId":"","thumbFileSize":0,"fileBizId":null,"downloadIndex":null,"summary":"[动画表情]","emojiFrom":0,"emojiWebUrl":"","emojiAd":{"url":"","desc":""},"emojiMall":{"packageId":0,"emojiId":0},"emojiZplan":{"actionId":0,"actionName":"","actionType":0,"playerNumber":0,"peerUid":"0","bytesReserveInfo":""},"originImageMd5":"undefined","originImageUrl":"/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0","import_rich_media_context":null,"isFlashPic":null,"storeID":1},"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":true,"generalFlags":"0x","clientSeq":"28313","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"xxxxxxxxxx","peerUin":"xxxxxxxxxx","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgEventInfo":null,"msgShortId":-2147466007}} 

2024/3/29 11:27:11 Bot的昵称y(yyyyyyyyyy): 收到正向Websocket消息 {"action":"send_private_msg","params":{"user_id":xxxxxxxxxx,"message":"[CQ:image,file=4CB57D597C73007E4767C510D611EF16.jpg]"},"echo":{"reqid":"zQ1HHigtK"}} 

2024/3/29 11:27:11 Bot的昵称y(yyyyyyyyyy): 找到文件缓存 https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0 

2024/3/29 11:27:12 Bot的昵称y(yyyyyyyyyy): 发生错误 https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0下载失败,Error: 下载文件失败: Bad Request 

2024/3/29 11:27:12 Bot的昵称y(yyyyyyyyyy): ws 消息上报  {"status":"failed","retcode":1200,"data":null,"message":"https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0下载失败,Error: 下载文件失败: Bad Request","wording":"https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0下载失败,Error: 下载文件失败: Bad Request","echo":{"reqid":"zQ1HHigtK"}} 
  1. 运行环境
    • win11
    • node.js v20 小版本号回去贴
    • llonebot 3.19.3/3.20.1
    • cq-picsearcher-bot 版本 3.16.4
Tsuk1ko commented 8 months ago

看日志是这应该是 llonebot 的问题,这个原图功能实际上就是把表情图以普通图片发出,这里发送时的 CQ:image 是直接使用缓存图片的形式

image

而后面的日志可以看出 llonebot 直接按这个图片的 url 去下载图片了,而这里的这种新型的 url 缺少了 rkey 参数,因此访问不了

https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0

随便找了个 rkey 补上就可以访问

https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0&rkey=CAQSKAB6JWENi5LMk0kc62l8Pm3Jn1dsLZHyRLAnNmHGoZ3y_gDZPqZt-64

所以这个问题估计得 llonebot 那边解决了,类似 shamrock 那边也有同款问题也解决了 https://github.com/whitechi73/OpenShamrock/issues/236

不过按理来说有这种问题的话搜图应该也是不行的,因为搜图也是拿的这个 url

还有这个跟发送设备也有关系,有可能是因为前几天更新的新版手机QQ,发图的时候带上 --get-url 参数可以得到 url 以检查,直接看日志也行

A2Sumie commented 8 months ago

看日志是这应该是 llonebot 的问题,这个原图功能实际上就是把表情图以普通图片发出,这里发送时的 CQ:image 是直接使用缓存图片的形式

image

而后面的日志可以看出 llonebot 直接按这个图片的 url 去下载图片了,而这里的这种新型的 url 缺少了 rkey 参数,因此访问不了

https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0

随便找了个 rkey 补上就可以访问

https://gchat.qpic.cn/download?appid=1406&fileid=CgoxNTkxMTkyNjY5EhQwa8Q7ZfDPgJZ_7FAqAuFkBJFb6hiFjwkg_goo1tLiiraYhQM&spec=0&rkey=CAQSKAB6JWENi5LMk0kc62l8Pm3Jn1dsLZHyRLAnNmHGoZ3y_gDZPqZt-64

所以这个问题估计得 llonebot 那边解决了,类似 shamrock 那边也有同款问题也解决了 whitechi73/OpenShamrock#236

不过按理来说有这种问题的话搜图应该也是不行的,因为搜图也是拿的这个 url

还有这个跟发送设备也有关系,有可能是因为前几天更新的新版手机QQ,发图的时候带上 --get-url 参数可以得到 url 以检查,直接看日志也行

好巧,今天凌晨的更新修了,能用了