[RU]Grouple sources fix status and pages (#7942)
This commit is contained in:
parent
2635d10527
commit
5086df34d8
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Mintmanga'
|
||||
pkgNameSuffix = 'ru.mintmanga'
|
||||
extClass = '.Mintmanga'
|
||||
extVersionCode = 30
|
||||
extVersionCode = 31
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -42,14 +42,14 @@ class Mintmanga : ParsedHttpSource() {
|
|||
.addNetworkInterceptor(rateLimitInterceptor).build()
|
||||
|
||||
override fun popularMangaRequest(page: Int): Request =
|
||||
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers)
|
||||
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}", headers)
|
||||
|
||||
override fun latestUpdatesRequest(page: Int): Request =
|
||||
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}&max=70", headers)
|
||||
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}", headers)
|
||||
|
||||
override fun popularMangaSelector() = "div.tile"
|
||||
|
||||
override fun latestUpdatesSelector() = "div.tile"
|
||||
override fun latestUpdatesSelector() = popularMangaSelector()
|
||||
|
||||
override fun popularMangaFromElement(element: Element): SManga {
|
||||
val manga = SManga.create()
|
||||
|
@ -66,7 +66,7 @@ class Mintmanga : ParsedHttpSource() {
|
|||
|
||||
override fun popularMangaNextPageSelector() = "a.nextLink"
|
||||
|
||||
override fun latestUpdatesNextPageSelector() = "a.nextLink"
|
||||
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder()
|
||||
|
@ -100,7 +100,7 @@ class Mintmanga : ParsedHttpSource() {
|
|||
is OrderBy -> {
|
||||
if (filter.state > 0) {
|
||||
val ord = arrayOf("not", "year", "rate", "popularity", "votes", "created", "updated")[filter.state]
|
||||
val ordUrl = "$baseUrl/list?sortType=$ord".toHttpUrlOrNull()!!.newBuilder()
|
||||
val ordUrl = "$baseUrl/list?sortType=$ord&offset=${70 * (page - 1)}".toHttpUrlOrNull()!!.newBuilder()
|
||||
return GET(ordUrl.toString(), headers)
|
||||
}
|
||||
}
|
||||
|
@ -116,11 +116,11 @@ class Mintmanga : ParsedHttpSource() {
|
|||
|
||||
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
|
||||
|
||||
// max 200 results
|
||||
override fun searchMangaNextPageSelector(): Nothing? = null
|
||||
// max 200 results (exception OrderBy)
|
||||
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
val infoElement = document.select("div.leftContent").first()
|
||||
val infoElement = document.select(".expandable").first()
|
||||
val rawCategory = infoElement.select("span.elem_category").text()
|
||||
val category = if (rawCategory.isNotEmpty()) {
|
||||
rawCategory.toLowerCase()
|
||||
|
@ -154,7 +154,7 @@ class Mintmanga : ParsedHttpSource() {
|
|||
if (authorElement == null) {
|
||||
authorElement = infoElement.select("span.elem_screenwriter").first()?.text()
|
||||
}
|
||||
manga.title = infoElement.select("h1.names .name").text()
|
||||
manga.title = document.select("h1.names .name").text()
|
||||
manga.author = authorElement
|
||||
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
|
||||
manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).plusElement(rawAgeStop).joinToString { it.trim() }
|
||||
|
@ -169,8 +169,8 @@ class Mintmanga : ParsedHttpSource() {
|
|||
}
|
||||
|
||||
private fun parseStatus(element: String): Int = when {
|
||||
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED
|
||||
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
element.contains("Запрещена публикация произведения по копирайту") || element.contains("ЗАПРЕЩЕНА К ПУБЛИКАЦИИ НА ТЕРРИТОРИИ РФ!") -> SManga.LICENSED
|
||||
element.contains("<b>Сингл</b>") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Readmanga'
|
||||
pkgNameSuffix = 'ru.readmanga'
|
||||
extClass = '.Readmanga'
|
||||
extVersionCode = 29
|
||||
extVersionCode = 30
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -43,13 +43,13 @@ class Readmanga : ParsedHttpSource() {
|
|||
|
||||
override fun popularMangaSelector() = "div.tile"
|
||||
|
||||
override fun latestUpdatesSelector() = "div.tile"
|
||||
override fun latestUpdatesSelector() = popularMangaSelector()
|
||||
|
||||
override fun popularMangaRequest(page: Int): Request =
|
||||
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers)
|
||||
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}", headers)
|
||||
|
||||
override fun latestUpdatesRequest(page: Int): Request =
|
||||
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}&max=70", headers)
|
||||
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}", headers)
|
||||
|
||||
override fun popularMangaFromElement(element: Element): SManga {
|
||||
val manga = SManga.create()
|
||||
|
@ -66,7 +66,7 @@ class Readmanga : ParsedHttpSource() {
|
|||
|
||||
override fun popularMangaNextPageSelector() = "a.nextLink"
|
||||
|
||||
override fun latestUpdatesNextPageSelector() = "a.nextLink"
|
||||
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder()
|
||||
|
@ -100,7 +100,7 @@ class Readmanga : ParsedHttpSource() {
|
|||
is OrderBy -> {
|
||||
if (filter.state > 0) {
|
||||
val ord = arrayOf("not", "year", "rate", "popularity", "votes", "created", "updated")[filter.state]
|
||||
val ordUrl = "$baseUrl/list?sortType=$ord".toHttpUrlOrNull()!!.newBuilder()
|
||||
val ordUrl = "$baseUrl/list?sortType=$ord&offset=${70 * (page - 1)}".toHttpUrlOrNull()!!.newBuilder()
|
||||
return GET(ordUrl.toString(), headers)
|
||||
}
|
||||
}
|
||||
|
@ -116,11 +116,11 @@ class Readmanga : ParsedHttpSource() {
|
|||
|
||||
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
|
||||
|
||||
// max 200 results
|
||||
override fun searchMangaNextPageSelector(): Nothing? = null
|
||||
// max 200 results (exception OrderBy)
|
||||
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
val infoElement = document.select("div.leftContent").first()
|
||||
val infoElement = document.select(".expandable").first()
|
||||
val rawCategory = infoElement.select("span.elem_category").text()
|
||||
val category = if (rawCategory.isNotEmpty()) {
|
||||
rawCategory.toLowerCase()
|
||||
|
@ -155,7 +155,7 @@ class Readmanga : ParsedHttpSource() {
|
|||
if (authorElement == null) {
|
||||
authorElement = infoElement.select("span.elem_screenwriter").first()?.text()
|
||||
}
|
||||
manga.title = infoElement.select("h1.names .name").text()
|
||||
manga.title = document.select("h1.names .name").text()
|
||||
manga.author = authorElement
|
||||
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
|
||||
manga.genre = infoElement.select("span.elem_genre").text().split(",").plusElement(category).plusElement(rawAgeStop).joinToString { it.trim() }
|
||||
|
@ -170,8 +170,8 @@ class Readmanga : ParsedHttpSource() {
|
|||
}
|
||||
|
||||
private fun parseStatus(element: String): Int = when {
|
||||
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED
|
||||
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
element.contains("Запрещена публикация произведения по копирайту") || element.contains("ЗАПРЕЩЕНА К ПУБЛИКАЦИИ НА ТЕРРИТОРИИ РФ!") -> SManga.LICENSED
|
||||
element.contains("<b>Сингл</b>") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
|
||||
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Selfmanga'
|
||||
pkgNameSuffix = 'ru.selfmanga'
|
||||
extClass = '.Selfmanga'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -30,13 +30,13 @@ class Selfmanga : ParsedHttpSource() {
|
|||
|
||||
override fun popularMangaSelector() = "div.tile"
|
||||
|
||||
override fun latestUpdatesSelector() = "div.tile"
|
||||
override fun latestUpdatesSelector() = popularMangaSelector()
|
||||
|
||||
override fun popularMangaRequest(page: Int): Request =
|
||||
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers)
|
||||
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}", headers)
|
||||
|
||||
override fun latestUpdatesRequest(page: Int): Request =
|
||||
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}&max=70", headers)
|
||||
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}", headers)
|
||||
|
||||
override fun popularMangaFromElement(element: Element): SManga {
|
||||
val manga = SManga.create()
|
||||
|
@ -53,7 +53,7 @@ class Selfmanga : ParsedHttpSource() {
|
|||
|
||||
override fun popularMangaNextPageSelector() = "a.nextLink"
|
||||
|
||||
override fun latestUpdatesNextPageSelector() = "a.nextLink"
|
||||
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||
val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder()
|
||||
|
@ -85,10 +85,10 @@ class Selfmanga : ParsedHttpSource() {
|
|||
override fun searchMangaNextPageSelector(): Nothing? = null
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
val infoElement = document.select("div.leftContent").first()
|
||||
val infoElement = document.select(".expandable").first()
|
||||
|
||||
val manga = SManga.create()
|
||||
manga.title = infoElement.select("h1.names .name").text()
|
||||
manga.title = document.select("h1.names .name").text()
|
||||
manga.author = infoElement.select("span.elem_author").first()?.text()
|
||||
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
|
||||
manga.description = infoElement.select("div.manga-description").text()
|
||||
|
@ -98,8 +98,8 @@ class Selfmanga : ParsedHttpSource() {
|
|||
}
|
||||
|
||||
private fun parseStatus(element: String): Int = when {
|
||||
element.contains("<h3>Запрещена публикация произведения по копирайту</h3>") -> SManga.LICENSED
|
||||
element.contains("<h1 class=\"names\"> Сингл") || element.contains("выпуск завершен") -> SManga.COMPLETED
|
||||
element.contains("Запрещена публикация произведения по копирайту") || element.contains("ЗАПРЕЩЕНА К ПУБЛИКАЦИИ НА ТЕРРИТОРИИ РФ!") -> SManga.LICENSED
|
||||
element.contains("<b>Сингл</b>") || element.contains("выпуск завершен") -> SManga.COMPLETED
|
||||
element.contains("выпуск продолжается") -> SManga.ONGOING
|
||||
else -> SManga.UNKNOWN
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue