Skip to content

Commit

Permalink
fix: 问答不处理
Browse files Browse the repository at this point in the history
  • Loading branch information
awalol committed Aug 11, 2022
1 parent 79b0e4c commit 7a5e8e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "cn.awalol"
version = "1.2.0"
version = "1.2.1"

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/cn/awalol/ZhihuResolverBot/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ suspend fun main() {

onContentMessage {
logger.debug(it.toString())
val url = (it.content as TextContent).textSources[0].source
val url = (it.content as TextContent).textSources.first().source
logger.debug("Get Source : $url")
val zhihuContent = client.get(url){
headers.append(HttpHeaders.Cookie,config.cookie)
Expand Down Expand Up @@ -224,7 +224,7 @@ suspend fun yuque(client: HttpClient, title: String, content: String) : String{

fun getContent(jsoup: Document,url: String) : String{
if(url.contains("/answer/")){
val initialData = jsoup.getElementById("js-initialData")!!.text().to<JSONObject>()
val initialData = jsoup.getElementById("js-initialData")!!.html().to<JSONObject>()
val answer = initialData
.getJSONObject("initialState")
.getJSONObject("entities")
Expand Down

0 comments on commit 7a5e8e3

Please sign in to comment.