[ImmortalUpdates] Update descrambling logic (#15157)
* [ImmortalUpdates] Update descrambling logic * Bump version
This commit is contained in:
parent
9b3420734e
commit
24e5d03a62
|
@ -11,6 +11,7 @@ import android.graphics.Rect
|
|||
import app.cash.quickjs.QuickJs
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
|
@ -23,7 +24,9 @@ class ImmortalUpdates : Madara("Immortal Updates", "https://immortalupdates.com"
|
|||
|
||||
override val useNewChapterEndpoint: Boolean = true
|
||||
|
||||
override val client = super.client.newBuilder().addInterceptor { chain ->
|
||||
override val client = super.client.newBuilder()
|
||||
.rateLimit(1, 2)
|
||||
.addInterceptor { chain ->
|
||||
val response = chain.proceed(chain.request())
|
||||
|
||||
if (response.request.url.fragment?.contains(DESCRAMBLE) != true) {
|
||||
|
@ -51,11 +54,11 @@ class ImmortalUpdates : Madara("Immortal Updates", "https://immortalupdates.com"
|
|||
|
||||
unscramblingCalls.replace("\r", "").split("\n").forEach {
|
||||
val args = unfuckJs(it)
|
||||
.substringAfter("(")
|
||||
.substringAfter("get_img(")
|
||||
.substringBefore(")")
|
||||
|
||||
val filenameFragment = args.split(",")[0].removeSurrounding("'")
|
||||
val page = pageList.firstOrNull { it.imageUrl!!.contains(filenameFragment, ignoreCase = true) }
|
||||
val page = pageList.firstOrNull { page -> page.imageUrl!!.contains(filenameFragment, ignoreCase = true) }
|
||||
?: return@forEach
|
||||
val newPageUrl = page.imageUrl!!.toHttpUrl().newBuilder()
|
||||
.fragment("$DESCRAMBLE=$args")
|
||||
|
|
|
@ -146,7 +146,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
|||
SingleLang("Ichirin No Hana Yuri", "https://ichirinnohanayuriscan.com", "pt-BR", isNsfw = true, overrideVersionCode = 4),
|
||||
SingleLang("Ikifeng", "https://ikifeng.com", "es", isNsfw = true),
|
||||
SingleLang("Illusion Scan", "https://illusionscan.com", "pt-BR", isNsfw = true),
|
||||
SingleLang("Immortal Updates", "https://immortalupdates.com", "en", overrideVersionCode = 4),
|
||||
SingleLang("Immortal Updates", "https://immortalupdates.com", "en", overrideVersionCode = 5),
|
||||
SingleLang("Império Scans", "https://imperioscans.com.br", "pt-BR", className = "ImperioScans", overrideVersionCode = 1),
|
||||
SingleLang("Inazu Manga", "https://inazumanga.com", "id", isNsfw = true),
|
||||
SingleLang("InfraFandub", "https://infrafandub.xyz", "es"),
|
||||
|
|
Loading…
Reference in New Issue