[KuroNeko + CuuTruyen] Small fixes (#1989)

This commit is contained in:
Draken
2025-07-21 22:52:43 +07:00
committed by GitHub
parent 5962efb7df
commit d0b2002a1b
2 changed files with 8 additions and 5 deletions

View File

@@ -132,7 +132,7 @@ internal class CuuTruyenParser(context: MangaLoaderContext) :
Manga(
id = generateUid(jo.getLong("id")),
url = "/api/v2/mangas/${jo.getLong("id")}",
publicUrl = "https://$domain/manga/${jo.getLong("id")}",
publicUrl = "https://$domain/mangas/${jo.getLong("id")}",
title = jo.getString("name"),
altTitles = emptySet(),
coverUrl = jo.getString("cover_mobile_url"),

View File

@@ -209,11 +209,14 @@ internal class KuroNeko(context: MangaLoaderContext) : PagedMangaParser(context,
}
private suspend fun availableTags(): Set<MangaTag> {
val doc = webClient.httpGet("https://$domain").parseHtml()
return doc.select("ul.grid.grid-cols-2 a").mapIndexed { index, a ->
val doc = webClient.httpGet("https://$domain/tim-kiem").parseHtml()
val regex = Regex("toggleGenre\\('([0-9]+)'\\)")
return doc.select("div.grid.grid-cols-3 label").mapNotNullToSet { label ->
val attr = label.attr("@click")
val number = attr.findGroupValue(regex) ?: return@mapNotNullToSet null
MangaTag(
key = (index + 1).toString(),
title = a.text(),
key = number,
title = label.text(),
source = source,
)
}.toSet()