From 81802331dda9f163e94ab69214a02e7a4a9130d7 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Fri, 6 May 2022 14:04:22 +0300 Subject: [PATCH] [DesuMe] Fix tags list --- .../org/koitharu/kotatsu/parsers/site/DesuMeParser.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/DesuMeParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/DesuMeParser.kt index 1cc38970..c1c19dde 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/DesuMeParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/DesuMeParser.kt @@ -137,10 +137,15 @@ internal class DesuMeParser(override val context: MangaLoaderContext) : MangaPar val root = doc.body().getElementById("animeFilter") ?.selectFirst(".catalog-genres") ?: throw ParseException("Root not found") return root.select("li").mapToSet { + val input = it.selectFirst("input") ?: parseFailed() MangaTag( source = source, - key = it.selectFirst("input")?.attr("data-genre") ?: parseFailed(), - title = it.selectFirst("label")?.text()?.toTitleCase() ?: parseFailed(), + key = input.attr("data-genre-slug").ifEmpty { + parseFailed("data-genre-slug is empty") + }, + title = input.attr("data-genre-name").toTitleCase().ifEmpty { + parseFailed("data-genre-name is empty") + }, ) } }