HentaiNexus - fix pages (#2563)

HentaiNexus - fix pages
This commit is contained in:
Mike 2020-03-31 21:58:46 -04:00 committed by GitHub
parent b3e0ef430a
commit dd787e9dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 23 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: HentaiNexus'
pkgNameSuffix = 'en.hentainexus'
extClass = '.HentaiNexus'
extVersionCode = 1
extVersionCode = 2
libVersion = '1.2'
}

View File

@ -121,7 +121,7 @@ class HentaiNexus : ParsedHttpSource() {
return manga
}
fun getDesc(document: Document): String {
private fun getDesc(document: Document): String {
val infoElement = document.select("div.column")
val stringBuilder = StringBuilder()
val description = infoElement.select("td.viewcolumn:containsOwn(Description) + td").text()
@ -161,13 +161,10 @@ class HentaiNexus : ParsedHttpSource() {
override fun chapterListSelector() = "div.container nav.depict-button-set"
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("div.level-item a")
val chapter = SChapter.create()
chapter.url = urlElement.attr("href")
chapter.name = "Read Online: Chapter 0"
return chapter
return SChapter.create().apply {
url = element.select("div.level-item a").attr("href")
name = "Read Online: Chapter 0"
}
}
override fun pageListRequest(chapter: SChapter): Request {
@ -178,26 +175,21 @@ class HentaiNexus : ParsedHttpSource() {
}
override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>()
var script = document.select("script").last().data()
var url = script.substringAfter("[").substringBefore("]")
return document.select("script:containsData(initreader)").first().data()
.substringAfter("[")
.substringBefore("]")
.replace(Regex("""["\\]"""), "")
.split(",")
for (i in 0 until url.size) {
pages.add(Page(i, "", url[i]))
}
return pages
.mapIndexed { i, image -> Page(i, "", image) }
}
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList(
Filter.Header("Only one filter may be used at a time."),
Filter.Separator(),
ArtistFilter(),
TagFilter()
Filter.Header("Only one filter may be used at a time."),
Filter.Separator(),
ArtistFilter(),
TagFilter()
)
class ArtistFilter : Filter.Text("Search by Artist (must be exact match)")