parent
ed2006b83f
commit
f1a13486c8
3 changed files with 17 additions and 3 deletions
|
@ -5,6 +5,8 @@ import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
import eu.kanade.tachiyomi.lib.cryptoaes.CryptoAES.decryptWithSalt
|
import eu.kanade.tachiyomi.lib.cryptoaes.CryptoAES.decryptWithSalt
|
||||||
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
|
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.util.parseAs
|
||||||
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
@ -27,6 +29,7 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea
|
||||||
|
|
||||||
// matches "[language]https://...,"
|
// matches "[language]https://...,"
|
||||||
private val REGEX_SUBS by lazy { Regex("""\[(.*?)\](.*?)"?\,""") }
|
private val REGEX_SUBS by lazy { Regex("""\[(.*?)\](.*?)"?\,""") }
|
||||||
|
private const val KEY_SOURCE = "https://rowdy-avocado.github.io/multi-keys/"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun videoFromUrl(url: String, referer: String, prefix: String = "Chillx - "): List<Video> {
|
fun videoFromUrl(url: String, referer: String, prefix: String = "Chillx - "): List<Video> {
|
||||||
|
@ -39,7 +42,7 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea
|
||||||
|
|
||||||
val master = REGEX_MASTER_JS.find(body)?.groupValues?.get(1) ?: return emptyList()
|
val master = REGEX_MASTER_JS.find(body)?.groupValues?.get(1) ?: return emptyList()
|
||||||
val aesJson = json.decodeFromString<CryptoInfo>(master)
|
val aesJson = json.decodeFromString<CryptoInfo>(master)
|
||||||
val key = getKey(body)
|
val key = fetchKey()
|
||||||
val decryptedScript = decryptWithSalt(aesJson.ciphertext, aesJson.salt, key)
|
val decryptedScript = decryptWithSalt(aesJson.ciphertext, aesJson.salt, key)
|
||||||
.replace("\\n", "\n")
|
.replace("\\n", "\n")
|
||||||
.replace("\\", "")
|
.replace("\\", "")
|
||||||
|
@ -83,6 +86,11 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
|
private fun fetchKey(): String {
|
||||||
|
return client.newCall(GET(KEY_SOURCE)).execute().parseAs<KeysData>().keys.get(0)
|
||||||
|
}
|
||||||
|
|
||||||
private fun getKey(body: String): String {
|
private fun getKey(body: String): String {
|
||||||
val (encrypted, pass, offset, index) = REGEX_EVAL_KEY.find(body)!!.groupValues.drop(1)
|
val (encrypted, pass, offset, index) = REGEX_EVAL_KEY.find(body)!!.groupValues.drop(1)
|
||||||
val decrypted = decryptScript(encrypted, pass, offset.toInt(), index.toInt())
|
val decrypted = decryptScript(encrypted, pass, offset.toInt(), index.toInt())
|
||||||
|
@ -114,4 +122,10 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea
|
||||||
val label: String = "",
|
val label: String = "",
|
||||||
val file: String,
|
val file: String,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class KeysData(
|
||||||
|
@SerialName("chillx")
|
||||||
|
val keys: List<String>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Tokuzilla'
|
extName = 'Tokuzilla'
|
||||||
extClass = '.Tokuzilla'
|
extClass = '.Tokuzilla'
|
||||||
extVersionCode = 15
|
extVersionCode = 16
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -3,7 +3,7 @@ ext {
|
||||||
extClass = '.AnimeSAGA'
|
extClass = '.AnimeSAGA'
|
||||||
themePkg = 'dooplay'
|
themePkg = 'dooplay'
|
||||||
baseUrl = 'https://www.animesaga.in'
|
baseUrl = 'https://www.animesaga.in'
|
||||||
overrideVersionCode = 9
|
overrideVersionCode = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue