From e6c76262b2cd1a29440e13c64cd2fd9005e46bbe Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Tue, 2 Aug 2022 15:48:19 +0200 Subject: [PATCH] fixed 9anime --- .../animeproviders/NineAnimeProvider.kt | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt index 73293b8d..37a973f4 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/NineAnimeProvider.kt @@ -20,25 +20,16 @@ class NineAnimeProvider : MainAPI() { // taken from https://github.com/saikou-app/saikou/blob/b35364c8c2a00364178a472fccf1ab72f09815b4/app/src/main/java/ani/saikou/parsers/anime/NineAnime.kt // GNU General Public License v3.0 https://github.com/saikou-app/saikou/blob/main/LICENSE.md companion object { - fun getDubStatus(title: String): DubStatus { - return if (title.contains("(dub)", ignoreCase = true)) { - DubStatus.Dubbed - } else { - DubStatus.Subbed - } - } - - private const val nineAnimeKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - private const val cipherKey = "rTKp3auwu0ULA6II" + private const val cipherKey = "kMXzgyNzT3k5dYab" fun encodeVrf(text: String, mainKey: String): String { return encode( encrypt( cipher(mainKey, encode(text)), nineAnimeKey - ).replace("""=+$""".toRegex(), "") + )//.replace("""=+$""".toRegex(), "") ) } @@ -238,9 +229,10 @@ class NineAnimeProvider : MainAPI() { ?: throw ErrorLoadingException("Could not find title") val vrf = encodeVrf(id, cipherKey) - val req = app.get("$mainUrl/ajax/episode/list/$id?vrf=$vrf") - val body = req.parsedSafe()?.html - ?: throw ErrorLoadingException("Could not parse json with cipherKey=$cipherKey code=${req.code}") + val episodeListUrl = "$mainUrl/ajax/episode/list/$id?vrf=$vrf" + val body = + app.get(episodeListUrl).parsedSafe()?.html + ?: throw ErrorLoadingException("Could not parse json with cipherKey=$cipherKey id=$id url=\n$episodeListUrl") val subEpisodes = ArrayList() val dubEpisodes = ArrayList()