fixes NontonAnimeIDProvider mainPage
This commit is contained in:
parent
8417bb961f
commit
ef72036b5c
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 2
|
||||
version = 3
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -47,15 +47,15 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
|
||||
document.select("section#postbaru").forEach { block ->
|
||||
val header = block.selectFirst("h2")!!.text().trim()
|
||||
val animes = block.select("article.animeseries").map {
|
||||
val animes = block.select("article.animeseries").mapNotNull {
|
||||
it.toSearchResult()
|
||||
}
|
||||
if (animes.isNotEmpty()) homePageList.add(HomePageList(header, animes))
|
||||
}
|
||||
|
||||
document.select("aside#sidebar_right > div:nth-child(4)").forEach { block ->
|
||||
document.select("aside#sidebar_right > div.side").forEach { block ->
|
||||
val header = block.selectFirst("h3")!!.ownText().trim()
|
||||
val animes = block.select("li.fullwdth").map {
|
||||
val animes = block.select("ul li.fullwdth").mapNotNull {
|
||||
it.toSearchResultPopular()
|
||||
}
|
||||
if (animes.isNotEmpty()) homePageList.add(HomePageList(header, animes))
|
||||
|
@ -91,9 +91,9 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun Element.toSearchResult(): AnimeSearchResponse {
|
||||
private fun Element.toSearchResult(): AnimeSearchResponse? {
|
||||
val href = getProperAnimeLink(fixUrl(this.selectFirst("a")!!.attr("href")))
|
||||
val title = this.selectFirst("h3.title")!!.text()
|
||||
val title = this.selectFirst("h3.title")?.text() ?: return null
|
||||
val posterUrl = fixUrl(this.select("img").attr("data-src"))
|
||||
|
||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||
|
@ -103,9 +103,9 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
|
||||
}
|
||||
|
||||
private fun Element.toSearchResultPopular(): AnimeSearchResponse {
|
||||
private fun Element.toSearchResultPopular(): AnimeSearchResponse? {
|
||||
val href = getProperAnimeLink(fixUrl(this.selectFirst("a")!!.attr("href")))
|
||||
val title = this.select("h4").text().trim()
|
||||
val title = this.selectFirst("h4")?.text()?.trim() ?: return null
|
||||
val posterUrl = fixUrl(this.select("img").attr("data-src"))
|
||||
|
||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||
|
|
Loading…
Reference in New Issue