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' extName = '6Manhua'
pkgNameSuffix = 'zh.sixmh' pkgNameSuffix = 'zh.sixmh'
extClass = '.SixMH' extClass = '.SixMH'
extVersionCode = 1 extVersionCode = 2
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"
dependencies { 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 document = client.newCall(mobileRequest(manga)).execute().asJsoup()
val list = mutableListOf<SChapter>() val list = mutableListOf<SChapter>()
document.select(".chapter-list > a, dd[class^=gengduo]").forEach { element -> val tab = document.selectFirst(Evaluator.Class("cartoon-directory")).children()
if (element.tagName() == "a") { if (tab.size >= 2) {
val chapter = SChapter.create().apply { tab[1].children().mapTo(list) { element ->
SChapter.create().apply {
url = element.attr("href") url = element.attr("href")
name = element.text() name = element.text()
} }
list.add(chapter) }
} else { if (tab.size >= 3) {
val element = tab[2]
val path = manga.url val path = manga.url
val body = FormBody.Builder().apply { val body = FormBody.Builder().apply {
addEncoded("id", element.attr("data-id")) addEncoded("id", element.attr("data-id"))