IlGenioDelloStreamingProvider fix

This commit is contained in:
Antony 2022-08-27 13:50:42 +02:00
parent 4a6073ba3f
commit 5b823712fe

View file

@ -115,15 +115,16 @@ class IlGenioDelloStreamingProvider : MainAPI() {
val epName = episodes.firstNotNullOf{it.selectFirst("li.other_link")?.text()?:""} val epName = episodes.firstNotNullOf{it.selectFirst("li.other_link")?.text()?:""}
episodes.map{ episode -> episodes.map{ episode ->
val subtag = episode.selectFirst("li.season-no")?.text()?.takeIf {it.contains("Sub")}?.substringAfter(" ") ?: "" val seasonNo = episode.selectFirst("li.season-no")
val subtag = seasonNo?.text()?.takeIf {it.contains("Sub")}?.substringAfter(" ") ?: ""
val urls = episode.getElementsByAttributeValue("target", "_blank").map { it.attr("href").trim() } val urls = episode.getElementsByAttributeValue("target", "_blank").map { it.attr("href").trim() }
.filter { it.isNotEmpty()}.toJson() .filter { it.isNotEmpty()}.toJson()
episodeList.add(Episode( episodeList.add(Episode(
data = urls, data = urls,
posterUrl = posterUrl, posterUrl = posterUrl,
season = seasons.key.toIntOrNull(), season = seasons.key.toIntOrNull(),
name = "$epName ${subtag.uppercase()}", name = "$epName ${subtag.uppercase()}",
episode = seasonNo?.text()?.substringAfter("x")?.filter { it.isDigit() }?.toIntOrNull()
)) ))
} }