kukume / tgbot

kuku's telegram bot
GNU Affero General Public License v3.0
136 stars 27 forks source link

NodeSeek签到失败 #11

Closed SkyAerope closed 10 months ago

SkyAerope commented 11 months ago

从12/13开始签到均失败 12/16的日志如下 (cookie=session%3Dxxx已脱敏处理)

#NodeSeek签到失败异常信息
Expected response body of the type 'class com.fasterxml.jackson.databind.JsonNode' but was 'class io.ktor.utils.io.ByteBufferChannel'
In response from `https://api.jpa.cc/nodeseek/sign/query?cookie=session%3Dxxx`
Response status `200 `
Response header `ContentType: text/plain; charset=UTF-8` 
Request header `Accept: */*`

You can read how to resolve NoTransformationFoundException at FAQ: 
https://ktor.io/docs/faq.html#no-transformation-found-exception
io.ktor.client.call.NoTransformationFoundException: Expected response body of the type 'class com.fasterxml.jackson.databind.JsonNode' but was 'class io.ktor.utils.io.ByteBufferChannel'
In response from `https://api.jpa.cc/nodeseek/sign/query?cookie=session%3Dxxx`
Response status `200 `
Response header `ContentType: text/plain; charset=UTF-8` 
Request header `Accept: */*`

You can read how to resolve NoTransformationFoundException at FAQ: 
https://ktor.io/docs/faq.html#no-transformation-found-exception
 at io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:94)
 at me.kuku.telegram.logic.NodeSeekLogic.querySign(NodeSeekLogic.kt:64)
 at me.kuku.telegram.logic.NodeSeekLogic$querySign$1.invokeSuspend(NodeSeekLogic.kt)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.internal.DispatchedContinuation.resumeWith(DispatchedContinuation.kt:204)
 at io.ktor.utils.io.internal.CancellableReusableContinuation.resumeWith(CancellableReusableContinuation.kt:93)
 at io.ktor.utils.io.ByteBufferChannel.resumeReadOp(ByteBufferChannel.kt:2104)
 at io.ktor.utils.io.ByteBufferChannel.tryTerminate$ktor_io(ByteBufferChannel.kt:390)
 at io.ktor.utils.io.ByteBufferChannel.close(ByteBufferChannel.kt:135)
 at io.ktor.utils.io.CoroutinesKt$launchChannel$1.invoke(Coroutines.kt:158)
 at io.ktor.utils.io.CoroutinesKt$launchChannel$1.invoke(Coroutines.kt:157)
 at kotlinx.coroutines.InvokeOnCompletion.invoke(JobSupport.kt:1385)
 at kotlinx.coroutines.JobSupport.notifyCompletion(JobSupport.kt:1497)
 at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:325)
 at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:242)
 at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:910)
 at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:867)
 at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:832)
 at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
 at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
 at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
kukume commented 11 months ago

实际签到成功没?

SkyAerope commented 11 months ago

没成功

kukume commented 11 months ago

你试试重新登陆一下,手动执行试试?

SkyAerope commented 11 months ago

手动执行成功了,不过今天早些时候自动执行失败了,而且报错跟前几天都不一样

#NodeSeek签到失败异常信息
Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asBoolean()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null
java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asBoolean()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null
 at me.kuku.telegram.logic.NodeSeekLogic.querySign(NodeSeekLogic.kt:23)
 at me.kuku.telegram.logic.NodeSeekLogic$querySign$1.invokeSuspend(NodeSeekLogic.kt)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
 at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:68)
 at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:375)
 at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default(DispatchedContinuation.kt:278)
 at kotlinx.coroutines.DispatchedCoroutine.afterResume(Builders.common.kt:261)
 at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
 at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
 at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
kukume commented 11 months ago

这是用无头浏览器实现的,无头浏览器占用性能大,所以服务端是同一时间只执行一个签到,然后1个小时之后去查询签到结果,1个小时还没执行到你。所以没有查询到结果,如果cookie没问题,应该是签到成功了的

SkyAerope commented 11 months ago

今天自动签到是凌晨5点多执行的,我检查发现签到失败的时间是9点多(发送上一条commit之前一小会),然后手动执行又成功了。 而且要是签到成功了,NodeSeek的telegram bot会给我发消息,但是没有。

kukume commented 11 months ago

你现在可以自建使用无头浏览器执行的api。 https://hub.docker.com/r/kukume/sk 运行该docker镜像,然后把url配置在配置文件中,readme已更新配置项

zorerr commented 11 months ago

你现在可以自建使用无头浏览器执行的api。 https://hub.docker.com/r/kukume/sk 运行该docker镜像,然后把url配置在配置文件中,readme已更新配置项

请问搭建好了,配置文件那里怎么填,填什么格式都不对

kukume commented 11 months ago

@zorerr Readme更新了配置文件的方式,搭建好的默认端口是5460,如果你的机器人和api在一台服务器,那就是 jar:

kuku:
  telegram:
    api: http://localhost:5460

docker:

#省略其他环境变量
KUKU_API: http://localhost:5460
kukume commented 11 months ago

首次执行的时候,框架会自动去下载浏览器,你的网速可能慢了点,所以超时了。超时时间是30s,你应该没有在30s之内下载完浏览器。