From cf20c5151e3854fab44464ac7930b10048462d29 Mon Sep 17 00:00:00 2001 From: Ziedelth Date: Sun, 1 Oct 2023 11:42:14 +0200 Subject: [PATCH] Corrected image extraction in CrunchyrollConverter --- .../fr/jais/scraper/converters/CrunchyrollConverter.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/fr/jais/scraper/converters/CrunchyrollConverter.kt b/src/main/kotlin/fr/jais/scraper/converters/CrunchyrollConverter.kt index 9d0977e..768475a 100644 --- a/src/main/kotlin/fr/jais/scraper/converters/CrunchyrollConverter.kt +++ b/src/main/kotlin/fr/jais/scraper/converters/CrunchyrollConverter.kt @@ -174,9 +174,13 @@ class CrunchyrollConverter(private val platform: CrunchyrollPlatform) { // ----- IMAGE ----- Logger.info("Get image...") - val image = - result.selectXpath("//*[@id=\"content\"]/div/div[2]/div/div[1]/div[2]/div/div/div[2]/div[2]/figure/picture/img") - .attr("src").toHTTPS() + var image = + result.selectXpath("//*[@id=\"content\"]/div/div[2]/div/div[1]/div[2]/div/div/div[2]/div[2]/figure/picture/img").attr("src").toHTTPS() + + if (image.isBlank()) { + image = result.selectXpath("#content > div > div.app-body-wrapper > div > div.erc-series-key-art > div.content-wrapper--MF5LS > div > div > div.background-image > div.content-image--3na7E.undefined.background.tall-image > figure > picture > img").attr("src").toHTTPS() + } + Logger.config("Image: $image") // ----- DESCRIPTION -----