SeriManga: Get chapters from following pages (#2858)
* Update build.gradle * Update SeriManga.kt * Update SeriManga.kt * Update SeriManga.kt * Update SeriManga.kt * Update SeriManga.kt * Update SeriManga.kt
This commit is contained in:
parent
c2e08d86c4
commit
a2fa6231f0
@ -5,7 +5,7 @@ ext {
|
||||
appName = 'Tachiyomi: SeriManga'
|
||||
pkgNameSuffix = 'tr.serimanga'
|
||||
extClass = '.SeriManga'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,13 @@ 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 java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
@ -82,6 +84,24 @@ class SeriManga : ParsedHttpSource() {
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
val chapters = mutableListOf<SChapter>()
|
||||
var document = response.asJsoup()
|
||||
var continueParsing = true
|
||||
|
||||
while (continueParsing) {
|
||||
document.select(chapterListSelector()).map{ chapters.add(chapterFromElement(it)) }
|
||||
document.select(popularMangaNextPageSelector()).let{
|
||||
if (it.isNotEmpty()) {
|
||||
document = client.newCall(GET(it.attr("abs:href"), headers)).execute().asJsoup()
|
||||
} else {
|
||||
continueParsing = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return chapters
|
||||
}
|
||||
|
||||
override fun chapterListSelector() = "ul.spl-list > li"
|
||||
|
||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
||||
|
Loading…
x
Reference in New Issue
Block a user