MyComic: Support chapter groups parsing (#9186)
* MyComic: Support chapter groups parsing * Rename dto file name for suitable camel case.
This commit is contained in:
parent
d1878c4183
commit
8a81d39865
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'MyComic'
|
extName = 'MyComic'
|
||||||
extClass = '.MyComic'
|
extClass = '.MyComic'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,17 +38,23 @@ 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(",")
|
||||||
SChapter.create().apply {
|
}
|
||||||
name = it.title
|
.map {
|
||||||
// Since the images included in the chapter do not distinguish between Traditional and Simplified Chinese, the default URL will be used uniformly here.
|
it.parseAs<List<Chapter>>()
|
||||||
// Additionally, using different URLs would create more issues, so it's best to keep the URL consistent.
|
}
|
||||||
url = "/chapters/${it.id}"
|
.flatten()
|
||||||
|
.map {
|
||||||
|
SChapter.create().apply {
|
||||||
|
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.
|
||||||
|
// Additionally, using different URLs would create more issues, so it's best to keep the URL consistent.
|
||||||
|
url = "/chapters/${it.id}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element) = throw UnsupportedOperationException()
|
override fun chapterFromElement(element: Element) = throw UnsupportedOperationException()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user