From 212cf30cdb653f0eee17093f4750891ea5286290 Mon Sep 17 00:00:00 2001 From: Zaw <42999156+ImZaw@users.noreply.github.com> Date: Fri, 28 Oct 2022 01:25:46 +0200 Subject: [PATCH] Update FaselHDProvider.kt --- .../src/main/kotlin/com/faselhd/FaselHDProvider.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/FaselHDProvider/src/main/kotlin/com/faselhd/FaselHDProvider.kt b/FaselHDProvider/src/main/kotlin/com/faselhd/FaselHDProvider.kt index 12bf37a..1b6793d 100644 --- a/FaselHDProvider/src/main/kotlin/com/faselhd/FaselHDProvider.kt +++ b/FaselHDProvider/src/main/kotlin/com/faselhd/FaselHDProvider.kt @@ -48,11 +48,11 @@ class FaselHD : MainAPI() { override suspend fun getMainPage(page: Int, request : MainPageRequest): HomePageResponse { var doc = app.get(request.data + page).document - println(doc.select("title").text()) if(doc.select("title").text() == "Just a moment...") { println("Found Cloudflare.") doc = app.get(request.data + page, interceptor = CloudflareKiller()).document } + println("HTML: "+doc.html()) val list = doc.select("div[id=\"postList\"] div[class=\"col-xl-2 col-lg-2 col-md-3 col-sm-3\"]") .mapNotNull { element -> element.toSearchResponse() @@ -63,7 +63,6 @@ class FaselHD : MainAPI() { override suspend fun search(query: String): List { val q = query.replace(" ","+") var d = app.get("$mainUrl/?s=$q").document - println(d.select("title").text()) if(d.select("title").text() == "Just a moment...") { println("Found Cloudflare.") d = app.get("$mainUrl/?s=$q", interceptor = CloudflareKiller()).document @@ -77,7 +76,6 @@ class FaselHD : MainAPI() { override suspend fun load(url: String): LoadResponse { var doc = app.get(url).document - println(doc.select("title").text()) if(doc.select("title").text() == "Just a moment...") { println("Found Cloudflare.") doc = app.get(url, interceptor = CloudflareKiller()).document @@ -167,8 +165,7 @@ class FaselHD : MainAPI() { callback: (ExtractorLink) -> Unit ): Boolean { var doc = app.get(data).document - println(doc.select("title").text()) - if(doc.select("title").text() === "Just a moment...") { + if(doc.select("title").text() == "Just a moment...") { println("Found Cloudflare.") doc = app.get(data, interceptor = CloudflareKiller()).document } @@ -199,7 +196,7 @@ class FaselHD : MainAPI() { this.name, webView?.url.toString(), referer = mainUrl - ).forEach(callback) + ).toList().forEach(callback) } } return true