Bato.to description: add extra info, format alternative titles (#7171)
* Bato.to: add extra info in description * Bato.to: format alt titles
This commit is contained in:
parent
924e064e42
commit
988d1b04af
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Bato.to'
|
extName = 'Bato.to'
|
||||||
extClass = '.BatoToFactory'
|
extClass = '.BatoToFactory'
|
||||||
extVersionCode = 45
|
extVersionCode = 46
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -335,14 +335,25 @@ open class BatoTo(
|
||||||
Regex("\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|〖[^〖〗]*〗|𖤍.+?𖤍|《[^》]*》|⌜.+?⌝|⟨[^⟩]*⟩|\\/Official|\\/ Official", RegexOption.IGNORE_CASE)
|
Regex("\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|〖[^〖〗]*〗|𖤍.+?𖤍|《[^》]*》|⌜.+?⌝|⟨[^⟩]*⟩|\\/Official|\\/ Official", RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document): SManga {
|
override fun mangaDetailsParse(document: Document): SManga {
|
||||||
val infoElement = document.select("div#mainer div.container-fluid")
|
val infoElement = document.selectFirst("div#mainer div.container-fluid")!!
|
||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
val workStatus = infoElement.select("div.attr-item:contains(original work) span").text()
|
val workStatus = infoElement.select("div.attr-item:contains(original work) span").text()
|
||||||
val uploadStatus = infoElement.select("div.attr-item:contains(upload status) span").text()
|
val uploadStatus = infoElement.select("div.attr-item:contains(upload status) span").text()
|
||||||
val originalTitle = infoElement.select("h3").text().removeEntities()
|
val originalTitle = infoElement.select("h3").text().removeEntities()
|
||||||
val alternativeTitles = document.select("div.pb-2.alias-set.line-b-f").text()
|
val description = buildString {
|
||||||
val description = infoElement.select("div.limit-html").text() + "\n" +
|
append(infoElement.select("div.limit-html").text())
|
||||||
infoElement.select(".episode-list > .alert-warning").text().trim()
|
infoElement.selectFirst(".episode-list > .alert-warning")?.also {
|
||||||
|
append("\n\n${it.text()}")
|
||||||
|
}
|
||||||
|
infoElement.selectFirst("h5:containsOwn(Extra Info:) + div")?.also {
|
||||||
|
append("\n\nExtra Info:\n${it.text()}")
|
||||||
|
}
|
||||||
|
document.selectFirst("div.pb-2.alias-set.line-b-f")?.also {
|
||||||
|
append("\n\nAlternative Titles:\n")
|
||||||
|
append(it.text().split('/').joinToString("\n") { "• ${it.trim()}" })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val cleanedTitle = if (isRemoveTitleVersion()) {
|
val cleanedTitle = if (isRemoveTitleVersion()) {
|
||||||
originalTitle.replace(titleRegex, "").trim()
|
originalTitle.replace(titleRegex, "").trim()
|
||||||
} else {
|
} else {
|
||||||
|
@ -354,8 +365,7 @@ open class BatoTo(
|
||||||
manga.artist = infoElement.select("div.attr-item:contains(artist) span").text()
|
manga.artist = infoElement.select("div.attr-item:contains(artist) span").text()
|
||||||
manga.status = parseStatus(workStatus, uploadStatus)
|
manga.status = parseStatus(workStatus, uploadStatus)
|
||||||
manga.genre = infoElement.select(".attr-item b:contains(genres) + span ").joinToString { it.text() }
|
manga.genre = infoElement.select(".attr-item b:contains(genres) + span ").joinToString { it.text() }
|
||||||
manga.description = description +
|
manga.description = description
|
||||||
if (alternativeTitles.isNotBlank()) "\n\nAlternative Titles:\n$alternativeTitles" else ""
|
|
||||||
manga.thumbnail_url = document.select("div.attr-cover img").attr("abs:src")
|
manga.thumbnail_url = document.select("div.attr-cover img").attr("abs:src")
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue