Oploverz: Updated source

This commit is contained in:
hexated 2023-02-24 19:18:52 +07:00
parent d1b117540f
commit c82488fcbc
3 changed files with 20 additions and 46 deletions

View file

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

View file

@ -25,7 +25,7 @@ class OploverzProvider : MainAPI() {
companion object { companion object {
const val acefile = "https://acefile.co" const val acefile = "https://acefile.co"
const val linkbox = "https://www.linkbox.to" const val linkbox = "https://lbx.to"
fun getType(t: String): TvType { fun getType(t: String): TvType {
return when { return when {
@ -185,27 +185,6 @@ class OploverzProvider : MainAPI() {
} }
private suspend fun invokeLinkbox(
url: String,
referer: String,
quality: String? = null,
callback: (ExtractorLink) -> Unit
) {
val id = Regex("""(/file/|id=)(\S+)""").find(url)?.groupValues?.get(2)
app.get("$linkbox/api/open/get_url?itemId=$id", referer = url)
.parsedSafe<Responses>()?.data?.rList?.map { link ->
callback.invoke(
ExtractorLink(
"Linkbox",
"Linkbox",
link.url,
referer,
getQualityFromName(quality),
)
)
}
}
override suspend fun loadLinks( override suspend fun loadLinks(
data: String, data: String,
isCasting: Boolean, isCasting: Boolean,
@ -228,23 +207,19 @@ class OploverzProvider : MainAPI() {
if (downloadSources?.isNotEmpty() == true) sources.addAll(downloadSources) if (downloadSources?.isNotEmpty() == true) sources.addAll(downloadSources)
sources.apmap { (quality, source) -> sources.apmap { (quality, source) ->
if(source.startsWith(linkbox)) { loadExtractor(fixedIframe(source), data, subtitleCallback) { link ->
invokeLinkbox(source, data, quality, callback) callback.invoke(
} else { ExtractorLink(
loadExtractor(fixedIframe(source), data, subtitleCallback) { link -> link.name,
callback.invoke( link.name,
ExtractorLink( link.url,
link.name, link.referer,
link.name, if (source.startsWith(acefile)) getQualityFromName(quality) else link.quality,
link.url, link.isM3u8,
link.referer, link.headers,
if (source.startsWith(acefile)) getQualityFromName(quality) else link.quality, link.extractorData
link.isM3u8,
link.headers,
link.extractorData
)
) )
} )
} }
} }
@ -252,12 +227,11 @@ class OploverzProvider : MainAPI() {
} }
private fun fixedIframe(url: String): String { private fun fixedIframe(url: String): String {
return if (url.startsWith(acefile)) { val id = Regex("""/f/(\S+)/|/file/(\S+)/""").find(url)?.groupValues?.getOrNull(1)
Regex("""/f/(\S+)/|/file/(\S+)/""").find(url)?.groupValues?.getOrNull(1).let { id -> return when {
"$acefile/player/$id" url.startsWith(acefile) -> "$acefile/player/$id"
} url.startsWith(linkbox) -> "https://www.linkbox.to/a/f/$id"
} else { else -> url
url
} }
} }

View file

@ -2628,7 +2628,7 @@ class Sblongvu : StreamSB() {
} }
class Keephealth : StreamSB() { class Keephealth : StreamSB() {
override var name = "Kimcartoon" override var name = "Keephealth"
override var mainUrl = "https://keephealth.info" override var mainUrl = "https://keephealth.info"
} }