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 // use an integer for version numbers
version = 26 version = 27
cloudstream { cloudstream {

View File

@ -229,14 +229,17 @@ class KuramanimeProvider : MainAPI() {
} }
private suspend fun fetchAuth(url: String) : Pair<String?,String?> { private suspend fun fetchAuth(url: String) : Pair<String?,String?> {
val regex = Regex("""$mainUrl/(?!anime|assets|images|misc|cf-fonts)\w+""")
val found = WebViewResolver( val found = WebViewResolver(
Regex("""$mainUrl/(?!anime|assets|images)\w+""") Regex("""dfgRr1OagZvvxbzHNpyCy0FqJQ18mCnb"""),
additionalUrls = listOf(regex)
).resolveUsingWebView( ).resolveUsingWebView(
requestCreator( requestCreator(
"GET", url "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 } private suspend fun getAuth(url: String) = auth ?: fetchAuth(url).also { auth = it }