improved Paradisehill searchResults

This commit is contained in:
hexated 2022-10-16 11:04:59 +07:00
parent f35f06f176
commit 3a657f880d
4 changed files with 30 additions and 16 deletions

View file

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

View file

@ -31,9 +31,11 @@ class GoodPorn : MainAPI() {
request: MainPageRequest
): HomePageResponse {
val document = app.get(request.data + page).document
val home = document.select("div#list_videos_most_recent_videos_items div.item, div#list_videos_common_videos_list_items div.item").mapNotNull {
it.toSearchResult()
}
val home =
document.select("div#list_videos_most_recent_videos_items div.item, div#list_videos_common_videos_list_items div.item")
.mapNotNull {
it.toSearchResult()
}
return newHomePageResponse(
list = HomePageList(
name = request.name,
@ -56,16 +58,19 @@ class GoodPorn : MainAPI() {
override suspend fun search(query: String): List<SearchResponse> {
val searchResponse = mutableListOf<SearchResponse>()
for (i in 1..10) {
for (i in 1..15) {
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 {
it.toSearchResult()
})
val results =
document.select("div#list_videos_videos_list_search_result_items div.item")
.mapNotNull {
it.toSearchResult()
}
searchResponse.addAll(results)
if (results.isEmpty()) break
}
return searchResponse
}
@ -106,7 +111,8 @@ class GoodPorn : MainAPI() {
ExtractorLink(
this.name,
this.name,
res.attr("href").replace(Regex("\\?download\\S+.mp4&"), "?") + "&rnd=${Date().time}" ,
res.attr("href")
.replace(Regex("\\?download\\S+.mp4&"), "?") + "&rnd=${Date().time}",
referer = data,
quality = Regex("([0-9]+p),").find(res.text())?.groupValues?.get(1)
.let { getQualityFromName(it) },

View file

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

View file

@ -10,6 +10,7 @@ class Paradisehill : MainAPI() {
override var name = "Paradisehill"
override val hasMainPage = true
override val hasDownloadSupport = true
override var sequentialMainPage = true
override val vpnStatus = VPNStatus.MightBeNeeded
override val supportedTypes = setOf(TvType.NSFW)
@ -48,11 +49,18 @@ class Paradisehill : MainAPI() {
}
override suspend fun search(query: String): List<SearchResponse> {
val document = app.get("$mainUrl/search/?pattern=$query&what=1").document
return document.select("div.content div.item")
.mapNotNull {
it.toSearchResult()
}
val searchResponse = mutableListOf<SearchResponse>()
for (i in 1..10) {
val document = app.get("$mainUrl/search/?pattern=$query&what=1&page=$i").document
val results = document.select("div.content div.item")
.mapNotNull {
it.toSearchResult()
}
searchResponse.addAll(results)
if(results.isEmpty()) break
}
return searchResponse
}
override suspend fun load(url: String): LoadResponse? {