parent
3ded3086a9
commit
be986aa1fe
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: Oglaf'
|
||||
pkgNameSuffix = 'en.oglaf'
|
||||
extClass = '.Oglaf'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package eu.kanade.tachiyomi.extension.en.oglaf
|
||||
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||
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.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import rx.Observable
|
||||
|
@ -60,14 +61,16 @@ class Oglaf : ParsedHttpSource() {
|
|||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val urlRegex = """/.*/\d*/""".toRegex()
|
||||
val imageUrl = document.select("img#strip").attr("src")
|
||||
val pages = mutableListOf<Page>()
|
||||
pages.add(Page(0, "", imageUrl))
|
||||
val next = document.select("a[rel=next]").attr("href")
|
||||
if (urlRegex.matches(next)) {
|
||||
val nextPage = Jsoup.connect(baseUrl + next).get()
|
||||
pages.addAll(pageListParse(nextPage))
|
||||
|
||||
fun addPage(document: Document) {
|
||||
pages.add(Page(pages.size, "", document.select("img#strip").attr("abs:src")))
|
||||
val next = document.select("a[rel=next]").attr("href")
|
||||
if (urlRegex.matches(next)) addPage(client.newCall(GET(baseUrl + next, headers)).execute().asJsoup())
|
||||
}
|
||||
|
||||
addPage(document)
|
||||
|
||||
return pages
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue