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:
parent
9807d6c478
commit
7720d8ac57
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Weeb Central'
|
extName = 'Weeb Central'
|
||||||
extClass = '.WeebCentral'
|
extClass = '.WeebCentral'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,19 +66,20 @@ class WeebCentral : ParsedHttpSource() {
|
||||||
|
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val filterList = filters.ifEmpty { getFilterList() }
|
val filterList = filters.ifEmpty { getFilterList() }
|
||||||
val url = "$baseUrl/search".toHttpUrl().newBuilder().apply {
|
val url = "$baseUrl/search/data".toHttpUrl().newBuilder().apply {
|
||||||
addQueryParameter("text", query)
|
addQueryParameter("text", query)
|
||||||
filterList.filterIsInstance<UriFilter>().forEach {
|
filterList.filterIsInstance<UriFilter>().forEach {
|
||||||
it.addToUri(this)
|
it.addToUri(this)
|
||||||
}
|
}
|
||||||
addQueryParameter("limit", FETCH_LIMIT.toString())
|
addQueryParameter("limit", FETCH_LIMIT.toString())
|
||||||
addQueryParameter("offset", ((page - 1) * FETCH_LIMIT).toString())
|
addQueryParameter("offset", ((page - 1) * FETCH_LIMIT).toString())
|
||||||
|
addQueryParameter("display_mode", "Full Display")
|
||||||
}.build()
|
}.build()
|
||||||
|
|
||||||
return GET(url, headers)
|
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 {
|
override fun searchMangaFromElement(element: Element): SManga = SManga.create().apply {
|
||||||
thumbnail_url = element.selectFirst("img")!!.attr("abs:src")
|
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 ==============================
|
// =============================== Filters ==============================
|
||||||
|
|
||||||
|
@ -130,10 +131,10 @@ class WeebCentral : ParsedHttpSource() {
|
||||||
return GET(url, headers)
|
return GET(url, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun chapterListSelector() = "a"
|
override fun chapterListSelector() = "a[x-data]"
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
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"))
|
setUrlWithoutDomain(element.attr("abs:href"))
|
||||||
element.selectFirst("time[datetime]")?.also {
|
element.selectFirst("time[datetime]")?.also {
|
||||||
date_upload = it.attr("datetime").parseDate()
|
date_upload = it.attr("datetime").parseDate()
|
||||||
|
|
Loading…
Reference in New Issue