NHentai - fix pages (#3455)

This commit is contained in:
Mike 2020-06-09 02:38:48 -04:00 committed by GitHub
parent af807266b8
commit 7a0b545316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 14 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: NHentai' appName = 'Tachiyomi: NHentai'
pkgNameSuffix = 'all.nhentai' pkgNameSuffix = 'all.nhentai'
extClass = '.NHFactory' extClass = '.NHFactory'
extVersionCode = 19 extVersionCode = 20
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -224,23 +224,12 @@ open class NHentai(
override fun chapterListSelector() = throw UnsupportedOperationException("Not used") override fun chapterListSelector() = throw UnsupportedOperationException("Not used")
override fun pageListRequest(chapter: SChapter) = GET("$baseUrl${chapter.url}", headers)
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val pageElements = document.select("#thumbnail-container > div") return document.select("div.thumbs a > img").mapIndexed { i, img ->
val pageList = mutableListOf<Page>() Page(i, "", img.attr("abs:data-src").replace("t.nh", "i.nh").replace("t.", "."))
pageElements.forEach {
Page(pageList.size).run {
this.imageUrl = it.select("a > img").attr("data-src").replace("t.nh", "i.nh").replace("t.", ".")
pageList.add(pageList.size, this)
} }
} }
return pageList
}
override fun getFilterList(): FilterList = FilterList( override fun getFilterList(): FilterList = FilterList(
SortFilter(), SortFilter(),
Filter.Header("Sort is ignored if favorites only"), Filter.Header("Sort is ignored if favorites only"),