From fd1911a19fe526dbdd1e2cf82b92f1f97e870128 Mon Sep 17 00:00:00 2001 From: Chopper <156493704+ttony2chopper@users.noreply.github.com> Date: Sun, 7 Apr 2024 01:36:30 -0300 Subject: [PATCH] BlackoutComics: Fix selectors (#2283) * Fix selectors * Get element that contains no hidden element * Fix latestUpdate and remove selector inversion for hidden elements --- src/pt/blackoutcomics/build.gradle | 2 +- .../extension/pt/blackoutcomics/BlackoutComics.kt | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pt/blackoutcomics/build.gradle b/src/pt/blackoutcomics/build.gradle index 5ed0fb414..ea5af630c 100644 --- a/src/pt/blackoutcomics/build.gradle +++ b/src/pt/blackoutcomics/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Blackout Comics' extClass = '.BlackoutComics' - extVersionCode = 2 + extVersionCode = 3 isNsfw = true } diff --git a/src/pt/blackoutcomics/src/eu/kanade/tachiyomi/extension/pt/blackoutcomics/BlackoutComics.kt b/src/pt/blackoutcomics/src/eu/kanade/tachiyomi/extension/pt/blackoutcomics/BlackoutComics.kt index 742c54185..715e6badb 100644 --- a/src/pt/blackoutcomics/src/eu/kanade/tachiyomi/extension/pt/blackoutcomics/BlackoutComics.kt +++ b/src/pt/blackoutcomics/src/eu/kanade/tachiyomi/extension/pt/blackoutcomics/BlackoutComics.kt @@ -48,8 +48,8 @@ class BlackoutComics : ParsedHttpSource() { override fun popularMangaFromElement(element: Element) = SManga.create().apply { setUrlWithoutDomain(element.attr("href")) - thumbnail_url = element.selectFirst("img:not(.hidden)")?.absUrl("src") - title = element.selectFirst("p:not(.hidden), span.text-comic")!!.text() + thumbnail_url = element.selectFirst("img.custom-image:not(.hidden), img.img-comics")?.absUrl("src") + title = element.selectFirst("p.image-name:not(.hidden), span.text-comic")!!.text() } override fun popularMangaNextPageSelector() = null @@ -96,9 +96,11 @@ class BlackoutComics : ParsedHttpSource() { // =========================== Manga Details ============================ override fun mangaDetailsParse(document: Document) = SManga.create().apply { - val row = document.selectFirst("section > div.container > div.row")!! - thumbnail_url = row.selectFirst("img:not(.hidden)")?.absUrl("src") - title = row.selectFirst("div.trailer-content > h2:not(.hidden)")!!.text() + val row = document.selectFirst("div.special-edition")!! + thumbnail_url = row.selectFirst("img:last-child")?.absUrl("src") + title = row.select("h2") + .first { it.classNames().isEmpty() }!! + .text() with(row.selectFirst("div.trailer-content:has(h3:containsOwn(Detalhes))")!!) { println(outerHtml()) @@ -153,7 +155,7 @@ class BlackoutComics : ParsedHttpSource() { // =============================== Pages ================================ override fun pageListParse(document: Document): List { - return document.select("div.chapter-image-ofc canvas").mapIndexed { index, item -> + return document.select("div.chapter-image canvas").mapIndexed { index, item -> Page(index, "", item.absUrl("data-src")) } }