Mangatown - longstrip parsing (#721)

This commit is contained in:
Mike 2024-01-27 14:26:56 -05:00 committed by Draff
parent cf9f358af1
commit 9ca3646702
2 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Mangatown' extName = 'Mangatown'
extClass = '.Mangatown' extClass = '.Mangatown'
extVersionCode = 6 extVersionCode = 7
} }
apply from: "$rootDir/common.gradle" 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> { override fun pageListParse(document: Document): List<Page> {
return document.select("select#top_chapter_list ~ div.page_select option:not(:contains(featured))").mapIndexed { i, element -> return document.select("select#top_chapter_list ~ div.page_select option:not(:contains(featured))").let { elements ->
Page(i, element.attr("value").substringAfter("com")) 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"))
}
}
} }
} }