Added dub flag to kawaiifu

This commit is contained in:
Arjix 2021-09-12 03:55:29 +03:00 committed by GitHub
parent 7cb68fc245
commit fb8eb1bd6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,15 +26,16 @@ class KawaiifuProvider : MainAPI() {
val soup = Jsoup.parse(khttp.get(mainUrl).text) val soup = Jsoup.parse(khttp.get(mainUrl).text)
items.add(HomePageList("Latest Updates", soup.select(".today-update .item").map { items.add(HomePageList("Latest Updates", soup.select(".today-update .item").map {
val title = it.selectFirst("img").attr("alt")
AnimeSearchResponse( AnimeSearchResponse(
it.selectFirst("img").attr("alt"), title,
it.selectFirst("a").attr("href"), it.selectFirst("a").attr("href"),
this.name, this.name,
TvType.Anime, TvType.Anime,
it.selectFirst("img").attr("src"), it.selectFirst("img").attr("src"),
it.selectFirst("h4 > a").attr("href").split("-").last().toIntOrNull(), it.selectFirst("h4 > a").attr("href").split("-").last().toIntOrNull(),
null, null,
EnumSet.of(DubStatus.Subbed), if (title.contains("(DUB)") EnumSet.of(DubStatus.Dubbed) else EnumSet.of(DubStatus.Subbed),
null, null,
null null
) )
@ -43,15 +44,16 @@ class KawaiifuProvider : MainAPI() {
try { try {
val title = section.selectFirst(".title").text() val title = section.selectFirst(".title").text()
val anime = section.select(".list-film > .item").map { ani -> val anime = section.select(".list-film > .item").map { ani ->
val animTitle = ani.selectFirst("img").attr("alt")
AnimeSearchResponse( AnimeSearchResponse(
ani.selectFirst("img").attr("alt"), animTitle,
ani.selectFirst("a").attr("href"), ani.selectFirst("a").attr("href"),
this.name, this.name,
TvType.Anime, TvType.Anime,
ani.selectFirst("img").attr("src"), ani.selectFirst("img").attr("src"),
ani.selectFirst(".vl-chil-date").text().toIntOrNull(), ani.selectFirst(".vl-chil-date").text().toIntOrNull(),
null, null,
EnumSet.of(DubStatus.Subbed), if (animTitle.contains("(DUB)") EnumSet.of(DubStatus.Dubbed) else EnumSet.of(DubStatus.Subbed),
null, null,
null null
) )
@ -85,7 +87,7 @@ class KawaiifuProvider : MainAPI() {
poster, poster,
year, year,
null, null,
EnumSet.of(DubStatus.Subbed), if (title.contains("(DUB)") EnumSet.of(DubStatus.Dubbed) else EnumSet.of(DubStatus.Subbed),
null, null,
null, null,
) )