6Manhua: only parse the first chapter tab (#12433)

This commit is contained in:
stevenyomi 2022-07-09 09:46:40 +08:00 committed by GitHub
parent 50e58499a9
commit c52e47169b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -6,11 +6,11 @@ ext {
extName = '6Manhua'
pkgNameSuffix = 'zh.sixmh'
extClass = '.SixMH'
extVersionCode = 1
extVersionCode = 2
}
apply from: "$rootDir/common.gradle"
dependencies {
implementation 'com.github.stevenyomi:unpacker:919be5cb30' // SHA of 1.0 tag
implementation 'com.github.stevenyomi:unpacker:12a09e3c1a' // 1.1
}

View File

@ -112,14 +112,16 @@ class SixMH : ParsedHttpSource() {
val document = client.newCall(mobileRequest(manga)).execute().asJsoup()
val list = mutableListOf<SChapter>()
document.select(".chapter-list > a, dd[class^=gengduo]").forEach { element ->
if (element.tagName() == "a") {
val chapter = SChapter.create().apply {
val tab = document.selectFirst(Evaluator.Class("cartoon-directory")).children()
if (tab.size >= 2) {
tab[1].children().mapTo(list) { element ->
SChapter.create().apply {
url = element.attr("href")
name = element.text()
}
list.add(chapter)
} else {
}
if (tab.size >= 3) {
val element = tab[2]
val path = manga.url
val body = FormBody.Builder().apply {
addEncoded("id", element.attr("data-id"))