diff --git a/MundoDonghuaProvider/build.gradle.kts b/MundoDonghuaProvider/build.gradle.kts index 62eb407..9f336ab 100644 --- a/MundoDonghuaProvider/build.gradle.kts +++ b/MundoDonghuaProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 1 +version = 2 cloudstream { @@ -23,4 +23,4 @@ cloudstream { ) iconUrl = "https://www.google.com/s2/favicons?domain=www.mundodonghua.com&sz=%size%" -} \ No newline at end of file +} diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 8381b2f..e41d77e 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -36,9 +36,10 @@ class MundoDonghuaProvider : MainAPI() { val title = it.selectFirst("h5")?.text() ?: "" val poster = it.selectFirst(".fit-1 img")?.attr("src") val epRegex = Regex("(\\/(\\d+)\$)") - val url = it.selectFirst("a")?.attr("href")?.replace(epRegex,"")?.replace("/ver/","/donghua/") val epnumRegex = Regex("((\\d+)$)") val epNum = epnumRegex.find(title)?.value?.toIntOrNull() + val epNumRemoveRegex = Regex("/" + epNum.toString() + "/.*") + val url = it.selectFirst("a")?.attr("href")?.replace(epRegex,"")?.replace("/ver/","/donghua/")?.replace(epNumRemoveRegex,"") val dubstat = if (title.contains("Latino") || title.contains("Castellano")) DubStatus.Dubbed else DubStatus.Subbed newAnimeSearchResponse(title.replace(Regex("Episodio|(\\d+)"),"").trim(), fixUrl(url ?: "")) { this.posterUrl = fixUrl(poster ?: "") @@ -214,4 +215,4 @@ class MundoDonghuaProvider : MainAPI() { } return true } -} \ No newline at end of file +}