cssxsh / bilibili-helper

Mirai Console 插件开发计划
https://github.com/users/cssxsh/projects/4
GNU Affero General Public License v3.0
143 stars 18 forks source link

发生错误 ... for type with serial name 'xyz.cssxsh.bilibili.data.BiliUserInfo', but they were missing #95

Closed SnowMoonSS closed 2 years ago

SnowMoonSS commented 2 years ago

群内输入指令/bili-live add 1898480报错 群内bot回复:

发生错误, Fields [birthday, coins, face, fans_badge, is_followed, jointime, level, mid, moral, name, nameplate, official, rank, sex, sign, top_photo] are required for type with serial name 'xyz.cssxsh.bilibili.data.BiliUserInfo', but they were missing

控制台输出:

2022-09-24 05:29:49 W/bilibili-helper: LiveWaiter with 1898480 数据加载异常,请汇报给开发者
kotlinx.serialization.MissingFieldException: Fields [birthday, coins, face, fans_badge, is_followed, jointime, level, mid, moral, name, nameplate, official, rank, sex, sign, top_photo] are required for type with serial name 'xyz.cssxsh.bilibili.data.BiliUserInfo', but they were missing
        at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliUserInfo.<init>(User.kt:25)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliUserInfo$$serializer.deserialize(User.kt:25)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliUserInfo$$serializer.deserialize(User.kt:25)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:24)
        at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:119)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.api.UserKt$getUserInfo$$inlined$json$1.invokeSuspend(Api.kt:118)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

另外bot在启动时会报一个错,不知道这俩有没有关联:

2022-09-24 05:26:38 W/bilibili-helper: VideoTasker with 15503317 数据加载异常,请汇报给开发者
kotlinx.serialization.MissingFieldException: Fields [list, page] are required for type with serial name 'xyz.cssxsh.bilibili.data.BiliSearchResult', but they were missing
        at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult.<init>(Video.kt:93)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult$$serializer.deserialize(Video.kt:93)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult$$serializer.deserialize(Video.kt:93)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:24)
        at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:119)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.api.VideoKt$getVideos$$inlined$json$1.invokeSuspend(Api.kt:122)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

这个报错在平常运行的时候也会出现,另外平常运行时也会出现的报错:

2022-09-24 05:36:28 W/bilibili-helper: VideoTasker with 3141495 数据加载异常,请汇报给开发者
kotlinx.serialization.MissingFieldException: Fields [list, page] are required for type with serial name 'xyz.cssxsh.bilibili.data.BiliSearchResult', but they were missing
        at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult.<init>(Video.kt:93)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult$$serializer.deserialize(Video.kt:93)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult$$serializer.deserialize(Video.kt:93)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:24)
        at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:119)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.api.VideoKt$getVideos$$inlined$json$1.invokeSuspend(Api.kt:122)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
2022-09-24 05:36:18 W/bilibili-helper: VideoTasker with 1919946 数据加载异常,请汇报给开发者
kotlinx.serialization.MissingFieldException: Fields [list, page] are required for type with serial name 'xyz.cssxsh.bilibili.data.BiliSearchResult', but they were missing
        at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult.<init>(Video.kt:93)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult$$serializer.deserialize(Video.kt:93)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.data.BiliSearchResult$$serializer.deserialize(Video.kt:93)
        at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
        at kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeSerializableValue(TreeJsonDecoder.kt:51)
        at kotlinx.serialization.json.internal.TreeJsonDecoderKt.readJson(TreeJsonDecoder.kt:24)
        at kotlinx.serialization.json.Json.decodeFromJsonElement(Json.kt:119)
        at bilibili-helper-1.6.4.jar//xyz.cssxsh.bilibili.api.VideoKt$getVideos$$inlined$json$1.invokeSuspend(Api.kt:122)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.resumeRootWith(SuspendFunctionGun.kt:138)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.loop(SuspendFunctionGun.kt:112)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun.access$loop(SuspendFunctionGun.kt:14)
        at bilibili-helper-1.6.4.jar[private]//io.ktor.util.pipeline.SuspendFunctionGun$continuation$1.resumeWith(SuspendFunctionGun.kt:62)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
cssxsh commented 2 years ago

B站更新了反扒策略,被反扒拦截了

可以参考 readme 添加 cookies https://github.com/cssxsh/bilibili-helper#cookies

SnowMoonSS commented 2 years ago

我超,好快的回复。问题解决了,感谢 (发完才发现旁边就有一个同样问题的issue