mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed #337
This commit is contained in:
parent
783ae437d1
commit
e30bce94ab
5 changed files with 13 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 18
|
||||
version = 19
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -18,7 +18,6 @@ class KuramanimeProvider : MainAPI() {
|
|||
override val hasDownloadSupport = true
|
||||
private var headers: Map<String,String> = mapOf()
|
||||
private var cookies: Map<String,String> = mapOf()
|
||||
private var misc: String? = null
|
||||
override val supportedTypes = setOf(
|
||||
TvType.Anime,
|
||||
TvType.AnimeMovie,
|
||||
|
@ -177,12 +176,12 @@ class KuramanimeProvider : MainAPI() {
|
|||
link,
|
||||
referer = "",
|
||||
quality = quality ?: Qualities.Unknown.value,
|
||||
headers = mapOf(
|
||||
"Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
|
||||
"Range" to "bytes=0-",
|
||||
"Sec-Fetch-Dest" to "video",
|
||||
"Sec-Fetch-Mode" to "no-cors",
|
||||
),
|
||||
// headers = mapOf(
|
||||
// "Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
|
||||
// "Range" to "bytes=0-",
|
||||
// "Sec-Fetch-Dest" to "video",
|
||||
// "Sec-Fetch-Mode" to "no-cors",
|
||||
// ),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -197,7 +196,7 @@ class KuramanimeProvider : MainAPI() {
|
|||
val req = app.get(data)
|
||||
val res = req.document
|
||||
val token = res.select("meta[name=csrf-token]").attr("content")
|
||||
val stRt = res.selectFirst("script:containsData(window\\.stRt)")?.data()?.substringAfter("stRt = \"")?.substringBefore("\"") ?: return false
|
||||
val stBt = res.selectFirst("script:containsData(stBk)")?.data()?.substringAfter("stBk = \"")?.substringBefore("\"")?.substringAfterLast("/") ?: return false
|
||||
headers = mapOf(
|
||||
"X-Requested-With" to "XMLHttpRequest",
|
||||
"X-CSRF-TOKEN" to token
|
||||
|
@ -205,7 +204,7 @@ class KuramanimeProvider : MainAPI() {
|
|||
cookies = req.cookies
|
||||
res.select("select#changeServer option").apmap { source ->
|
||||
val server = source.attr("value")
|
||||
val link = "$data?dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb=${getMisc(stRt)}&twEvZlbZbYRWBdKKwxkOnwYF0VWoGGVg=$server"
|
||||
val link = "$data?dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb=$stBt&twEvZlbZbYRWBdKKwxkOnwYF0VWoGGVg=$server"
|
||||
if (server.contains(Regex("(?i)kuramadrive|archive"))) {
|
||||
invokeLocalSource(link, server, data, callback)
|
||||
} else {
|
||||
|
@ -223,9 +222,4 @@ class KuramanimeProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
private suspend fun getMisc(url: String) = misc ?: fetchMisc(url)
|
||||
|
||||
private suspend fun fetchMisc(url: String): String {
|
||||
return app.post(url, headers = headers, cookies = cookies).parsed()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue