diff --git a/settings.gradle b/settings.gradle index 0ffa7a439..f5398e52a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,4 +16,3 @@ dependencyResolutionManagement { rootProject.name = 'kotatsu-parsers' include 'kotatsu-parsers-ksp' - diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt index 40aef21eb..e9b2ecef5 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/madtheme/MadthemeParser.kt @@ -226,6 +226,21 @@ internal abstract class MadthemeParser( val fullUrl = chapter.url.toAbsoluteUrl(domain) val doc = webClient.httpGet(fullUrl).parseHtml() + val regexPages = Regex("chapImages\\s*=\\s*'(.*)'") + val pages = doc.select("script").firstNotNullOfOrNull { script -> + regexPages.find(script.html())?.groupValues?.getOrNull(1) + }?.split(',') + if (pages != null) { + return pages.map { url -> + MangaPage( + id = generateUid(url), + url = url, + preview = null, + source = source, + ) + } + } + // fallback to html parisng return doc.select(selectPage).map { img -> val url = img.src()?.toRelativeUrl(domain) ?: img.parseFailed("Image src not found") MangaPage(