Skip to content

Commit

Permalink
Weeb Central: fix broken chapter link (#6129)
Browse files Browse the repository at this point in the history
  • Loading branch information
vetleledaal authored Nov 18, 2024
1 parent 9eca1d4 commit c293308
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/en/weebcentral/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Weeb Central'
extClass = '.WeebCentral'
extVersionCode = 2
extVersionCode = 3
isNsfw = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Request
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
Expand Down Expand Up @@ -150,6 +151,21 @@ class WeebCentral : ParsedHttpSource() {
}
// =============================== 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> {
return document.select("section[x-data~=scroll] > img").mapIndexed { index, element ->
Page(index, imageUrl = element.attr("abs:src"))
Expand Down

0 comments on commit c293308

Please sign in to comment.