Keyoapp: extract manga details selectors (#7076)

* extract manga details selectors

* no bump
This commit is contained in:
dngonz 2025-01-11 00:46:06 +01:00 committed by Draff
parent 038e9dcdcb
commit 91b1c3e65e
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
3 changed files with 18 additions and 7 deletions

View File

@ -206,16 +206,21 @@ abstract class Keyoapp(
}
// 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 {
title = document.selectFirst("div.grid > h1")!!.text()
thumbnail_url = document.getImageUrl("div[class*=photoURL]")
description = document.selectFirst("div:containsOwn(Synopsis) ~ div")?.text()
status = document.selectFirst("div:has(span:containsOwn(Status)) ~ div").parseStatus()
author = document.selectFirst("div:has(span:containsOwn(Author)) ~ div")?.text()
artist = document.selectFirst("div:has(span:containsOwn(Artist)) ~ div")?.text()
description = document.selectFirst(descriptionSelector)?.text()
status = document.selectFirst(statusSelector).parseStatus()
author = document.selectFirst(authorSelector)?.text()
artist = document.selectFirst(artistSelector)?.text()
genre = buildList {
document.selectFirst("div:has(span:containsOwn(Type)) ~ div")?.text()?.replaceFirstChar {
document.selectFirst(genreSelector)?.text()?.replaceFirstChar {
if (it.isLowerCase()) {
it.titlecase(
Locale.getDefault(),

View File

@ -3,7 +3,7 @@ ext {
extClass = '.RezoScans'
themePkg = 'keyoapp'
baseUrl = 'https://rezoscans.com'
overrideVersionCode = 1
overrideVersionCode = 2
isNsfw = false
}

View File

@ -6,4 +6,10 @@ class RezoScans : Keyoapp(
"Rezo Scans",
"https://rezoscans.com",
"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']"
}