mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Update MundoDonghuaProvider.kt
This commit is contained in:
parent
16e587bf8f
commit
def04b7c74
1 changed files with 6 additions and 2 deletions
|
@ -37,14 +37,18 @@ class MundoDonghuaProvider : MainAPI() {
|
||||||
val poster = it.selectFirst(".fit-1 img")?.attr("src")
|
val poster = it.selectFirst(".fit-1 img")?.attr("src")
|
||||||
val epRegex = Regex("(\\/(\\d+)\$)")
|
val epRegex = Regex("(\\/(\\d+)\$)")
|
||||||
var url = it.selectFirst("a")?.attr("href")?.replace(epRegex,"")?.replace("/ver/","/donghua/")
|
var url = it.selectFirst("a")?.attr("href")?.replace(epRegex,"")?.replace("/ver/","/donghua/")
|
||||||
var urllast = url?.last()
|
var urllast = url?.takeLastWhile { it == "=" }
|
||||||
val epnumRegex = Regex("((\\d+)$)")
|
val epnumRegex = Regex("((\\d+)$)")
|
||||||
val epNum = epnumRegex.find(title)?.value?.toIntOrNull()
|
val epNum = epnumRegex.find(title)?.value?.toIntOrNull()
|
||||||
val epNumLenght = epNum.toString()!!.length
|
val epNumLenght = epNum.toString()!!.length
|
||||||
if (urllast.toString() == "="){
|
if (urllast.toString() == "="){
|
||||||
val numbersfinal = 61 + epNumLenght + 1
|
val numbersfinal = 62 + epNumLenght
|
||||||
|
url = url?.dropLast(numbersfinal)
|
||||||
|
} else if (urllast.toString() == "=="){
|
||||||
|
val numbersfinal = 90 + epNumLenght
|
||||||
url = url?.dropLast(numbersfinal)
|
url = url?.dropLast(numbersfinal)
|
||||||
}
|
}
|
||||||
|
|
||||||
val dubstat = if (title.contains("Latino") || title.contains("Castellano")) DubStatus.Dubbed else DubStatus.Subbed
|
val dubstat = if (title.contains("Latino") || title.contains("Castellano")) DubStatus.Dubbed else DubStatus.Subbed
|
||||||
newAnimeSearchResponse(title.replace(Regex("Episodio|(\\d+)"),"").trim(), fixUrl(url ?: "")) {
|
newAnimeSearchResponse(title.replace(Regex("Episodio|(\\d+)"),"").trim(), fixUrl(url ?: "")) {
|
||||||
this.posterUrl = fixUrl(poster ?: "")
|
this.posterUrl = fixUrl(poster ?: "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue