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 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 chapterProtectorSelector = "#chapter-protector-data"
open val chapterProtectorPasswordPrefix = "wpmangaprotectornonce='"
open val chapterProtectorDataPrefix = "chapter_data='"
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
launchIO { countViews(document) } launchIO { countViews(document) }
@ -994,11 +996,11 @@ abstract class Madara(
?.let { Base64.decode(it, Base64.DEFAULT).toString(Charsets.UTF_8) } ?.let { Base64.decode(it, Base64.DEFAULT).toString(Charsets.UTF_8) }
?: chapterProtector.html() ?: chapterProtector.html()
val password = chapterProtectorHtml val password = chapterProtectorHtml
.substringAfter("wpmangaprotectornonce='") .substringAfter(chapterProtectorPasswordPrefix)
.substringBefore("';") .substringBefore("';")
val chapterData = json.parseToJsonElement( val chapterData = json.parseToJsonElement(
chapterProtectorHtml chapterProtectorHtml
.substringAfter("chapter_data='") .substringAfter(chapterProtectorDataPrefix)
.substringBefore("';") .substringBefore("';")
.replace("\\/", "/"), .replace("\\/", "/"),
).jsonObject ).jsonObject

View File

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

View File

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