MyHentaiComics - fix pages (#3525)
This commit is contained in:
parent
ca55416443
commit
505e954175
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: MyHentaiComics'
|
||||
pkgNameSuffix = 'en.myhentaicomics'
|
||||
extClass = '.MyHentaiComics'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.source.model.Page
|
|||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import org.jsoup.nodes.Document
|
||||
|
@ -117,9 +118,20 @@ class MyHentaiComics : ParsedHttpSource() {
|
|||
// Pages
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
return document.select("img.g-thumbnail").mapIndexed { i, img ->
|
||||
Page(i, "", img.attr("abs:src").replace("/thumbs/", "/resizes/"))
|
||||
val pages = mutableListOf<Page>()
|
||||
|
||||
// recursively parse paginated pages
|
||||
fun parsePage(document: Document) {
|
||||
document.select("img.g-thumbnail").map { img ->
|
||||
pages.add(Page(pages.size, "", img.attr("abs:src").replace("/thumbs/", "/resizes/")))
|
||||
}
|
||||
document.select("ul.g-paginator a.ui-state-default:contains(Next)").firstOrNull()?.let { a ->
|
||||
parsePage(client.newCall(GET(a.attr("abs:href"), headers)).execute().asJsoup())
|
||||
}
|
||||
}
|
||||
|
||||
parsePage(document)
|
||||
return pages
|
||||
}
|
||||
|
||||
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not used")
|
||||
|
|
Loading…
Reference in New Issue