Keyoapp: extract manga details selectors (#7076)
* extract manga details selectors * no bump
This commit is contained in:
parent
038e9dcdcb
commit
91b1c3e65e
|
@ -206,16 +206,21 @@ abstract class Keyoapp(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Details
|
// Details
|
||||||
|
protected open val descriptionSelector: String = "div:containsOwn(Synopsis) ~ div"
|
||||||
|
protected open val statusSelector: String = "div:has(span:containsOwn(Status)) ~ div"
|
||||||
|
protected open val authorSelector: String = "div:has(span:containsOwn(Author)) ~ div"
|
||||||
|
protected open val artistSelector: String = "div:has(span:containsOwn(Artist)) ~ div"
|
||||||
|
protected open val genreSelector: String = "div:has(span:containsOwn(Type)) ~ div"
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
|
||||||
title = document.selectFirst("div.grid > h1")!!.text()
|
title = document.selectFirst("div.grid > h1")!!.text()
|
||||||
thumbnail_url = document.getImageUrl("div[class*=photoURL]")
|
thumbnail_url = document.getImageUrl("div[class*=photoURL]")
|
||||||
description = document.selectFirst("div:containsOwn(Synopsis) ~ div")?.text()
|
description = document.selectFirst(descriptionSelector)?.text()
|
||||||
status = document.selectFirst("div:has(span:containsOwn(Status)) ~ div").parseStatus()
|
status = document.selectFirst(statusSelector).parseStatus()
|
||||||
author = document.selectFirst("div:has(span:containsOwn(Author)) ~ div")?.text()
|
author = document.selectFirst(authorSelector)?.text()
|
||||||
artist = document.selectFirst("div:has(span:containsOwn(Artist)) ~ div")?.text()
|
artist = document.selectFirst(artistSelector)?.text()
|
||||||
genre = buildList {
|
genre = buildList {
|
||||||
document.selectFirst("div:has(span:containsOwn(Type)) ~ div")?.text()?.replaceFirstChar {
|
document.selectFirst(genreSelector)?.text()?.replaceFirstChar {
|
||||||
if (it.isLowerCase()) {
|
if (it.isLowerCase()) {
|
||||||
it.titlecase(
|
it.titlecase(
|
||||||
Locale.getDefault(),
|
Locale.getDefault(),
|
||||||
|
|
|
@ -3,7 +3,7 @@ ext {
|
||||||
extClass = '.RezoScans'
|
extClass = '.RezoScans'
|
||||||
themePkg = 'keyoapp'
|
themePkg = 'keyoapp'
|
||||||
baseUrl = 'https://rezoscans.com'
|
baseUrl = 'https://rezoscans.com'
|
||||||
overrideVersionCode = 1
|
overrideVersionCode = 2
|
||||||
isNsfw = false
|
isNsfw = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,10 @@ class RezoScans : Keyoapp(
|
||||||
"Rezo Scans",
|
"Rezo Scans",
|
||||||
"https://rezoscans.com",
|
"https://rezoscans.com",
|
||||||
"en",
|
"en",
|
||||||
)
|
) {
|
||||||
|
override val descriptionSelector: String = "div.grid > div.overflow-hidden > p"
|
||||||
|
override val statusSelector: String = "div[alt=Status]"
|
||||||
|
override val authorSelector: String = "div[alt=Author]"
|
||||||
|
override val artistSelector: String = "div[alt=Artist]"
|
||||||
|
override val genreSelector: String = "div[alt='Series Type']"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue