[RU]YagamiProject exclude the same html (#8001)
* [RU]YagamiProject exclude the same html * fix empty title
This commit is contained in:
parent
03850d43a7
commit
979592480c
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'YagamiProject'
|
extName = 'YagamiProject'
|
||||||
pkgNameSuffix = 'ru.yagamiproject'
|
pkgNameSuffix = 'ru.yagamiproject'
|
||||||
extClass = '.YagamiProject'
|
extClass = '.YagamiProject'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,8 @@ class YagamiProject : ParsedHttpSource() {
|
|||||||
return SManga.create().apply {
|
return SManga.create().apply {
|
||||||
element.select(".title a").first().let {
|
element.select(".title a").first().let {
|
||||||
setUrlWithoutDomain(it.attr("href"))
|
setUrlWithoutDomain(it.attr("href"))
|
||||||
title = it.attr("title").split(" / ").sorted().first()
|
val baseTitle = it.attr("title")
|
||||||
|
title = if (baseTitle.isNullOrEmpty()) { it.text() } else baseTitle.split(" / ").sorted().first()
|
||||||
}
|
}
|
||||||
thumbnail_url = element.select(".cover_mini > img").attr("src").replace("thumb_", "")
|
thumbnail_url = element.select(".cover_mini > img").attr("src").replace("thumb_", "")
|
||||||
}
|
}
|
||||||
@ -91,21 +92,21 @@ 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(Автор)").text().substringAfter("Автор(ы): ").split(" / ").sorted().first()
|
manga.author = infoElement.select("li:contains(Автор(ы):)")?.first()?.text()?.substringAfter("Автор(ы): ")?.split(" / ")?.sorted()?.first()
|
||||||
manga.artist = infoElement.select("li:contains(Художник)").text().substringAfter("Художник(и): ").split(" / ").sorted().first()
|
manga.artist = infoElement.select("li:contains(Художник(и):)")?.first()?.text()?.substringAfter("Художник(и): ")?.split(" / ")?.sorted()?.first()
|
||||||
manga.status = when (infoElement.select("li:contains(Статус перевода) span").text()) {
|
manga.status = when (infoElement.select("li:contains(Статус перевода:) span")?.first()?.text()) {
|
||||||
"онгоинг" -> SManga.ONGOING
|
"онгоинг" -> SManga.ONGOING
|
||||||
"активный" -> SManga.ONGOING
|
"активный" -> SManga.ONGOING
|
||||||
"завершён" -> SManga.COMPLETED
|
"завершён" -> SManga.COMPLETED
|
||||||
else -> SManga.UNKNOWN
|
else -> SManga.UNKNOWN
|
||||||
}
|
}
|
||||||
manga.genre = infoElement.select("li:contains(Жанры)").text().substringAfter("Жанры: ")
|
manga.genre = infoElement.select("li:contains(Жанры:)")?.first()?.text()?.substringAfter("Жанры: ")
|
||||||
val altSelector = infoElement.select("li:contains(Название)")
|
val altSelector = infoElement.select("li:contains(Название:)")
|
||||||
var altName = ""
|
var altName = ""
|
||||||
if (altSelector.isNotEmpty()) {
|
if (altSelector.isNotEmpty()) {
|
||||||
altName = "Альтернативные названия:\n" + altSelector.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(Описание)").text().substringAfter("Описание: ")
|
manga.description = titlestr.last().replace(":: ", "") + "\n" + altName + infoElement.select("li:contains(Описание:)")?.first()?.text()?.substringAfter("Описание: ")
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user