[KuroNeko + CuuTruyen] Small fixes (#1989)
This commit is contained in:
@@ -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"),
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user