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 { } else {
for (page in 0..lastPage) { for (page in 0 until lastPage) {
for (i in 0..perPage) { for (i in 0 until perPage) {
if (ep <= total) { if (ep <= total) {
episodes.add( episodes.add(
AnimeEpisode( AnimeEpisode(
@ -295,6 +295,18 @@ class AnimePaheProvider : MainAPI() {
return s?.toIntOrNull() != null 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> { private fun cookieStrToMap(cookie: String): Map<String, String> {
val cookies = mutableMapOf<String, String>() val cookies = mutableMapOf<String, String>()
for (string in cookie.split("; ")) { for (string in cookie.split("; ")) {
@ -484,10 +496,11 @@ class AnimePaheProvider : MainAPI() {
null null
} }
}).filterNotNull())[0] }).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 req = khttp.get(link, headers = headers)
val data = mapper.readValue<AnimePaheEpisodeLoadLinks>(req.text) val data = mapper.readValue<AnimePaheEpisodeLoadLinks>(req.text)
println("gggkk: $data")
val qualities = ArrayList<ExtractorLink>() val qualities = ArrayList<ExtractorLink>()