9anime, animeonsen: fix init
This commit is contained in:
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'AnimeOnsen'
|
extName = 'AnimeOnsen'
|
||||||
pkgNameSuffix = 'all.animeonsen'
|
pkgNameSuffix = 'all.animeonsen'
|
||||||
extClass = '.AnimeOnsen'
|
extClass = '.AnimeOnsen'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ import kotlinx.serialization.json.Json
|
|||||||
import kotlinx.serialization.json.boolean
|
import kotlinx.serialization.json.boolean
|
||||||
import kotlinx.serialization.json.jsonPrimitive
|
import kotlinx.serialization.json.jsonPrimitive
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import rx.Observable
|
import rx.Observable
|
||||||
@ -40,9 +39,11 @@ class AnimeOnsen : AnimeHttpSource() {
|
|||||||
|
|
||||||
private val cfClient = network.cloudflareClient
|
private val cfClient = network.cloudflareClient
|
||||||
|
|
||||||
override val client: OkHttpClient = network.client.newBuilder()
|
override val client by lazy {
|
||||||
.addInterceptor(AOAPIInterceptor(cfClient))
|
network.client.newBuilder()
|
||||||
.build()
|
.addInterceptor(AOAPIInterceptor(cfClient))
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
|
||||||
private val json = Json {
|
private val json = Json {
|
||||||
ignoreUnknownKeys = true
|
ignoreUnknownKeys = true
|
||||||
|
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = '9anime'
|
extName = '9anime'
|
||||||
pkgNameSuffix = 'en.nineanime'
|
pkgNameSuffix = 'en.nineanime'
|
||||||
extClass = '.NineAnime'
|
extClass = '.NineAnime'
|
||||||
extVersionCode = 21
|
extVersionCode = 22
|
||||||
libVersion = '13'
|
libVersion = '13'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import kotlinx.serialization.json.Json
|
|||||||
import kotlinx.serialization.json.JsonObject
|
import kotlinx.serialization.json.JsonObject
|
||||||
import kotlinx.serialization.json.jsonPrimitive
|
import kotlinx.serialization.json.jsonPrimitive
|
||||||
|
|
||||||
const val fallbackcipherKey = "xtbmecCv4faAOSLV"
|
const val fallbackcipherKey = "mcYrOtBqfRISotfM"
|
||||||
const val fallbackdecipherKey = "hlPeNwkncH0fq9so"
|
const val fallbackdecipherKey = "hlPeNwkncH0fq9so"
|
||||||
|
|
||||||
fun getKeys(allJsScript: String, json: Json): Pair<String, String> {
|
fun getKeys(allJsScript: String, json: Json): Pair<String, String> {
|
||||||
|
@ -373,10 +373,7 @@ class NineAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
|
|
||||||
private fun decode(input: String): String = java.net.URLDecoder.decode(input, "utf-8")
|
private fun decode(input: String): String = java.net.URLDecoder.decode(input, "utf-8")
|
||||||
|
|
||||||
private val cipherKey: String
|
private val keys by lazy {
|
||||||
private val decipherKey: String
|
|
||||||
|
|
||||||
init {
|
|
||||||
val allJsScript = runBlocking {
|
val allJsScript = runBlocking {
|
||||||
client.newCall(
|
client.newCall(
|
||||||
GET(
|
GET(
|
||||||
@ -385,9 +382,13 @@ class NineAnime : ConfigurableAnimeSource, ParsedAnimeHttpSource() {
|
|||||||
)
|
)
|
||||||
).execute().body!!.string()
|
).execute().body!!.string()
|
||||||
}
|
}
|
||||||
val keys = getKeys(allJsScript, json)
|
getKeys(allJsScript, json)
|
||||||
cipherKey = keys.first
|
}
|
||||||
decipherKey = keys.second
|
private val cipherKey by lazy {
|
||||||
|
keys.first
|
||||||
|
}
|
||||||
|
private val decipherKey by lazy {
|
||||||
|
keys.second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user