Update AnimePaheProvider.kt

This commit is contained in:
Arjix 2021-08-18 03:19:19 +03:00 committed by GitHub
parent d24a01b3c5
commit 8f9bb9f6f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -207,8 +207,8 @@ class AnimePaheProvider : MainAPI() {
)
}
} else {
for (page in 0..lastPage) {
for (i in 0..perPage) {
for (page in 0 until lastPage) {
for (i in 0 until perPage) {
if (ep <= total) {
episodes.add(
AnimeEpisode(
@ -295,6 +295,18 @@ class AnimePaheProvider : MainAPI() {
return s?.toIntOrNull() != null
}
private fun pow(base: Int, expo: Int): Long{
// does not handle infinity
var exponent = expo
var result: Long = 1
while (exponent != 0) {
result *= base.toLong()
--exponent
}
return result
}
private fun cookieStrToMap(cookie: String): Map<String, String> {
val cookies = mutableMapOf<String, String>()
for (string in cookie.split("; ")) {
@ -484,10 +496,11 @@ class AnimePaheProvider : MainAPI() {
null
}
}).filterNotNull())[0]
link = "https://animepahe.com/api?m=links&id=${ep?.animeId}&session=${ep?.session}&p=kwik"
link = "https://animepahe.com/api?m=links&id=${ep.animeId}&session=${ep.session}&p=kwik"
}
val req = khttp.get(link, headers = headers)
val data = mapper.readValue<AnimePaheEpisodeLoadLinks>(req.text)
println("gggkk: $data")
val qualities = ArrayList<ExtractorLink>()