From 8c395df524fadfd5c5c63969621e0d31166b86b8 Mon Sep 17 00:00:00 2001 From: kuku Date: Thu, 5 Dec 2024 11:00:46 +0000 Subject: [PATCH] fix tieba sign error --- build.gradle.kts | 2 +- src/main/kotlin/me/kuku/telegram/entity/BaiduEntity.kt | 2 +- src/main/kotlin/me/kuku/telegram/logic/BaiduLogic.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1e0b5a5..bfa8509 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,7 +37,7 @@ fun DependencyHandlerScope.ktor() { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor") implementation("org.springframework.boot:spring-boot-starter-data-mongodb-reactive") - implementation("com.github.pengrad:java-telegram-bot-api:7.9.1") + implementation("com.github.pengrad:java-telegram-bot-api:7.11.0") implementation("org.jsoup:jsoup:1.17.2") val ociVersion = "3.48.0" implementation("com.oracle.oci.sdk:oci-java-sdk-core:$ociVersion") diff --git a/src/main/kotlin/me/kuku/telegram/entity/BaiduEntity.kt b/src/main/kotlin/me/kuku/telegram/entity/BaiduEntity.kt index c21979c..452a6b9 100644 --- a/src/main/kotlin/me/kuku/telegram/entity/BaiduEntity.kt +++ b/src/main/kotlin/me/kuku/telegram/entity/BaiduEntity.kt @@ -16,7 +16,7 @@ class BaiduEntity: BaseEntity() { var sign: Status = Status.OFF private fun otherCookie(sToken: String): String { - return "BDUSS=.*?;".toRegex().find(sToken)!!.value + "STOKEN=$sToken; " + return "BDUSS=.*?;".toRegex().find(cookie)!!.value + "STOKEN=$sToken; " } fun teiBaCookie(): String { diff --git a/src/main/kotlin/me/kuku/telegram/logic/BaiduLogic.kt b/src/main/kotlin/me/kuku/telegram/logic/BaiduLogic.kt index cd7c456..7c03aad 100644 --- a/src/main/kotlin/me/kuku/telegram/logic/BaiduLogic.kt +++ b/src/main/kotlin/me/kuku/telegram/logic/BaiduLogic.kt @@ -165,7 +165,7 @@ class BaiduLogic ( headers { headers.forEach { append(it.key, it.value) } } - }.body() + }.bodyAsText().toJsonNode() if (!arrayOf(1101, 0).contains(jsonObject["no"].asInt())) error(jsonObject["error"].asText()) } }