Nimegami: fix search

This commit is contained in:
alex 2024-01-16 20:05:49 +07:00
parent 7253111d3e
commit 740c47223a
2 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 8
version = 9
cloudstream {

View File

@ -76,14 +76,18 @@ class Nimegami : MainAPI() {
this.posterUrl = posterUrl
addSub(episode)
}
}
override suspend fun search(query: String): List<SearchResponse> {
return app.get("$mainUrl/?s=$query&post_type=post").document.select("div.archive article")
.mapNotNull {
it.toSearchResult()
}
val searchResponse = mutableListOf<SearchResponse>()
for (i in 1..2) {
val res = app.get("$mainUrl/page/$i/?s=gintama&post_type=post").document.select("div.archive article")
.mapNotNull {
it.toSearchResult()
}
searchResponse.addAll(res)
}
return searchResponse
}
override suspend fun load(url: String): LoadResponse {