This commit is contained in:
jack 2023-11-15 12:22:01 +07:00
parent 5e544d99a1
commit cdd4471ab7

View file

@ -174,7 +174,7 @@ open class Movierulzhd : MainAPI() {
val post = it.attr("data-post") val post = it.attr("data-post")
val nume = it.attr("data-nume") val nume = it.attr("data-nume")
Episode( Episode(
LinkData(type, post, nume).toJson(), LinkData(name, type, post, nume).toJson(),
name, name,
) )
} }
@ -231,7 +231,7 @@ open class Movierulzhd : MainAPI() {
referer = data, referer = data,
headers = mapOf("X-Requested-With" to "XMLHttpRequest") headers = mapOf("X-Requested-With" to "XMLHttpRequest")
).parsed<ResponseHash>().embed_url ).parsed<ResponseHash>().embed_url
if (!source.contains("youtube")) loadExtractor(source, data, subtitleCallback, callback) if (!source.contains("youtube")) loadCustomExtractor(loadData?.tag, source, "$directUrl/", subtitleCallback, callback)
} else { } else {
var document = app.get(data).document var document = app.get(data).document
if (document.select("title").text() == "Just a moment...") { if (document.select("title").text() == "Just a moment...") {
@ -241,8 +241,8 @@ open class Movierulzhd : MainAPI() {
val type = if (data.contains("/movies/")) "movie" else "tv" val type = if (data.contains("/movies/")) "movie" else "tv"
document.select("ul#playeroptionsul > li").map { document.select("ul#playeroptionsul > li").map {
it.attr("data-nume") it.attr("data-nume") to it.select("span.title").text()
}.apmap { nume -> }.apmap { (nume, tag) ->
val source = app.post( val source = app.post(
url = "$directUrl/wp-admin/admin-ajax.php", url = "$directUrl/wp-admin/admin-ajax.php",
data = mapOf( data = mapOf(
@ -256,9 +256,10 @@ open class Movierulzhd : MainAPI() {
).parsed<ResponseHash>().embed_url ).parsed<ResponseHash>().embed_url
when { when {
!source.contains("youtube") -> loadExtractor( !source.contains("youtube") -> loadCustomExtractor(
tag,
source, source,
data, "$directUrl/",
subtitleCallback, subtitleCallback,
callback callback
) )
@ -269,7 +270,35 @@ open class Movierulzhd : MainAPI() {
return true return true
} }
private suspend fun loadCustomExtractor(
name: String? = null,
url: String,
referer: String? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit,
quality: Int? = null,
) {
loadExtractor(url, referer, subtitleCallback) { link ->
callback.invoke(
ExtractorLink(
name ?: link.source,
name ?: link.name,
link.url,
link.referer,
when (link.type) {
ExtractorLinkType.M3U8 -> link.quality
else -> quality ?: link.quality
},
link.type,
link.headers,
link.extractorData
)
)
}
}
data class LinkData( data class LinkData(
val tag: String? = null,
val type: String? = null, val type: String? = null,
val post: String? = null, val post: String? = null,
val nume: String? = null, val nume: String? = null,