[mgk] fix fetching pages (#87)

This commit is contained in:
beerpsi 2024-01-10 19:20:37 +07:00 committed by GitHub
parent 84270454c3
commit 14c0b6ccaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -5,11 +5,12 @@ ext {
extName = 'Mangaku'
pkgNameSuffix = 'id.mangaku'
extClass = '.Mangaku'
extVersionCode = 6
extVersionCode = 7
}
apply from: "$rootDir/common.gradle"
dependencies {
implementation(project(':lib-cryptoaes'))
implementation(project(':lib-unpacker'))
}

View File

@ -4,6 +4,7 @@ import android.net.Uri
import android.util.Base64
import android.util.Log
import eu.kanade.tachiyomi.lib.cryptoaes.CryptoAES
import eu.kanade.tachiyomi.lib.unpacker.Unpacker
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
@ -28,7 +29,7 @@ class Mangaku : ParsedHttpSource() {
override val name = "Mangaku"
override val baseUrl = "https://mangaku.blog"
override val baseUrl = "https://mangaku.mom"
override val lang = "id"
@ -141,12 +142,20 @@ class Mangaku : ParsedHttpSource() {
val wpRoutineJs = client.newCall(GET(wpRoutineUrl, headers)).execute().use {
it.body.string()
}
val upt3 = wpRoutineJs
.substringAfterLast("upt3(")
.substringBefore(");")
val appMgk = wpRoutineJs
.substringAfter("const $upt3 = '")
.substringBefore("'")
val keymapJsPacked = wpRoutineJs
.substringAfter("eval(function(x,a,c,k,e,d)")
.substringBefore(".split('|'),0,{}))") + ".split('|'),0,{}))"
val keymapJs = Unpacker.unpack(keymapJsPacked)
val appMgkVariable = keymapJs
.substringAfter("$upt3=")
.substringBefore(";")
val appMgk = keymapJs
.substringAfter("let $appMgkVariable=\"")
.substringBefore("\";")
.reversed()
Log.d("mangaku", "app-mgk: $appMgk")