[KuroNeko + CuuTruyen] Small fixes (#1989)
This commit is contained in:
@@ -132,7 +132,7 @@ internal class CuuTruyenParser(context: MangaLoaderContext) :
|
|||||||
Manga(
|
Manga(
|
||||||
id = generateUid(jo.getLong("id")),
|
id = generateUid(jo.getLong("id")),
|
||||||
url = "/api/v2/mangas/${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"),
|
title = jo.getString("name"),
|
||||||
altTitles = emptySet(),
|
altTitles = emptySet(),
|
||||||
coverUrl = jo.getString("cover_mobile_url"),
|
coverUrl = jo.getString("cover_mobile_url"),
|
||||||
|
|||||||
@@ -209,11 +209,14 @@ internal class KuroNeko(context: MangaLoaderContext) : PagedMangaParser(context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun availableTags(): Set<MangaTag> {
|
private suspend fun availableTags(): Set<MangaTag> {
|
||||||
val doc = webClient.httpGet("https://$domain").parseHtml()
|
val doc = webClient.httpGet("https://$domain/tim-kiem").parseHtml()
|
||||||
return doc.select("ul.grid.grid-cols-2 a").mapIndexed { index, a ->
|
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(
|
MangaTag(
|
||||||
key = (index + 1).toString(),
|
key = number,
|
||||||
title = a.text(),
|
title = label.text(),
|
||||||
source = source,
|
source = source,
|
||||||
)
|
)
|
||||||
}.toSet()
|
}.toSet()
|
||||||
|
|||||||
Reference in New Issue
Block a user