MyComic: Support chapter groups parsing (#9186)

* MyComic: Support chapter groups parsing

* Rename dto file name for suitable camel case.
This commit is contained in:
AlphaBoom 2025-06-13 12:40:00 +08:00 committed by Draff
parent d1878c4183
commit 8a81d39865
Signed by: Draff
GPG Key ID: E8A89F3211677653
3 changed files with 17 additions and 11 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'MyComic' extName = 'MyComic'
extClass = '.MyComic' extClass = '.MyComic'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }

View File

@ -38,10 +38,16 @@ class MyComic : ParsedHttpSource(), ConfigurableSource {
override fun chapterListParse(response: Response): List<SChapter> { override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup() val document = response.asJsoup()
val data = document.select("div[data-flux-card] + div div[x-data]").attr("x-data") return document.select("div[data-flux-card] + div div[x-data]")
val chaptersStr = .eachAttr("x-data")
data.substringAfter("chapters:").substringBefore("\n").trim().removeSuffix(",") .map {
return chaptersStr.parseAs<List<Chapter>>().map { it.substringAfter("chapters:").substringBefore("\n").trim().removeSuffix(",")
}
.map {
it.parseAs<List<Chapter>>()
}
.flatten()
.map {
SChapter.create().apply { SChapter.create().apply {
name = it.title name = it.title
// Since the images included in the chapter do not distinguish between Traditional and Simplified Chinese, the default URL will be used uniformly here. // Since the images included in the chapter do not distinguish between Traditional and Simplified Chinese, the default URL will be used uniformly here.