mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
added new sources into Kuramanime & Oploverz
This commit is contained in:
parent
285eb25bc8
commit
4edcde11b0
5 changed files with 88 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 7
|
||||
version = 8
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -11,5 +11,6 @@ class KuramanimeProviderPlugin: Plugin() {
|
|||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(KuramanimeProvider())
|
||||
registerExtractorAPI(Nyomo())
|
||||
registerExtractorAPI(Streamhide())
|
||||
}
|
||||
}
|
|
@ -3,5 +3,11 @@ package com.hexated
|
|||
import com.lagradost.cloudstream3.extractors.StreamSB
|
||||
|
||||
class Nyomo : StreamSB() {
|
||||
override var name: String = "Nyomo"
|
||||
override var mainUrl = "https://nyomo.my.id"
|
||||
}
|
||||
|
||||
class Streamhide : StreamSB() {
|
||||
override var name: String = "Streamhide"
|
||||
override var mainUrl: String = "https://streamhide.to"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 5
|
||||
version = 6
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -25,6 +25,9 @@ class OploverzProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
const val acefile = "https://acefile.co"
|
||||
const val linkbox = "https://www.linkbox.to"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return when {
|
||||
t.contains("TV") -> TvType.Anime
|
||||
|
@ -183,6 +186,27 @@ 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(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
|
@ -190,17 +214,54 @@ class OploverzProvider : MainAPI() {
|
|||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
val document = app.get(data).document
|
||||
val sources = document.select(".mobius > .mirror > option").mapNotNull {
|
||||
fixUrl(Jsoup.parse(base64Decode(it.attr("value"))).select("iframe").attr("src"))
|
||||
}
|
||||
val sources = mutableListOf<Pair<String?, String>>()
|
||||
|
||||
sources.apmap {
|
||||
loadExtractor(it, data, subtitleCallback, callback)
|
||||
val streamingSources = document.select(".mobius > .mirror > option").mapNotNull {
|
||||
"" to fixUrl(Jsoup.parse(base64Decode(it.attr("value"))).select("iframe").attr("src"))
|
||||
}
|
||||
if (streamingSources.isNotEmpty()) sources.addAll(streamingSources)
|
||||
|
||||
val downloadSources =
|
||||
document.select("div.bixbox div.soraddlx.soradlg").lastOrNull()?.select("div.soraurlx")
|
||||
?.map { item ->
|
||||
item.select("a").map { item.select("strong").text() to it.attr("href") }
|
||||
}?.flatten()
|
||||
if (downloadSources?.isNotEmpty() == true) sources.addAll(downloadSources)
|
||||
|
||||
sources.apmap { (quality, source) ->
|
||||
if(source.startsWith(linkbox)) {
|
||||
invokeLinkbox(source, data, quality, callback)
|
||||
} else {
|
||||
loadExtractor(fixedIframe(source), data, subtitleCallback) { link ->
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
link.name,
|
||||
link.name,
|
||||
link.url,
|
||||
link.referer,
|
||||
if (source.startsWith(acefile)) getQualityFromName(quality) else link.quality,
|
||||
link.isM3u8,
|
||||
link.headers,
|
||||
link.extractorData
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
private fun fixedIframe(url: String): String {
|
||||
return if (url.startsWith(acefile)) {
|
||||
Regex("""/f/(\S+)/|/file/(\S+)/""").find(url)?.groupValues?.getOrNull(1).let { id ->
|
||||
"$acefile/player/$id"
|
||||
}
|
||||
} else {
|
||||
url
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
|
@ -238,4 +299,17 @@ class OploverzProvider : MainAPI() {
|
|||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
data class RList(
|
||||
@JsonProperty("url") val url: String,
|
||||
@JsonProperty("resolution") val resolution: String?,
|
||||
)
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("rList") val rList: List<RList>?,
|
||||
)
|
||||
|
||||
data class Responses(
|
||||
@JsonProperty("data") val data: Data?,
|
||||
)
|
||||
|
||||
}
|
Loading…
Reference in a new issue