mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
Weeb Central: fix broken chapter link (#6129)
This commit is contained in:
parent
9eca1d4125
commit
c29330892a
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Weeb Central'
|
extName = 'Weeb Central'
|
||||||
extClass = '.WeebCentral'
|
extClass = '.WeebCentral'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
|||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
@ -150,6 +151,21 @@ class WeebCentral : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
// =============================== Pages ================================
|
// =============================== Pages ================================
|
||||||
|
|
||||||
|
override fun pageListRequest(chapter: SChapter): Request {
|
||||||
|
val newUrl = (baseUrl + chapter.url)
|
||||||
|
.toHttpUrlOrNull()
|
||||||
|
?.newBuilder()
|
||||||
|
?.addPathSegment("images")
|
||||||
|
?.addQueryParameter("is_prev", "False")
|
||||||
|
?.addQueryParameter("reading_style", "long_strip")
|
||||||
|
?.build()
|
||||||
|
?.toString()
|
||||||
|
?: chapter.url
|
||||||
|
|
||||||
|
chapter.setUrlWithoutDomain(newUrl)
|
||||||
|
return super.pageListRequest(chapter)
|
||||||
|
}
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
return document.select("section[x-data~=scroll] > img").mapIndexed { index, element ->
|
return document.select("section[x-data~=scroll] > img").mapIndexed { index, element ->
|
||||||
Page(index, imageUrl = element.attr("abs:src"))
|
Page(index, imageUrl = element.attr("abs:src"))
|
||||||
|
Loading…
Reference in New Issue
Block a user