improved Goodporn search result

This commit is contained in:
hexated 2022-10-16 06:11:19 +07:00
parent 43ee5fda88
commit 7451d3fa99
2 changed files with 14 additions and 6 deletions

View file

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

View file

@ -55,11 +55,19 @@ class GoodPorn : MainAPI() {
} }
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val document = app.get("$mainUrl/search/$query").document val searchResponse = mutableListOf<SearchResponse>()
return document.select("div#list_videos_videos_list_search_result_items div.item") for (i in 1..10) {
val document =
app.get(
"$mainUrl/search/nikki-benz/?mode=async&function=get_block&block_id=list_videos_videos_list_search_result&q=$query&category_ids=&sort_by=&from_videos=$i&from_albums=$i",
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
).document
searchResponse.addAll(document.select("div#list_videos_videos_list_search_result_items div.item")
.mapNotNull { .mapNotNull {
it.toSearchResult() it.toSearchResult()
})
} }
return searchResponse
} }
override suspend fun load(url: String): LoadResponse { override suspend fun load(url: String): LoadResponse {