Skip to content

Commit

Permalink
Update Eporner search
Browse files Browse the repository at this point in the history
  • Loading branch information
owencz1998 authored Jan 7, 2025
1 parent c124ad4 commit 6ead968
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions Eporner/src/main/kotlin/com/owencz1998/Eporner.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.owencz1998
package com.Eporner

import org.jsoup.nodes.Element
import com.lagradost.cloudstream3.*
Expand All @@ -25,9 +25,8 @@ class Eporner : MainAPI() {
"cat/japanese" to "Japanese",
"cat/hd-1080p" to "1080 Porn",
"cat/4k-porn" to "4K Porn",
"cat/babysitter" to "Baby Sitter",
"cat/big-tits" to "Big Tits",
"cat/teen" to "Teen"
"channel/perved-family" to "Perved Family",
"recommendations" to "Recommendation Videos",

)

Expand Down Expand Up @@ -59,10 +58,24 @@ class Eporner : MainAPI() {

override suspend fun search(query: String): List<SearchResponse> {
val subquery=query.replace(" ","-")
val document = app.get("${mainUrl}/search/$subquery/").document
val results = document.select("div.mb").mapNotNull {
it.toSearchResult() }
return results
val searchResponse = mutableListOf<SearchResponse>()

for (i in 1..10) {
val document = app.get("${mainUrl}/search/$subquery/$i").document
//val document = app.get("${mainUrl}/page/$i/?s=$query").document

val results = document.select("div.mb").mapNotNull {
it.toSearchResult() }

if (!searchResponse.containsAll(results)) {
searchResponse.addAll(results)
} else {
break
}

if (results.isEmpty()) break
}
return searchResponse
}

override suspend fun load(url: String): LoadResponse {
Expand Down

0 comments on commit 6ead968

Please sign in to comment.