f up kuramanime

This commit is contained in:
jack 2023-12-01 05:19:52 +07:00
parent e644456bc6
commit 3d6520cdef
4 changed files with 141 additions and 25 deletions

View file

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

View file

@ -1,7 +1,14 @@
package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.Filesim
import com.lagradost.cloudstream3.extractors.StreamSB
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.getQualityFromName
class Nyomo : StreamSB() {
override var name: String = "Nyomo"
@ -12,3 +19,100 @@ class Streamhide : Filesim() {
override var name: String = "Streamhide"
override var mainUrl: String = "https://streamhide.to"
}
open class Lbx : ExtractorApi() {
override val name = "Linkbox"
override val mainUrl = "https://lbx.to"
private val realUrl = "https://www.linkbox.to"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val token = Regex("""(?:/f/|/file/|\?id=)(\w+)""").find(url)?.groupValues?.get(1)
val id = app.get("$realUrl/api/file/share_out_list/?sortField=utime&sortAsc=0&pageNo=1&pageSize=50&shareToken=$token").parsedSafe<Responses>()?.data?.itemId
app.get("$realUrl/api/file/detail?itemId=$id", referer = url)
.parsedSafe<Responses>()?.data?.itemInfo?.resolutionList?.map { link ->
callback.invoke(
ExtractorLink(
name,
name,
link.url ?: return@map null,
"$realUrl/",
getQualityFromName(link.resolution)
)
)
}
}
data class Resolutions(
@JsonProperty("url") val url: String? = null,
@JsonProperty("resolution") val resolution: String? = null,
)
data class ItemInfo(
@JsonProperty("resolutionList") val resolutionList: ArrayList<Resolutions>? = arrayListOf(),
)
data class Data(
@JsonProperty("itemInfo") val itemInfo: ItemInfo? = null,
@JsonProperty("itemId") val itemId: String? = null,
)
data class Responses(
@JsonProperty("data") val data: Data? = null,
)
}
open class Kuramadrive : ExtractorApi() {
override val name = "DriveKurama"
override val mainUrl = "https://kuramadrive.com"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val req = app.get(url, referer = referer)
val doc = req.document
val title = doc.select("title").text()
val token = doc.select("meta[name=csrf-token]").attr("content")
val routeCheckAvl = doc.select("input#routeCheckAvl").attr("value")
val json = app.post(
routeCheckAvl, headers = mapOf(
"X-Requested-With" to "XMLHttpRequest",
"X-CSRF-TOKEN" to token
),
referer = url,
cookies = req.cookies
).parsedSafe<Source>()
callback.invoke(
ExtractorLink(
name,
name,
json?.url ?: return,
"$mainUrl/",
getIndexQuality(title),
)
)
}
private fun getIndexQuality(str: String?): Int {
return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull()
?: Qualities.Unknown.value
}
private data class Source(
@JsonProperty("url") val url: String,
)
}

View file

@ -200,6 +200,9 @@ class KuramanimeProvider : MainAPI() {
val req = app.get(data)
val res = req.document
argamap(
{
val token = res.select("meta[name=csrf-token]").attr("content")
val auth = getAuth(data)
headers = mapOf(
@ -226,6 +229,13 @@ class KuramanimeProvider : MainAPI() {
}
}
}
},
{
res.select("div#animeDownloadLink a").apmap {
loadExtractor(it.attr("href"), "$mainUrl/", subtitleCallback, callback)
}
}
)
return true
}

View file

@ -12,5 +12,7 @@ class KuramanimeProviderPlugin: Plugin() {
registerMainAPI(KuramanimeProvider())
registerExtractorAPI(Nyomo())
registerExtractorAPI(Streamhide())
registerExtractorAPI(Kuramadrive())
registerExtractorAPI(Lbx())
}
}