Update MundoDonghuaProvider.kt

This commit is contained in:
Diego Sánchez 2022-12-12 16:07:28 -03:00 committed by GitHub
parent f50af8b6f4
commit 78d044bf87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -103,14 +103,12 @@ class MundoDonghuaProvider : MainAPI() {
else -> null
}
var counter = 0
var condition = false
val specialEpisodes = app.get(mainUrl, timeout = 120).document.select(".col-xs-4").map {
counter = counter + 1
if (counter < 7){
condition = it.selectFirst("h5")?.text()?.lowercase()?.contains(title.lowercase()) ?: false
if (condition != null && condition == true) {
val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: ""
val link = it.selectFirst("a")?.attr("href") ?: ""
if (counter < 7)
val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: ""
val link = it.selectFirst("a")?.attr("href") ?: ""
if (name.lowercase().contains(title.lowercase())) {
Episode(fixUrl(link), name)
}
}