Skip to content

Commit

Permalink
fix(src): Multiple updates (#157)
Browse files Browse the repository at this point in the history
* fix(src): Multiple updates

Closes #93
Closes #1
Closes #133
Closes #142 (Yeah, this extension had a bug but someone closed it before fixing it.)

* Fix(lib/ChillxExtractor)

Closes #153
  • Loading branch information
imper1aldev authored Aug 19, 2024
1 parent 9fbe135 commit 112961d
Show file tree
Hide file tree
Showing 87 changed files with 682 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.lib.cryptoaes.CryptoAES.decryptWithSalt
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.util.parseAs
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
Expand All @@ -27,6 +29,7 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea

// matches "[language]https://...,"
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> {
Expand All @@ -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 aesJson = json.decodeFromString<CryptoInfo>(master)
val key = getKey(body)
val key = fetchKey()
val decryptedScript = decryptWithSalt(aesJson.ciphertext, aesJson.salt, key)
.replace("\\n", "\n")
.replace("\\", "")
Expand Down Expand Up @@ -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 {
val (encrypted, pass, offset, index) = REGEX_EVAL_KEY.find(body)!!.groupValues.drop(1)
val decrypted = decryptScript(encrypted, pass, offset.toInt(), index.toInt())
Expand Down Expand Up @@ -114,4 +122,10 @@ class ChillxExtractor(private val client: OkHttpClient, private val headers: Hea
val label: String = "",
val file: String,
)

@Serializable
data class KeysData(
@SerialName("chillx")
val keys: List<String>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class VoeExtractor(private val client: OkHttpClient) {

private val base64Regex = Regex("'.*'")

private val scriptBase64Regex = "(let|var)\\s+\\w+\\s*=\\s*'(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)';".toRegex()

@Serializable
data class VideoLinkDTO(val file: String)

Expand All @@ -36,8 +38,9 @@ class VoeExtractor(private val client: OkHttpClient) {
document = clientDdos.newCall(GET(originalUrl)).execute().asJsoup()
}

val script = document.selectFirst("script:containsData(const sources), script:containsData(var sources), script:containsData(wc0)")
?.data()
val alternativeScript = document.select("script").find { scriptBase64Regex.containsMatchIn(it.data()) }?.data()
val script = document.selectFirst("script:containsData(const sources), script:containsData(var sources), script:containsData(wc0)")?.data()
?: alternativeScript
?: return emptyList()
val playlistUrl = when {
// Layout 1
Expand All @@ -46,10 +49,11 @@ class VoeExtractor(private val client: OkHttpClient) {
if (linkRegex.matches(link)) link else String(Base64.decode(link, Base64.DEFAULT))
}
// Layout 2
script.contains("wc0") -> {
script.contains("wc0") || alternativeScript != null -> {
val base64 = base64Regex.find(script)!!.value
val decoded = Base64.decode(base64, Base64.DEFAULT).let(::String)
json.decodeFromString<VideoLinkDTO>(decoded).file

json.decodeFromString<VideoLinkDTO>(if (alternativeScript != null) decoded.reversed() else decoded).file
}
else -> return emptyList()
}
Expand Down
2 changes: 1 addition & 1 deletion src/all/chineseanime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.ChineseAnime'
themePkg = 'animestream'
baseUrl = 'https://www.chineseanime.vip'
overrideVersionCode = 8
overrideVersionCode = 9
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/all/javguru/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Jav Guru'
extClass = '.JavGuru'
extVersionCode = 15
extVersionCode = 16
isNsfw = true
}

Expand Down
2 changes: 1 addition & 1 deletion src/all/lmanime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.LMAnime'
themePkg = 'animestream'
baseUrl = 'https://lmanime.com'
overrideVersionCode = 6
overrideVersionCode = 7
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/all/supjav/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'SupJav'
extClass = '.SupJavFactory'
extVersionCode = 9
extVersionCode = 10
isNsfw = true
}

Expand Down
2 changes: 1 addition & 1 deletion src/ar/anime4up/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Anime4up'
extClass = '.Anime4Up'
extVersionCode = 57
extVersionCode = 58
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/ar/animerco/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Animerco'
extClass = '.Animerco'
extVersionCode = 37
extVersionCode = 38
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/ar/arabseed/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Arab Seed'
extClass = '.ArabSeed'
extVersionCode = 13
extVersionCode = 14
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/ar/asia2tv/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'asia2tv'
extClass = '.Asia2TV'
extVersionCode = 18
extVersionCode = 19
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/ar/egydead/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Egy Dead'
extClass = '.EgyDead'
extVersionCode = 12
extVersionCode = 13
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/ar/okanime/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Okanime'
extClass = '.Okanime'
extVersionCode = 10
extVersionCode = 11
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/animebase/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Anime-Base'
extClass = '.AnimeBase'
extVersionCode = 24
extVersionCode = 25
isNsfw = true
}

Expand Down
2 changes: 1 addition & 1 deletion src/de/animeloads/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Anime-Loads'
extClass = '.AnimeLoads'
extVersionCode = 15
extVersionCode = 16
isNsfw = true
}

Expand Down
2 changes: 1 addition & 1 deletion src/de/animetoast/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AnimeToast'
extClass = '.AnimeToast'
extVersionCode = 14
extVersionCode = 15
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/aniworld/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AniWorld'
extClass = '.AniWorld'
extVersionCode = 23
extVersionCode = 24
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/cineclix/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'CineClix'
extClass = '.CineClix'
extVersionCode = 14
extVersionCode = 15
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/cinemathek/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.Cinemathek'
themePkg = 'dooplay'
baseUrl = 'https://cinemathek.net'
overrideVersionCode = 20
overrideVersionCode = 21
isNsfw = true
}

Expand Down
2 changes: 1 addition & 1 deletion src/de/einfach/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Einfach'
extClass = '.Einfach'
extVersionCode = 10
extVersionCode = 11
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/filmpalast/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'FilmPalast'
extClass = '.FilmPalast'
extVersionCode = 17
extVersionCode = 18
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/kinoking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.Kinoking'
themePkg = 'dooplay'
baseUrl = 'https://kinoking.cc'
overrideVersionCode = 21
overrideVersionCode = 22
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/kool/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Kool'
extClass = '.Kool'
extVersionCode = 11
extVersionCode = 12
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/moflixstream/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Moflix-Stream'
extClass = '.MoflixStream'
extVersionCode = 8
extVersionCode = 9
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/movie4k/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Movie4k'
extClass = '.Movie4k'
extVersionCode = 10
extVersionCode = 11
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/de/serienstream/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Serienstream'
extClass = '.Serienstream'
extVersionCode = 18
extVersionCode = 19
}

apply from: "$rootDir/common.gradle"
Expand Down
2 changes: 1 addition & 1 deletion src/en/allanimechi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'AllAnimeChi'
extClass = '.AllAnimeChi'
extVersionCode = 7
extVersionCode = 8
}

apply from: "$rootDir/common.gradle"
Expand Down
7 changes: 7 additions & 0 deletions src/en/animegg/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ext {
extName = 'AnimeGG'
extClass = '.AnimeGG'
extVersionCode = 1
}

apply from: "$rootDir/common.gradle"
Binary file added src/en/animegg/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/animegg/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/animegg/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/animegg/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/en/animegg/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 112961d

Please sign in to comment.