diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt index a29b95e7..69f27ecd 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AnimePaheProvider.kt @@ -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 { val cookies = mutableMapOf() 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(req.text) + println("gggkk: $data") val qualities = ArrayList()