[RU] MangaClub: Update status to extensions-lib 1.3 (#12129)
* [RU] MangaClub: Update status to extensions-lib 1.3 * [RU] MangaClub: Fix statuses Co-authored-by: RomanRozhenkov <Rozhenkov20@gmail.com>
This commit is contained in:
parent
256b11597f
commit
ca32efdfa6
@ -5,7 +5,7 @@ ext {
|
||||
extName = 'MangaClub'
|
||||
pkgNameSuffix = 'ru.mangaclub'
|
||||
extClass = '.MangaClub'
|
||||
extVersionCode = 10
|
||||
extVersionCode = 11
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -18,14 +18,14 @@ import java.util.Locale
|
||||
|
||||
class MangaClub : ParsedHttpSource() {
|
||||
|
||||
// Info
|
||||
/** Info **/
|
||||
override val name: String = "MangaClub"
|
||||
override val baseUrl: String = "https://mangaclub.ru"
|
||||
override val lang: String = "ru"
|
||||
override val supportsLatest: Boolean = true
|
||||
override val client: OkHttpClient = network.cloudflareClient
|
||||
|
||||
// Popular
|
||||
/** Popular **/
|
||||
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/f/sort=rating/order=desc/page/$page/", headers)
|
||||
override fun popularMangaNextPageSelector(): String = "div.pagination-list i.icon-right-open"
|
||||
override fun popularMangaSelector(): String = "div.shortstory"
|
||||
@ -37,13 +37,13 @@ class MangaClub : ParsedHttpSource() {
|
||||
}
|
||||
}
|
||||
|
||||
// Latest
|
||||
/** Latest **/
|
||||
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/page/$page/", headers)
|
||||
override fun latestUpdatesNextPageSelector(): String = popularMangaNextPageSelector()
|
||||
override fun latestUpdatesSelector(): String = popularMangaSelector()
|
||||
override fun latestUpdatesFromElement(element: Element): SManga = popularMangaFromElement(element)
|
||||
|
||||
// Search
|
||||
/** Search **/
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
var url = baseUrl
|
||||
if (query.isNotEmpty()) {
|
||||
@ -90,7 +90,7 @@ class MangaClub : ParsedHttpSource() {
|
||||
override fun searchMangaSelector(): String = popularMangaSelector()
|
||||
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
|
||||
|
||||
// Details
|
||||
/** Details **/
|
||||
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
||||
val licensedStatus = document.select("div.fullstory").text().contains("Данное произведение лицензировано на территории РФ. Главы удалены.")
|
||||
thumbnail_url = document.select("div.image img").attr("abs:src")
|
||||
@ -100,6 +100,7 @@ class MangaClub : ParsedHttpSource() {
|
||||
status = when (document.select("div.info a[href*=status_translation]").text().trim()) {
|
||||
"Продолжается" -> if (licensedStatus) SManga.LICENSED else SManga.ONGOING
|
||||
"Завершен" -> if (licensedStatus) SManga.LICENSED else SManga.COMPLETED
|
||||
"Заморожено/Заброшено" -> if (licensedStatus) SManga.LICENSED else SManga.ON_HIATUS
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
description = "Читайте описание через WebView"
|
||||
@ -108,7 +109,7 @@ class MangaClub : ParsedHttpSource() {
|
||||
}
|
||||
}
|
||||
|
||||
// Chapters
|
||||
/** Chapters **/
|
||||
private val dateParse = SimpleDateFormat("dd.MM.yyyy", Locale.ROOT)
|
||||
override fun chapterListSelector(): String = "div.chapters div.chapter-item"
|
||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
@ -119,7 +120,7 @@ class MangaClub : ParsedHttpSource() {
|
||||
setUrlWithoutDomain(chapterLink.attr("abs:href"))
|
||||
}
|
||||
|
||||
// Pages
|
||||
/** Pages **/
|
||||
override fun pageListParse(document: Document): List<Page> = mutableListOf<Page>().apply {
|
||||
document.select("div.manga-lines-page a").forEach {
|
||||
add(Page(it.attr("data-p").toInt(), "", "${baseUrl.replace("//", "//img.")}/${it.attr("data-i")}"))
|
||||
@ -127,7 +128,7 @@ class MangaClub : ParsedHttpSource() {
|
||||
}
|
||||
override fun imageUrlParse(document: Document): String = ""
|
||||
|
||||
// Filters
|
||||
/** Filters **/
|
||||
private class GenreList(genres: List<Genre>) : Filter.Group<Genre>("Жанры", genres)
|
||||
private class Genre(name: String, val id: String) : Filter.CheckBox(name)
|
||||
private class CategoryList(categories: List<Category>) : Filter.Group<Category>("Категория", categories)
|
||||
|
Loading…
x
Reference in New Issue
Block a user