From a0fa64bd7b97dde2cfd6b6c0a82902e7e6177baf Mon Sep 17 00:00:00 2001 From: hexated Date: Fri, 11 Aug 2023 04:04:54 +0700 Subject: [PATCH] small fix --- Nekopoi/build.gradle.kts | 2 +- Nekopoi/src/main/kotlin/com/hexated/Nekopoi.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Nekopoi/build.gradle.kts b/Nekopoi/build.gradle.kts index 1d430492..0d3c4901 100644 --- a/Nekopoi/build.gradle.kts +++ b/Nekopoi/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 4 +version = 5 cloudstream { diff --git a/Nekopoi/src/main/kotlin/com/hexated/Nekopoi.kt b/Nekopoi/src/main/kotlin/com/hexated/Nekopoi.kt index f4721169..f0b8d55f 100644 --- a/Nekopoi/src/main/kotlin/com/hexated/Nekopoi.kt +++ b/Nekopoi/src/main/kotlin/com/hexated/Nekopoi.kt @@ -13,7 +13,7 @@ class Nekopoi : MainAPI() { override var name = "Nekopoi" override val hasMainPage = true override var lang = "id" - + private val fetch by lazy { Session(app.baseClient) } override val supportedTypes = setOf( TvType.NSFW, ) @@ -53,7 +53,7 @@ class Nekopoi : MainAPI() { page: Int, request: MainPageRequest ): HomePageResponse { - val document = app.get("${request.data}/page/$page").document + val document = fetch.get("${request.data}/page/$page").document val home = document.select("div.result ul li").mapNotNull { it.toSearchResult() } @@ -90,14 +90,14 @@ class Nekopoi : MainAPI() { } override suspend fun search(query: String): List { - return app.get("$mainUrl/search/$query").document.select("div.result ul li") + return fetch.get("$mainUrl/search/$query").document.select("div.result ul li") .mapNotNull { it.toSearchResult() } } override suspend fun load(url: String): LoadResponse { - val document = app.get(url).document + val document = fetch.get(url).document val title = document.selectFirst("span.desc b, div.eroinfo h1")?.text()?.trim() ?: "" val poster = fixUrlNull(document.selectFirst("div.imgdesc img, div.thm img")?.attr("src")) @@ -141,7 +141,7 @@ class Nekopoi : MainAPI() { callback: (ExtractorLink) -> Unit ): Boolean { - val res = app.get(data).document + val res = fetch.get(data).document argamap( {