mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
AnimeIndo: fix homepage
This commit is contained in:
parent
54a7268902
commit
610bb856c5
2 changed files with 9 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 12
|
version = 13
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -60,22 +60,22 @@ class AnimeIndoProvider : MainAPI() {
|
||||||
return if (uri.contains("/anime/")) {
|
return if (uri.contains("/anime/")) {
|
||||||
uri
|
uri
|
||||||
} else {
|
} else {
|
||||||
var title = uri.substringAfter("nonton/")
|
var title = uri.substringAfter("$mainUrl/")
|
||||||
title = when {
|
title = when {
|
||||||
(title.contains("-episode")) && !(title.contains("-movie")) -> Regex("(.+)-episode").find(
|
(title.contains("-episode")) && !(title.contains("-movie")) -> title.substringBefore(
|
||||||
title
|
"-episode"
|
||||||
)?.groupValues?.get(1).toString()
|
)
|
||||||
(title.contains("-movie")) -> Regex("(.+)-movie").find(title)?.groupValues?.get(
|
|
||||||
1
|
(title.contains("-movie")) -> title.substringBefore("-movie")
|
||||||
).toString()
|
|
||||||
else -> title
|
else -> title
|
||||||
}
|
}
|
||||||
|
|
||||||
"$mainUrl/anime/$title"
|
"$mainUrl/anime/$title"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Element.toSearchResult(): AnimeSearchResponse {
|
private fun Element.toSearchResult(): AnimeSearchResponse {
|
||||||
val title = this.selectFirst("div.titlex, h2.entry-title, h4")?.text()?.trim() ?: ""
|
val title = this.selectFirst("div.title, h2.entry-title, h4")?.text()?.trim() ?: ""
|
||||||
val href = getProperAnimeLink(this.selectFirst("a")!!.attr("href"))
|
val href = getProperAnimeLink(this.selectFirst("a")!!.attr("href"))
|
||||||
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("src"))
|
val posterUrl = fixUrlNull(this.selectFirst("img")?.attr("src"))
|
||||||
val epNum = this.selectFirst("span.episode")?.ownText()?.replace(Regex("\\D"), "")?.trim()
|
val epNum = this.selectFirst("span.episode")?.ownText()?.replace(Regex("\\D"), "")?.trim()
|
||||||
|
|
Loading…
Reference in a new issue