Mangatown - longstrip parsing (#721)

This commit is contained in:
Mike 2024-01-27 14:26:56 -05:00 committed by GitHub
parent 6c91829cb2
commit b90dc2a8c3
2 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Mangatown'
extClass = '.Mangatown'
extVersionCode = 6
extVersionCode = 7
}
apply from: "$rootDir/common.gradle"

View File

@ -122,9 +122,18 @@ class Mangatown : ParsedHttpSource() {
}
}
// check for paged first, then try longstrip
override fun pageListParse(document: Document): List<Page> {
return document.select("select#top_chapter_list ~ div.page_select option:not(:contains(featured))").mapIndexed { i, element ->
Page(i, element.attr("value").substringAfter("com"))
return document.select("select#top_chapter_list ~ div.page_select option:not(:contains(featured))").let { elements ->
if (elements.isNotEmpty()) {
elements.mapIndexed { i, e ->
Page(i, e.attr("value").substringAfter("com"))
}
} else {
document.select("#viewer .image").mapIndexed { i, e ->
Page(i, "", e.attr("abs:src"))
}
}
}
}