Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjohn committed Dec 1, 2023
1 parent d69d3c9 commit 9f81efb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class KuramanimeProvider : MainAPI() {
}

private suspend fun fetchAuth(url: String) : AuthParams {
val regex = Regex("""$mainUrl/(?!anime/|assets/|images/|misc/|cf-fonts/)\w+""")
val regex = Regex("""$mainUrl/\S+""")
val found = WebViewResolver(
Regex("""$url(?!\?page=)\?"""),
additionalUrls = listOf(regex)
Expand All @@ -250,8 +250,8 @@ class KuramanimeProvider : MainAPI() {
"GET", url
)
)
val addition = found.second.last()
return AuthParams(found.first?.url, addition.url.toString(), addition.headers["Authorization"])
val addition = found.second.find { !it.headers["Authorization"].isNullOrBlank() }
return AuthParams(found.first?.url, addition?.url.toString(), addition?.headers?.get("Authorization"))
}

private suspend fun getAuth(url: String) = params ?: fetchAuth(url).also { params = it }
Expand Down

0 comments on commit 9f81efb

Please sign in to comment.