mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small fix
This commit is contained in:
parent
0e3f20c251
commit
a0fa64bd7b
2 changed files with 6 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 4
|
version = 5
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Nekopoi : MainAPI() {
|
||||||
override var name = "Nekopoi"
|
override var name = "Nekopoi"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override var lang = "id"
|
override var lang = "id"
|
||||||
|
private val fetch by lazy { Session(app.baseClient) }
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
TvType.NSFW,
|
TvType.NSFW,
|
||||||
)
|
)
|
||||||
|
@ -53,7 +53,7 @@ class Nekopoi : MainAPI() {
|
||||||
page: Int,
|
page: Int,
|
||||||
request: MainPageRequest
|
request: MainPageRequest
|
||||||
): HomePageResponse {
|
): 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 {
|
val home = document.select("div.result ul li").mapNotNull {
|
||||||
it.toSearchResult()
|
it.toSearchResult()
|
||||||
}
|
}
|
||||||
|
@ -90,14 +90,14 @@ class Nekopoi : MainAPI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun search(query: String): List<SearchResponse> {
|
override suspend fun search(query: String): List<SearchResponse> {
|
||||||
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 {
|
.mapNotNull {
|
||||||
it.toSearchResult()
|
it.toSearchResult()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse {
|
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 title = document.selectFirst("span.desc b, div.eroinfo h1")?.text()?.trim() ?: ""
|
||||||
val poster = fixUrlNull(document.selectFirst("div.imgdesc img, div.thm img")?.attr("src"))
|
val poster = fixUrlNull(document.selectFirst("div.imgdesc img, div.thm img")?.attr("src"))
|
||||||
|
@ -141,7 +141,7 @@ class Nekopoi : MainAPI() {
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
): Boolean {
|
): Boolean {
|
||||||
|
|
||||||
val res = app.get(data).document
|
val res = fetch.get(data).document
|
||||||
|
|
||||||
argamap(
|
argamap(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue