fixed Movierulzhd

This commit is contained in:
hexated 2022-09-14 01:42:47 +07:00
parent f9aef12a03
commit 7dfb3b7b64
2 changed files with 25 additions and 18 deletions

View file

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

View file

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.extractors.StreamSB
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element
@ -32,7 +33,8 @@ class Movierulzhd : MainAPI() {
request: MainPageRequest
): HomePageResponse {
val document = app.get(request.data + page).document
val home = document.select("div.items.normal article, div#archive-content article").mapNotNull {
val home =
document.select("div.items.normal article, div#archive-content article").mapNotNull {
it.toSearchResult()
}
return newHomePageResponse(request.name, home)
@ -162,7 +164,8 @@ class Movierulzhd : MainAPI() {
val mainUrl = "https://sbflix.xyz"
val name = "Sbflix"
val regexID = Regex("(embed-[a-zA-Z0-9]{0,8}[a-zA-Z0-9_-]+|\\/e\\/[a-zA-Z0-9]{0,8}[a-zA-Z0-9_-]+)")
val regexID =
Regex("(embed-[a-zA-Z0-9]{0,8}[a-zA-Z0-9_-]+|\\/e\\/[a-zA-Z0-9]{0,8}[a-zA-Z0-9_-]+)")
val id = regexID.findAll(url).map {
it.value.replace(Regex("(embed-|\\/e\\/)"), "")
}.first()
@ -170,11 +173,14 @@ class Movierulzhd : MainAPI() {
val headers = mapOf(
"watchsb" to "sbstream",
)
val urltext = app.get(master.lowercase(),
val urltext = app.get(
master.lowercase(),
headers = headers,
referer = url,
).text
val mapped = urltext.let { AppUtils.parseJson<Main>(it) }
val testurl = app.get(mapped.streamData.file, headers = headers).text
if (urltext.contains("m3u8") && testurl.contains("EXTM3U"))
callback.invoke(
ExtractorLink(
name,
@ -182,6 +188,7 @@ class Movierulzhd : MainAPI() {
mapped.streamData.file,
url,
Qualities.Unknown.value,
isM3u8 = true,
headers = headers
)
)