This commit is contained in:
jack 2023-12-01 02:03:08 +07:00
parent b9fd6d8a02
commit cc2cc118d2
2 changed files with 7 additions and 4 deletions

View file

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

View file

@ -229,14 +229,17 @@ class KuramanimeProvider : MainAPI() {
}
private suspend fun fetchAuth(url: String) : Pair<String?,String?> {
val regex = Regex("""$mainUrl/(?!anime|assets|images|misc|cf-fonts)\w+""")
val found = WebViewResolver(
Regex("""$mainUrl/(?!anime|assets|images)\w+""")
Regex("""dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb"""),
additionalUrls = listOf(regex)
).resolveUsingWebView(
requestCreator(
"GET", url
)
).first
return found?.url.toString() to found?.headers?.get("Authorization")
)
val foundUrl = found.second.last()
return foundUrl.url.toString() to foundUrl.headers["Authorization"]
}
private suspend fun getAuth(url: String) = auth ?: fetchAuth(url).also { auth = it }