[RU]Grouple sources fix status and pages (#7942)

This commit is contained in:
Eugene 2021-07-03 06:27:13 +05:00 committed by GitHub
parent 2635d10527
commit 5086df34d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 33 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mintmanga' extName = 'Mintmanga'
pkgNameSuffix = 'ru.mintmanga' pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga' extClass = '.Mintmanga'
extVersionCode = 30 extVersionCode = 31
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -42,14 +42,14 @@ class Mintmanga : ParsedHttpSource() {
.addNetworkInterceptor(rateLimitInterceptor).build() .addNetworkInterceptor(rateLimitInterceptor).build()
override fun popularMangaRequest(page: Int): Request = 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 = 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 popularMangaSelector() = "div.tile"
override fun latestUpdatesSelector() = "div.tile" override fun latestUpdatesSelector() = popularMangaSelector()
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
@ -66,7 +66,7 @@ class Mintmanga : ParsedHttpSource() {
override fun popularMangaNextPageSelector() = "a.nextLink" override fun popularMangaNextPageSelector() = "a.nextLink"
override fun latestUpdatesNextPageSelector() = "a.nextLink" override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder() val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder()
@ -100,7 +100,7 @@ class Mintmanga : ParsedHttpSource() {
is OrderBy -> { is OrderBy -> {
if (filter.state > 0) { if (filter.state > 0) {
val ord = arrayOf("not", "year", "rate", "popularity", "votes", "created", "updated")[filter.state] 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) return GET(ordUrl.toString(), headers)
} }
} }
@ -116,11 +116,11 @@ class Mintmanga : ParsedHttpSource() {
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
// max 200 results // max 200 results (exception OrderBy)
override fun searchMangaNextPageSelector(): Nothing? = null override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun mangaDetailsParse(document: Document): SManga { 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 rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) { val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase() rawCategory.toLowerCase()
@ -154,7 +154,7 @@ class Mintmanga : ParsedHttpSource() {
if (authorElement == null) { if (authorElement == null) {
authorElement = infoElement.select("span.elem_screenwriter").first()?.text() 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.author = authorElement
manga.artist = infoElement.select("span.elem_illustrator").first()?.text() 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() } 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 { private fun parseStatus(element: String): Int = when {
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED element.contains("Запрещена публикация произведения по копирайту") || element.contains("ЗАПРЕЩЕНА К ПУБЛИКАЦИИ НА ТЕРРИТОРИИ РФ!") -> SManga.LICENSED
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED element.contains("<b>Сингл</b>") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
else -> SManga.UNKNOWN else -> SManga.UNKNOWN
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Readmanga' extName = 'Readmanga'
pkgNameSuffix = 'ru.readmanga' pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga' extClass = '.Readmanga'
extVersionCode = 29 extVersionCode = 30
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -43,13 +43,13 @@ class Readmanga : ParsedHttpSource() {
override fun popularMangaSelector() = "div.tile" override fun popularMangaSelector() = "div.tile"
override fun latestUpdatesSelector() = "div.tile" override fun latestUpdatesSelector() = popularMangaSelector()
override fun popularMangaRequest(page: Int): Request = 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 = 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 { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
@ -66,7 +66,7 @@ class Readmanga : ParsedHttpSource() {
override fun popularMangaNextPageSelector() = "a.nextLink" override fun popularMangaNextPageSelector() = "a.nextLink"
override fun latestUpdatesNextPageSelector() = "a.nextLink" override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder() val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder()
@ -100,7 +100,7 @@ class Readmanga : ParsedHttpSource() {
is OrderBy -> { is OrderBy -> {
if (filter.state > 0) { if (filter.state > 0) {
val ord = arrayOf("not", "year", "rate", "popularity", "votes", "created", "updated")[filter.state] 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) return GET(ordUrl.toString(), headers)
} }
} }
@ -116,11 +116,11 @@ class Readmanga : ParsedHttpSource() {
override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element) override fun searchMangaFromElement(element: Element): SManga = popularMangaFromElement(element)
// max 200 results // max 200 results (exception OrderBy)
override fun searchMangaNextPageSelector(): Nothing? = null override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
override fun mangaDetailsParse(document: Document): SManga { 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 rawCategory = infoElement.select("span.elem_category").text()
val category = if (rawCategory.isNotEmpty()) { val category = if (rawCategory.isNotEmpty()) {
rawCategory.toLowerCase() rawCategory.toLowerCase()
@ -155,7 +155,7 @@ class Readmanga : ParsedHttpSource() {
if (authorElement == null) { if (authorElement == null) {
authorElement = infoElement.select("span.elem_screenwriter").first()?.text() 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.author = authorElement
manga.artist = infoElement.select("span.elem_illustrator").first()?.text() 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() } 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 { private fun parseStatus(element: String): Int = when {
element.contains("Запрещена публикация произведения по копирайту") -> SManga.LICENSED element.contains("Запрещена публикация произведения по копирайту") || element.contains("ЗАПРЕЩЕНА К ПУБЛИКАЦИИ НА ТЕРРИТОРИИ РФ!") -> SManga.LICENSED
element.contains("<h1 class=\"names\"> Сингл") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED element.contains("<b>Сингл</b>") || element.contains("<b>Перевод:</b> завершен") -> SManga.COMPLETED
element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING element.contains("<b>Перевод:</b> продолжается") -> SManga.ONGOING
else -> SManga.UNKNOWN else -> SManga.UNKNOWN
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Selfmanga' extName = 'Selfmanga'
pkgNameSuffix = 'ru.selfmanga' pkgNameSuffix = 'ru.selfmanga'
extClass = '.Selfmanga' extClass = '.Selfmanga'
extVersionCode = 8 extVersionCode = 9
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -30,13 +30,13 @@ class Selfmanga : ParsedHttpSource() {
override fun popularMangaSelector() = "div.tile" override fun popularMangaSelector() = "div.tile"
override fun latestUpdatesSelector() = "div.tile" override fun latestUpdatesSelector() = popularMangaSelector()
override fun popularMangaRequest(page: Int): Request = 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 = 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 { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
@ -53,7 +53,7 @@ class Selfmanga : ParsedHttpSource() {
override fun popularMangaNextPageSelector() = "a.nextLink" override fun popularMangaNextPageSelector() = "a.nextLink"
override fun latestUpdatesNextPageSelector() = "a.nextLink" override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder() val url = "$baseUrl/search/advanced".toHttpUrlOrNull()!!.newBuilder()
@ -85,10 +85,10 @@ class Selfmanga : ParsedHttpSource() {
override fun searchMangaNextPageSelector(): Nothing? = null override fun searchMangaNextPageSelector(): Nothing? = null
override fun mangaDetailsParse(document: Document): SManga { override fun mangaDetailsParse(document: Document): SManga {
val infoElement = document.select("div.leftContent").first() val infoElement = document.select(".expandable").first()
val manga = SManga.create() 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.author = infoElement.select("span.elem_author").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",") manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.description = infoElement.select("div.manga-description").text() manga.description = infoElement.select("div.manga-description").text()
@ -98,8 +98,8 @@ class Selfmanga : ParsedHttpSource() {
} }
private fun parseStatus(element: String): Int = when { private fun parseStatus(element: String): Int = when {
element.contains("<h3>Запрещена публикация произведения по копирайту</h3>") -> SManga.LICENSED element.contains("Запрещена публикация произведения по копирайту") || element.contains("ЗАПРЕЩЕНА К ПУБЛИКАЦИИ НА ТЕРРИТОРИИ РФ!") -> SManga.LICENSED
element.contains("<h1 class=\"names\"> Сингл") || element.contains("выпуск завершен") -> SManga.COMPLETED element.contains("<b>Сингл</b>") || element.contains("выпуск завершен") -> SManga.COMPLETED
element.contains("выпуск продолжается") -> SManga.ONGOING element.contains("выпуск продолжается") -> SManga.ONGOING
else -> SManga.UNKNOWN else -> SManga.UNKNOWN
} }