mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed 9anime
This commit is contained in:
parent
c5406acc1e
commit
e6c76262b2
1 changed files with 6 additions and 14 deletions
|
@ -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<Response>()?.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<Response>()?.html
|
||||
?: throw ErrorLoadingException("Could not parse json with cipherKey=$cipherKey id=$id url=\n$episodeListUrl")
|
||||
|
||||
val subEpisodes = ArrayList<Episode>()
|
||||
val dubEpisodes = ArrayList<Episode>()
|
||||
|
|
Loading…
Reference in a new issue