WeebCentral: Update to use search data (#5923)

* WeebCentral: Update to use search data

* WeebCentral: Remove "Last Read" from chapter titles
This commit is contained in:
eientei95 2024-11-08 00:44:29 +13:00 committed by Draff
parent 9807d6c478
commit 7720d8ac57
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Weeb Central'
extClass = '.WeebCentral'
extVersionCode = 1
extVersionCode = 2
isNsfw = true
}

View File

@ -66,19 +66,20 @@ class WeebCentral : ParsedHttpSource() {
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val filterList = filters.ifEmpty { getFilterList() }
val url = "$baseUrl/search".toHttpUrl().newBuilder().apply {
val url = "$baseUrl/search/data".toHttpUrl().newBuilder().apply {
addQueryParameter("text", query)
filterList.filterIsInstance<UriFilter>().forEach {
it.addToUri(this)
}
addQueryParameter("limit", FETCH_LIMIT.toString())
addQueryParameter("offset", ((page - 1) * FETCH_LIMIT).toString())
addQueryParameter("display_mode", "Full Display")
}.build()
return GET(url, headers)
}
override fun searchMangaSelector(): String = "#search-results > article:not(#search-more-container)"
override fun searchMangaSelector(): String = "article:has(section)"
override fun searchMangaFromElement(element: Element): SManga = SManga.create().apply {
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
@ -88,7 +89,7 @@ class WeebCentral : ParsedHttpSource() {
}
}
override fun searchMangaNextPageSelector(): String = "#search-more-container > button"
override fun searchMangaNextPageSelector(): String = "button"
// =============================== Filters ==============================
@ -130,10 +131,10 @@ class WeebCentral : ParsedHttpSource() {
return GET(url, headers)
}
override fun chapterListSelector() = "a"
override fun chapterListSelector() = "a[x-data]"
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
name = element.selectFirst("span.flex")!!.text()
name = element.selectFirst("span.flex > span")!!.text()
setUrlWithoutDomain(element.attr("abs:href"))
element.selectFirst("time[datetime]")?.also {
date_upload = it.attr("datetime").parseDate()