mamoe / mirai

高效率 QQ 机器人支持库
https://mirai.mamoe.net
GNU Affero General Public License v3.0
14.5k stars 2.55k forks source link

MacQQ发起的好友聊天接收到图片信息时获取的URL失效无法下载图片 #2764

Open xqe2011 opened 1 year ago

xqe2011 commented 1 year ago

问题描述

使用获取到的图片URL使用Python下的Ariadne无法获取图片二进制数据提示服务器404,于是抓包了一下WebSocket,将WS里数据包携带的URL复制到浏览器中复现出一样的错误,排除Ariadne的问题 mirai-http-api中发送URL时是直接从mirai的queryURL获取的地址,可能排除mirai-http-api的问题。 电脑端用的是MacQQ6.9.18,安卓上该问题无法复现

复现

  1. 加机器人为好友
  2. 拖动图片进入聊天框直接发送
  3. 自定义表情功能发送表情
  4. 以上2种方案,mirai均可接收到图片聊天,但是ws输出的url打开后返回404

mirai-core 版本

2.15.0

bot-protocol

ANDROID_PAD

其他组件版本

mirai-api-http: v2.9.1 mirai-device-generator: v1.3.0 fix-protocol-version: 1.9.10 mirai-login-solver-sakura: 0.0.11 外置sign服务Docker: xzhouqd/qsign:core-1.1.7

系统日志

mirai_1  |   10:09:07 [INFO] iTX Technologies Mirai Console Loader version 2.1.2-61c8bd8
mirai_1  |   10:09:07 [INFO] Runtime: OpenJDK 64-Bit Server VM 11.0.20 (arch: 64)
mirai_1  |   10:09:07 [INFO] https://github.com/iTXTech/mirai-console-loader
mirai_1  |   10:09:07 [INFO] This program is licensed under GNU AGPL v3
mirai_1  |   10:09:10 [INFO] Mirai Console Loader Announcement:
mirai_1  | Mirai Console Loader 公告栏
mirai_1  | 
mirai_1  | 如果在图片上传的时候遇到问题请与我们联系 (需要提供图片文件源本)
mirai_1  | `- 如 Unsupported image type for ExternalResource *
mirai_1  | `  considering use gif/png/bmp/jpg format.
mirai_1  | `- Tracker: https://github.com/mamoe/mirai/issues/new/choose
mirai_1  | 
mirai_1  | 常用资源整合
mirai_1  | `- https://mirai.mamoe.net/topic/653
mirai_1  |  
mirai_1  | MCL 已推出 2.1.0,更好的支持 Mirai 2.11 的插件系统,建议更新。
mirai_1  | 
mirai_1  |   10:09:10 [INFO] Verifying "net.mamoe:mirai-console" v2.15.0
mirai_1  |   10:09:11 [INFO] Verifying "net.mamoe:mirai-console-terminal" v2.15.0
mirai_1  |   10:09:11 [INFO] Verifying "net.mamoe:mirai-core-all" v2.15.0
mirai_1  |   10:09:12 [INFO] Verifying "org.itxtech:mcl-addon" v2.1.1
mirai_1  |   10:09:12 [INFO] Verifying "net.mamoe:mirai-api-http" v2.9.1
mirai_1  |   10:09:12 [INFO] Verifying "xyz.cssxsh.mirai:mirai-device-generator" v1.3.0
mirai_1  | 2023-07-30 10:09:14 I/main: Starting mirai-console...
mirai_1  | 2023-07-30 10:09:14 I/main: 
mirai_1  | 
mirai_1  | ===================================[ Mirai console 2.15.0 ]===================================
mirai_1  |  __       __ __                   __  ______                                      __
mirai_1  | |  \     /  \  \                 |  \/      \                                    |  \
mirai_1  | | ▓▓\   /  ▓▓\▓▓ ______   ______  \▓▓  ▓▓▓▓▓▓\ ______  _______   _______  ______ | ▓▓ ______
mirai_1  | | ▓▓▓\ /  ▓▓▓  \/      \ |      \|  \ ▓▓   \▓▓/      \|       \ /       \/      \| ▓▓/      \
mirai_1  | | ▓▓▓▓\  ▓▓▓▓ ▓▓  ▓▓▓▓▓▓\ \▓▓▓▓▓▓\ ▓▓ ▓▓     |  ▓▓▓▓▓▓\ ▓▓▓▓▓▓▓\  ▓▓▓▓▓▓▓  ▓▓▓▓▓▓\ ▓▓  ▓▓▓▓▓▓\
mirai_1  | | ▓▓\▓▓ ▓▓ ▓▓ ▓▓ ▓▓   \▓▓/      ▓▓ ▓▓ ▓▓   __| ▓▓  | ▓▓ ▓▓  | ▓▓\▓▓    \| ▓▓  | ▓▓ ▓▓ ▓▓    ▓▓
mirai_1  | | ▓▓ \▓▓▓| ▓▓ ▓▓ ▓▓     |  ▓▓▓▓▓▓▓ ▓▓ ▓▓__/  \ ▓▓__/ ▓▓ ▓▓  | ▓▓_\▓▓▓▓▓▓\ ▓▓__/ ▓▓ ▓▓ ▓▓▓▓▓▓▓▓
mirai_1  | | ▓▓  \▓ | ▓▓ ▓▓ ▓▓      \▓▓    ▓▓ ▓▓\▓▓    ▓▓\▓▓    ▓▓ ▓▓  | ▓▓       ▓▓\▓▓    ▓▓ ▓▓\▓▓     \
mirai_1  |  \▓▓      \▓▓\▓▓\▓▓       \▓▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓  \▓▓▓▓▓▓ \▓▓   \▓▓\▓▓▓▓▓▓▓  \▓▓▓▓▓▓ \▓▓ \▓▓▓▓▓▓▓
mirai_1  | 
mirai_1  | 
mirai_1  | 2023-07-30 10:09:14 I/main: Backend: version 2.15.0, built on 2023-07-10 20:57:17.
mirai_1  | 2023-07-30 10:09:14 I/main: Frontend Terminal: version 2.15.0, provided by Mamoe Technologies
mirai_1  | 2023-07-30 10:09:14 I/main: Welcome to visit https://mirai.mamoe.net/
mirai_1  | 2023-07-30 10:09:16 I/plugin: Successfully loaded plugin mirai-api-http v2.9.1
mirai_1  | 2023-07-30 10:09:17 I/plugin: Successfully loaded plugin mirai-device-generator v1.3.0
mirai_1  | 2023-07-30 10:09:17 I/fix-protocol-version: 协议版本检查更新...
mirai_1  | 2023-07-30 10:09:17 I/fix-protocol-version: ANDROID_PAD load from file:///app/android_pad.json
mirai_1  | 2023-07-30 10:09:17 I/fix-protocol-version: 注册服务...
mirai_1  | 2023-07-30 10:09:17 I/fix-protocol-version: 服务配置文件: 
mirai_1  |  file:///app/KFCFactory.json
mirai_1  | 2023-07-30 10:09:17 I/plugin: Successfully loaded plugin fix-protocol-version v1.9.10
mirai_1  | 2023-07-30 10:09:17 I/plugin: Successfully loaded plugin mirai-login-solver-sakura v0.0.11
mirai_1  | 2023-07-30 10:09:17 I/plugin: Successfully loaded plugin MCL Addon v2.1.1
mirai_1  | 2023-07-30 10:09:17 I/main: Prepared built-in commands: autoLogin, help, login, logout, permission, status, stop
mirai_1  | 2023-07-30 10:09:17 I/Mirai HTTP API: ********************************************************
mirai_1  | 2023-07-30 10:09:18 I/MahKtorAdapter[http,ws]: Autoreload is disabled because the development mode is off.
mirai_1  | 2023-07-30 10:09:18 I/MahKtorAdapter[http,ws]: Application started in 0.421 seconds.
mirai_1  | 2023-07-30 10:09:18 I/MahKtorAdapter[http,ws]: Responding at http://0.0.0.0:8080
mirai_1  | 2023-07-30 10:09:18 I/http adapter: >>> [http adapter] is listening at http://0.0.0.0:8080
mirai_1  | 2023-07-30 10:09:18 I/ws adapter: >>> [ws adapter] is listening at ws://0.0.0.0:8080
mirai_1  | 2023-07-30 10:09:18 I/Mirai HTTP API: Http api server is running with verifyKey: [打码]
mirai_1  | 2023-07-30 10:09:18 I/Mirai HTTP API: adaptors: [http,ws]
mirai_1  | 2023-07-30 10:09:18 I/Mirai HTTP API: ********************************************************
mirai_1  | 2023-07-30 10:09:18 I/fix-protocol-version: 当前各登录协议版本日期: 
mirai_1  | ANDROID_PHONE  8.9.58.11170  2023-05-19T03:35Z
mirai_1  | ANDROID_PAD    8.9.63.11390  2023-05-26T02:46:18Z
mirai_1  | ANDROID_WATCH  2.0.8         2019-06-03T12:25:31Z
mirai_1  | IPAD           8.9.50.611    2023-02-16T07:10:14Z
mirai_1  | MACOS          6.8.2.21241   2022-03-14T03:11:35Z
mirai_1  | 
mirai_1  | 2023-07-30 10:09:18 I/fix-protocol-version: 当前签名服务配置信息: 
mirai_1  | v8.9.63 by fuqiuluo/unidbg-fetch-qsign from http://sign:8080
mirai_1  | 
mirai_1  | 缺少 v8.9.58 配置
mirai_1  | 2023-07-30 10:09:18 I/MCL Addon: iTXTech MCL Version: 2.1.2-61c8bd8
mirai_1  | 2023-07-30 10:09:18 W/MCL Addon: iTXTech Soyuz 未安装,Soyuz MCL Handler 特性已禁用
mirai_1  | 2023-07-30 10:09:18 I/main: 5 plugin(s) enabled.
mirai_1  | 2023-07-30 10:09:18 I/main: Auto-login [打码], protocol: ANDROID_PAD, heartbeatStrategy: STAT_HB
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert: Encrypt service was loaded: KFCFactory(config=file:///app/KFCFactory.json)
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert: All outgoing message may be leaked by this service.
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert: Use this service if and only if you trusted this service and the service provider.
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert: Service details:
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert:   `- Jvm Class: class xyz.cssxsh.mirai.tool.KFCFactory
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert:   `- ClassLoader: JvmPluginClassLoader{fix-protocol-version-1.9.10.mirai2.jar}
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert:   `- Source: file:/app/plugins/fix-protocol-version-1.9.10.mirai2.jar
mirai_1  | 2023-07-30 10:09:19 W/EncryptService.alert:   `- Protected Domain: ProtectionDomain  (file:/app/plugins/fix-protocol-version-1.9.10.mirai2.jar <no signer certificates>)
mirai_1  |  JvmPluginClassLoader{fix-protocol-version-1.9.10.mirai2.jar}
mirai_1  |  <no principals>
mirai_1  |  java.security.Permissions@2b9d4b0 (
mirai_1  |  ("java.io.FilePermission" "/app/plugins/fix-protocol-version-1.9.10.mirai2.jar" "read")
mirai_1  | )
mirai_1  | 
mirai_1  | 
mirai_1  | 2023-07-30 10:09:19 I/KFCFactory: ANDROID_PAD(8.9.63) server type: fuqiuluo/unidbg-fetch-qsign, file:///app/KFCFactory.json
mirai_1  | 2023-07-30 10:09:19 I/KFCFactory: unidbg-fetch-qsign by http://sign:8080 about 
mirai_1  | {
mirai_1  |     "code": 0,
mirai_1  |     "msg": "IAA 云天明 章北海",
mirai_1  |     "data": {
mirai_1  |         "version": "1.1.7",
mirai_1  |         "protocol": {
mirai_1  |             "qua": "V1_AND_SQ_8.9.63_4194_YYB_D",
mirai_1  |             "version": "8.9.63",
mirai_1  |             "code": "4194"
mirai_1  |         }
mirai_1  |     }
mirai_1  | }
mirai_1  | 2023-07-30 10:09:20 I/Bot.[打码]: Loaded account secrets from local cache.
mirai_1  | 2023-07-30 10:09:21 I/UnidbgFetchQsign: Bot([打码]) initialize by http://sign:8080
mirai_1  | 2023-07-30 10:09:32 I/Bot.[打码]: Saved account secrets to local cache for fast login.
mirai_1  | 2023-07-30 10:09:32 I/Bot.[打码]: Login successful.
mirai_1  | 2023-07-30 10:09:33 V/Bot.[打码]: Event: BotOnlineEvent(bot=Bot([打码]))
mirai_1  | 2023-07-30 10:09:33 I/Bot.[打码]: Bot login successful.
mirai_1  | 2023-07-30 10:09:33 V/Bot.[打码]: Event: net.mamoe.mirai.console.events.AutoLoginEvent$Success@41d877bb
mirai_1  | 2023-07-30 10:09:33 I/main: mirai-console started successfully.

网络日志

2023-07-30 10:09:20 V/Net 3224691790: Validated caches.
2023-07-30 10:09:20 V/Net 3224691790: Loading server list from cache.
2023-07-30 10:09:20 V/Net 3224691790: Server list: 106.39.206.110:443, 106.39.206.110:80, msfwifi.3g.qq.com:8080, 121.229.94.224:80, 183.47.102.193:14000, 180.109.192.57:8080, 14.22.9.53:80, 49.7.253.65:443, 183.47.110.220:8080, 117.62.242.155:80.
2023-07-30 10:09:30 I/Net 3224691790: ECDH key is valid.
2023-07-30 10:09:32 V/Net 3224691790: Send: wtlogin.exchange_emp(10:fast-login)
2023-07-30 10:09:32 V/Net 3224691790: Recv: wtlogin.exchange_emp
2023-07-30 10:09:32 V/Net 3224691790: Send: StatSvc.register(online)
2023-07-30 10:09:32 I/Net 3224691790: Server time updated, serverTime: 1690711777, diff: 5ms=0.005s
2023-07-30 10:09:32 V/Net 3224691790: Recv: StatSvc.register
2023-07-30 10:09:33 V/Net 3224691790: Loading BdhSession from cache file
2023-07-30 10:09:33 I/Net 3224691790: Syncing friend message history...
2023-07-30 10:09:33 V/Net 3224691790: Send: StatSvc.GetDevLoginInfo(StatSvc.GetDevLoginInfo)
2023-07-30 10:09:33 I/Net 3224691790: Start loading friendGroup list...
2023-07-30 10:09:33 I/Net 3224691790: Start loading friend list...
2023-07-30 10:09:33 V/Net 3224691790: Send: OidbSvc.0x496(OidbSvc.0x496)
2023-07-30 10:09:33 V/Net 3224691790: Send: friendlist.getFriendGroupList(friendlist.getFriendGroupList)
2023-07-30 10:09:33 I/Net 3224691790: Start loading stranger list...
2023-07-30 10:09:33 V/Net 3224691790: Send: friendlist.getFriendGroupList(friendlist.getFriendGroupList)
2023-07-30 10:09:33 V/Net 3224691790: Send: OidbSvc.0x5d2_0(OidbSvc.0x5d2_0)
2023-07-30 10:09:33 I/Net 3224691790: Syncing friend message history: Success.
2023-07-30 10:09:33 V/Net 3224691790: Recv: StatSvc.GetDevLoginInfo
2023-07-30 10:09:33 I/Net 3224691790: No OtherClient online.
2023-07-30 10:09:33 V/Net 3224691790: Recv: OidbSvc.0x496
2023-07-30 10:09:33 I/Net 3224691790: Start loading group list...
2023-07-30 10:09:33 I/Net 3224691790: Successfully loaded stranger list: 0 in total
2023-07-30 10:09:33 V/Net 3224691790: Recv: OidbSvc.0x5d2_0
2023-07-30 10:09:33 V/Net 3224691790: Send: friendlist.GetTroopListReqV2(friendlist.GetTroopListReqV2)
2023-07-30 10:09:33 V/Net 3224691790: Recv: friendlist.getFriendGroupList
2023-07-30 10:09:33 V/Net 3224691790: Loading friend list: 3/3
2023-07-30 10:09:33 I/Net 3224691790: Successfully loaded friend list: 3 in total
2023-07-30 10:09:33 V/Net 3224691790: Loading friendGroup list: 1/1
2023-07-30 10:09:33 I/Net 3224691790: Successfully loaded friendGroup list: 1 in total
2023-07-30 10:09:33 V/Net 3224691790: Recv: friendlist.getFriendGroupList
2023-07-30 10:09:33 V/Net 3224691790: Recv: friendlist.GetTroopListReqV2
2023-07-30 10:09:33 I/Net 3224691790: Successfully loaded group list: 0 in total.
2023-07-30 10:09:33 I/Net 3224691790: Scheduled refresh login session in 19d 23h 55min 0.0s.
2023-07-30 10:09:33 I/Net 3224691790: Scheduled key refresh in 23h 55min 0.0s.
2023-07-30 10:09:33 V/Net 3224691790: Send: trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish(mobileqq.msf.security)
2023-07-30 10:09:33 V/Net 3224691790: Recv: trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish
2023-07-30 10:09:35 V/Net 3224691790: Server list: 49.7.253.177:443, 14.22.9.53:14000, msfwifi.3g.qq.com:8080, 183.47.103.84:8080, 183.47.110.220:80, 121.229.94.168:80, 106.39.206.110:80, 180.109.192.57:8080, 180.110.193.149:80, 221.238.41.89:443.
2023-07-30 10:09:35 V/Net 3224691790: Saving bdh session to cache
2023-07-30 10:09:35 V/Net 3224691790: Saving server list to cache
2023-07-30 10:09:35 V/Net 3224691790: Send: ConfigPushSvc.PushResp(ConfigPushSvc.PushResp)
2023-07-30 10:09:35 V/Net 3224691790: Recv: ConfigPushSvc.PushReq
2023-07-30 10:09:36 V/Net 3224691790: Saving bdh session to cache
2023-07-30 10:09:36 V/Net 3224691790: Send: ConfigPushSvc.PushResp(ConfigPushSvc.PushResp)
2023-07-30 10:09:36 V/Net 3224691790: Recv: ConfigPushSvc.PushReq
2023-07-30 10:09:38 V/Net 3224691790: Send: trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish(mobileqq.msf.security)
2023-07-30 10:09:38 V/Net 3224691790: Recv: trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish

补充信息

cssxsh commented 1 year ago

https://github.com/mamoe/mirai/issues/2678

NTQQ 可能使用了新的 QQ 图片元数据

bupabupala commented 11 months ago

插眼,遇见了同样问题

wess09 commented 8 months ago

+1一样