Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pad 协议登录时, 无法获得来自私聊的音频的下载链接 #1537

Closed
4o4E opened this issue Sep 9, 2021 · 3 comments · Fixed by #1551
Closed

pad 协议登录时, 无法获得来自私聊的音频的下载链接 #1537

4o4E opened this issue Sep 9, 2021 · 3 comments · Fixed by #1551
Labels
N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关
Milestone

Comments

@4o4E
Copy link

4o4E commented Sep 9, 2021

无法获得音频链接
代码

for (SingleMessage sm : e.getMessage()) {
    if (sm instanceof OnlineAudio) logger.info("url: {}", ((OnlineAudio) sm).getUrlForDownload());
}

日志

[18:45:29.371] [net.mamoe.mirai.Bot/ERROR] Exception in unnamed coroutine.
net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler
	at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:147) ~[BotLibV4.jar:?]
	at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.access$registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:1) ~[BotLibV4.jar:?]
	at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$callMethod$2.invokeSuspend(JvmMethodListenersInternal.kt:154) ~[BotLibV4.jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[BotLibV4.jar:?]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[BotLibV4.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) ~[BotLibV4.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[BotLibV4.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) ~[BotLibV4.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) ~[BotLibV4.jar:?]
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282]
	at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:140) ~[BotLibV4.jar:?]
	... 8 more
Caused by: java.lang.UnsupportedOperationException: Could not fetch URL for audio 99034A2E23A9AEBA711ABA06C8AA8ED7.amr
	at net.mamoe.mirai.internal.message.OnlineAudioImpl.getUrlForDownload(OnlineAudioImpl.kt:118) ~[BotLibV4.jar:?]
	at com.author404e.bot.cmd.CommandParser.privateHandler(CommandParser.java:81) ~[BotV4.jar:?]
	at com.author404e.bot.util.EventHandlers.friend(EventHandlers.java:75) ~[BotV4.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282]
	at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:140) ~[BotLibV4.jar:?]
	... 8 more

版本及相关选项选择

  • mirai-core: 2.7.0
  • bot-protocol: ANDROID_PAD
@4o4E 4o4E added the x:question 标签: 需要更多信息 label Sep 9, 2021
@Karlatemp Karlatemp added N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关 labels Sep 10, 2021
@Him188 Him188 added this to the 2.7.1 milestone Sep 11, 2021
@Karlatemp
Copy link
Member

Karlatemp commented Sep 12, 2021

请问触发的条件是:

  • 发送者客户端类型 & 版本号
  • 私聊 or 群聊

@Karlatemp
Copy link
Member

未能复现的环境

  • 群聊 & PC QQ
  • 群聊 & Android QQ
  • 群聊 & 另一个 mirai
  • 私聊 & PC QQ
  • 私聊 & Android QQ

@Karlatemp Karlatemp added the z:wait-for-reply 状态: 等待回复 label Sep 12, 2021
@4o4E
Copy link
Author

4o4E commented Sep 12, 2021

未能复现的环境

  • 群聊 & PC QQ
  • 群聊 & Android QQ
  • 群聊 & 另一个 mirai
  • 私聊 & PC QQ
  • 私聊 & Android QQ

安卓客户端私聊发送的语音无法获取链接,与bot是好友关系
发送者qq版本8.8.28.6095
bot版本2.7.1-dev-1,协议是pad

@Karlatemp Karlatemp changed the title 无法获得音频的下载链接 pad 协议登录时, 无法获得来自私聊的音频的下载链接 Sep 12, 2021
@Karlatemp Karlatemp removed x:question 标签: 需要更多信息 z:wait-for-reply 状态: 等待回复 labels Sep 12, 2021
@Karlatemp Karlatemp modified the milestones: 2.7.1, 2.8.0-M1 Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:protocol 属性: 协议相关
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants