[RU]YagamiProject fix chapter_number & searchMangaRequest (#12185)
* [RU]YagamiProject fix chapter_number & searchMangaRequest * N/A authors * no "null" description * href number maybe no float
This commit is contained in:
parent
6bbd8b3375
commit
5086c99911
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'YagamiProject'
|
extName = 'YagamiProject'
|
||||||
pkgNameSuffix = 'ru.yagamiproject'
|
pkgNameSuffix = 'ru.yagamiproject'
|
||||||
extClass = '.YagamiProject'
|
extClass = '.YagamiProject'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -52,9 +52,9 @@ class YagamiProject : ParsedHttpSource() {
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val url = if (query.isNotBlank()) {
|
if (query.isNotBlank()) {
|
||||||
"$baseUrl/reader/search/?s=$query&p=$page"
|
return GET("$baseUrl/reader/search/?s=$query&p=$page", headers)
|
||||||
} else {
|
}
|
||||||
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
(if (filters.isEmpty()) getFilterList() else filters).forEach { filter ->
|
||||||
when (filter) {
|
when (filter) {
|
||||||
is CategoryList -> {
|
is CategoryList -> {
|
||||||
|
@ -73,9 +73,7 @@ class YagamiProject : ParsedHttpSource() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw Exception("Filters Not")
|
return popularMangaRequest(page)
|
||||||
}
|
|
||||||
return GET(url, headers)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
|
override fun searchMangaNextPageSelector() = popularMangaNextPageSelector()
|
||||||
|
@ -92,8 +90,8 @@ class YagamiProject : ParsedHttpSource() {
|
||||||
val titlestr = document.select("title").text().substringBefore(" :: Yagami").split(" :: ").sorted()
|
val titlestr = document.select("title").text().substringBefore(" :: Yagami").split(" :: ").sorted()
|
||||||
manga.title = titlestr.first().replace(":: ", "")
|
manga.title = titlestr.first().replace(":: ", "")
|
||||||
manga.thumbnail_url = document.select(".cover img").first().attr("src")
|
manga.thumbnail_url = document.select(".cover img").first().attr("src")
|
||||||
manga.author = infoElement.select("li:contains(Автор(ы):)")?.first()?.text()?.substringAfter("Автор(ы): ")?.split(" / ")?.sorted()?.first()
|
manga.author = infoElement.select("li:contains(Автор(ы):)")?.first()?.text()?.substringAfter("Автор(ы): ")?.split(" / ")?.sorted()?.first()?.replace("N/A", "")?.trim()
|
||||||
manga.artist = infoElement.select("li:contains(Художник(и):)")?.first()?.text()?.substringAfter("Художник(и): ")?.split(" / ")?.sorted()?.first()
|
manga.artist = infoElement.select("li:contains(Художник(и):)")?.first()?.text()?.substringAfter("Художник(и): ")?.split(" / ")?.sorted()?.first()?.replace("N/A", "")?.trim()
|
||||||
manga.status = when (infoElement.select("li:contains(Статус перевода:) span")?.first()?.text()) {
|
manga.status = when (infoElement.select("li:contains(Статус перевода:) span")?.first()?.text()) {
|
||||||
"онгоинг" -> SManga.ONGOING
|
"онгоинг" -> SManga.ONGOING
|
||||||
"активный" -> SManga.ONGOING
|
"активный" -> SManga.ONGOING
|
||||||
|
@ -106,7 +104,8 @@ class YagamiProject : ParsedHttpSource() {
|
||||||
if (altSelector.isNotEmpty()) {
|
if (altSelector.isNotEmpty()) {
|
||||||
altName = "Альтернативные названия:\n" + altSelector.first().toString().replace("<li><b>Название</b>: ", "").replace("<br>", " / ").substringAfter(" / ").substringBefore("</li>") + "\n\n"
|
altName = "Альтернативные названия:\n" + altSelector.first().toString().replace("<li><b>Название</b>: ", "").replace("<br>", " / ").substringAfter(" / ").substringBefore("</li>") + "\n\n"
|
||||||
}
|
}
|
||||||
manga.description = titlestr.last().replace(":: ", "") + "\n" + altName + infoElement.select("li:contains(Описание:)")?.first()?.text()?.substringAfter("Описание: ")
|
val descriptElem = infoElement.select("li:contains(Описание:)")?.first()?.text()?.substringAfter("Описание: ") ?: ""
|
||||||
|
manga.description = titlestr.last().replace(":: ", "") + "\n" + altName + descriptElem
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,15 +114,13 @@ class YagamiProject : ParsedHttpSource() {
|
||||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||||
val chapter = element.select(".title a")
|
val chapter = element.select(".title a")
|
||||||
val chapterScan_Date = element.select(".meta_r")
|
val chapterScan_Date = element.select(".meta_r")
|
||||||
name = when {
|
|
||||||
chapter.attr("title").isNullOrBlank() -> chapter.text()
|
name = if (chapter.attr("title").isNullOrBlank())
|
||||||
else -> chapter.attr("title")
|
chapter.text()
|
||||||
}
|
else chapter.attr("title")
|
||||||
val numout = name.substringBefore(":").substringAfterLast(" ").substringAfterLast("№")
|
|
||||||
chapter_number = when {
|
chapter_number = name.substringBefore(":").substringAfterLast(" ").substringAfterLast("№").substringAfterLast("#").toFloatOrNull() ?: chapter.attr("href").substringBeforeLast("/").substringAfterLast("/").toFloatOrNull() ?: -1f
|
||||||
numout.contains(Regex("^[0-9]+")) -> numout.toFloat()
|
|
||||||
else -> 0F
|
|
||||||
}
|
|
||||||
setUrlWithoutDomain(chapter.attr("href"))
|
setUrlWithoutDomain(chapter.attr("href"))
|
||||||
date_upload = parseDate(chapterScan_Date.text().substringAfter(", "))
|
date_upload = parseDate(chapterScan_Date.text().substringAfter(", "))
|
||||||
scanlator = if (chapterScan_Date.select("a").isNotEmpty()) {
|
scanlator = if (chapterScan_Date.select("a").isNotEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue