From 104306992e4670200e79319856de352051343586 Mon Sep 17 00:00:00 2001 From: hexated Date: Sun, 27 Nov 2022 13:41:05 +0700 Subject: [PATCH] try fixing UHDMovies --- SoraStream/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/SoraExtractor.kt | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index 89c96378..324a7fbe 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 39 +version = 40 cloudstream { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 2a5f2557..7c2feb9f 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -11,6 +11,7 @@ import com.lagradost.nicehttp.Session import com.lagradost.nicehttp.requestCreator import okhttp3.HttpUrl.Companion.toHttpUrl import com.google.gson.JsonParser +import com.lagradost.cloudstream3.network.CloudflareKiller import kotlinx.coroutines.delay import okhttp3.RequestBody.Companion.toRequestBody import java.net.URI @@ -1196,8 +1197,11 @@ object SoraExtractor : SoraStream() { subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ) { - - val doc = app.get("$uhdmoviesAPI/?s=$title").document + val url = "$uhdmoviesAPI/?s=$title" + var doc = app.get(url).document + if(doc.select("title").text() == "Just a moment...") { + doc = app.get(url, interceptor = CloudflareKiller()).document + } val scriptData = doc.select("div.row.gridlove-posts article").map { it.selectFirst("a")?.attr("href") to it.selectFirst("h1")?.text() } @@ -1231,7 +1235,7 @@ object SoraExtractor : SoraStream() { val base = getBaseUrl(iframe.first().third ?: return) iframe.apmap { (quality, size, link) -> - delay(1000) + delay(2000) val res = app.get(link ?: return@apmap null).document val resDoc = res.selectFirst("script")?.data()?.substringAfter("replace(\"") ?.substringBefore("\")")?.let {