mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small fix
This commit is contained in:
parent
9b05f65f2c
commit
d89a7cfe2d
1 changed files with 30 additions and 2 deletions
|
@ -230,7 +230,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, "$directUrl/", subtitleCallback, callback)
|
if (!source.contains("youtube")) loadCustomExtractor(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...") {
|
||||||
|
@ -257,7 +257,7 @@ open class Movierulzhd : MainAPI() {
|
||||||
).parsed<ResponseHash>().embed_url
|
).parsed<ResponseHash>().embed_url
|
||||||
|
|
||||||
when {
|
when {
|
||||||
!source.contains("youtube") -> loadExtractor(
|
!source.contains("youtube") -> loadCustomExtractor(
|
||||||
source,
|
source,
|
||||||
"$directUrl/",
|
"$directUrl/",
|
||||||
subtitleCallback,
|
subtitleCallback,
|
||||||
|
@ -279,6 +279,34 @@ open class Movierulzhd : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private suspend fun loadCustomExtractor(
|
||||||
|
url: String,
|
||||||
|
referer: String? = null,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit,
|
||||||
|
quality: Int? = null,
|
||||||
|
) {
|
||||||
|
loadExtractor(url, referer, subtitleCallback) { link ->
|
||||||
|
if(link.quality == Qualities.Unknown.value) {
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
link.source,
|
||||||
|
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 tag: String? = null,
|
||||||
val type: String? = null,
|
val type: String? = null,
|
||||||
|
|
Loading…
Reference in a new issue