try fixing UHDMovies

This commit is contained in:
hexated 2022-11-27 13:41:05 +07:00
parent d47fdeaadf
commit 104306992e
2 changed files with 8 additions and 4 deletions

View file

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

View file

@ -11,6 +11,7 @@ import com.lagradost.nicehttp.Session
import com.lagradost.nicehttp.requestCreator import com.lagradost.nicehttp.requestCreator
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
import com.google.gson.JsonParser import com.google.gson.JsonParser
import com.lagradost.cloudstream3.network.CloudflareKiller
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
import java.net.URI import java.net.URI
@ -1196,8 +1197,11 @@ object SoraExtractor : SoraStream() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val url = "$uhdmoviesAPI/?s=$title"
val doc = app.get("$uhdmoviesAPI/?s=$title").document 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 { val scriptData = doc.select("div.row.gridlove-posts article").map {
it.selectFirst("a")?.attr("href") to it.selectFirst("h1")?.text() it.selectFirst("a")?.attr("href") to it.selectFirst("h1")?.text()
} }
@ -1231,7 +1235,7 @@ object SoraExtractor : SoraStream() {
val base = getBaseUrl(iframe.first().third ?: return) val base = getBaseUrl(iframe.first().third ?: return)
iframe.apmap { (quality, size, link) -> iframe.apmap { (quality, size, link) ->
delay(1000) delay(2000)
val res = app.get(link ?: return@apmap null).document val res = app.get(link ?: return@apmap null).document
val resDoc = res.selectFirst("script")?.data()?.substringAfter("replace(\"") val resDoc = res.selectFirst("script")?.data()?.substringAfter("replace(\"")
?.substringBefore("\")")?.let { ?.substringBefore("\")")?.let {