CatharsisWorld: Fix page decrypt (#8744)

* fix decrypt

* add open vars

* bruh
This commit is contained in:
bapeey 2025-05-07 10:27:12 -05:00 committed by Draff
parent d4e22509bc
commit 7d55595507
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
3 changed files with 8 additions and 3 deletions

View File

@ -979,6 +979,8 @@ abstract class Madara(
open val pageListParseSelector = "div.page-break, li.blocks-gallery-item, .reading-content .text-left:not(:has(.blocks-gallery-item)) img"
open val chapterProtectorSelector = "#chapter-protector-data"
open val chapterProtectorPasswordPrefix = "wpmangaprotectornonce='"
open val chapterProtectorDataPrefix = "chapter_data='"
override fun pageListParse(document: Document): List<Page> {
launchIO { countViews(document) }
@ -994,11 +996,11 @@ abstract class Madara(
?.let { Base64.decode(it, Base64.DEFAULT).toString(Charsets.UTF_8) }
?: chapterProtector.html()
val password = chapterProtectorHtml
.substringAfter("wpmangaprotectornonce='")
.substringAfter(chapterProtectorPasswordPrefix)
.substringBefore("';")
val chapterData = json.parseToJsonElement(
chapterProtectorHtml
.substringAfter("chapter_data='")
.substringAfter(chapterProtectorDataPrefix)
.substringBefore("';")
.replace("\\/", "/"),
).jsonObject

View File

@ -3,7 +3,7 @@ ext {
extClass = '.CatharsisWorld'
themePkg = 'madara'
baseUrl = 'https://catharsisworld.dig-it.info'
overrideVersionCode = 2
overrideVersionCode = 3
isNsfw = true
}

View File

@ -51,6 +51,9 @@ class CatharsisWorld : Madara(
setUrlWithoutDomain(element.selectFirst("a")!!.attr("href"))
}
override val chapterProtectorPasswordPrefix = "protectornonce='"
override val chapterProtectorDataPrefix = "_data='"
private fun Element.imageFromStyle(): String {
return this.attr("style").substringAfter("url(").substringBefore(")")
}