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 // use an integer for version numbers
version = 4 version = 5
cloudstream { cloudstream {

View file

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.extractors.StreamSB
import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
@ -32,7 +33,8 @@ class Movierulzhd : MainAPI() {
request: MainPageRequest request: MainPageRequest
): HomePageResponse { ): HomePageResponse {
val document = app.get(request.data + page).document 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() it.toSearchResult()
} }
return newHomePageResponse(request.name, home) return newHomePageResponse(request.name, home)
@ -162,19 +164,23 @@ class Movierulzhd : MainAPI() {
val mainUrl = "https://sbflix.xyz" val mainUrl = "https://sbflix.xyz"
val name = "Sbflix" 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 { val id = regexID.findAll(url).map {
it.value.replace(Regex("(embed-|\\/e\\/)"),"") it.value.replace(Regex("(embed-|\\/e\\/)"), "")
}.first() }.first()
val master = "$mainUrl/sources48/" + bytesToHex("||$id||||streamsb".toByteArray()) + "/" val master = "$mainUrl/sources48/" + bytesToHex("||$id||||streamsb".toByteArray()) + "/"
val headers = mapOf( val headers = mapOf(
"watchsb" to "sbstream", "watchsb" to "sbstream",
) )
val urltext = app.get(master.lowercase(), val urltext = app.get(
master.lowercase(),
headers = headers, headers = headers,
referer = url, referer = url,
).text ).text
val mapped = urltext.let { AppUtils.parseJson<Main>(it) } 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( callback.invoke(
ExtractorLink( ExtractorLink(
name, name,
@ -182,6 +188,7 @@ class Movierulzhd : MainAPI() {
mapped.streamData.file, mapped.streamData.file,
url, url,
Qualities.Unknown.value, Qualities.Unknown.value,
isM3u8 = true,
headers = headers headers = headers
) )
) )
@ -247,12 +254,12 @@ class Movierulzhd : MainAPI() {
return String(hexChars) return String(hexChars)
} }
data class Subs ( data class Subs(
@JsonProperty("file") val file: String, @JsonProperty("file") val file: String,
@JsonProperty("label") val label: String, @JsonProperty("label") val label: String,
) )
data class StreamData ( data class StreamData(
@JsonProperty("file") val file: String, @JsonProperty("file") val file: String,
@JsonProperty("cdn_img") val cdnImg: String, @JsonProperty("cdn_img") val cdnImg: String,
@JsonProperty("hash") val hash: String, @JsonProperty("hash") val hash: String,
@ -263,7 +270,7 @@ class Movierulzhd : MainAPI() {
@JsonProperty("backup") val backup: String, @JsonProperty("backup") val backup: String,
) )
data class Main ( data class Main(
@JsonProperty("stream_data") val streamData: StreamData, @JsonProperty("stream_data") val streamData: StreamData,
@JsonProperty("status_code") val statusCode: Int, @JsonProperty("status_code") val statusCode: Int,
) )