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