From 242722d1b4633a83e2a594054f5b36033b79aefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 15:52:29 -0300 Subject: [PATCH 01/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 0dbc708..e2bca49 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { else -> null } var counter = 0 - var condition = "" + var condition = false val specialEpisodes = app.get(mainUrl, timeout = 120).document.select(".col-xs-4").map { counter = counter + 1 if (counter < 7){ From f50af8b6f47bd833b37362ccfe6c90b885be2da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 15:56:35 -0300 Subject: [PATCH 02/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index e2bca49..8119292 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -107,7 +107,7 @@ class MundoDonghuaProvider : MainAPI() { 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()) + 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") ?: "" From 78d044bf878082bcf4eb08c60d2e9dff7f8040e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:07:28 -0300 Subject: [PATCH 03/30] Update MundoDonghuaProvider.kt --- .../main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 8119292..6f3bfaa 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -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) } } From f0a1d04b1e29631eb28ae124524f2496551c7557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:13:37 -0300 Subject: [PATCH 04/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 6f3bfaa..4ef0b94 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -105,7 +105,7 @@ class MundoDonghuaProvider : MainAPI() { var counter = 0 val specialEpisodes = app.get(mainUrl, timeout = 120).document.select(".col-xs-4").map { counter = counter + 1 - if (counter < 7) + if (counter < 7) { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.lowercase().contains(title.lowercase())) { From ab1881bd8f93cd2c2519ca0bf5c38f8630598677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:22:54 -0300 Subject: [PATCH 05/30] Debugging --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 4ef0b94..d49cbfc 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -108,17 +108,15 @@ class MundoDonghuaProvider : MainAPI() { 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) - } + Episode(fixUrl(link), name) } - } + }.reversed() val episodes = doc.select("ul.donghua-list a").map { val name = it.selectFirst(".fs-16")?.text() val link = it.attr("href") Episode(fixUrl(link), name) }.reversed() - val episodesFinal = specialEpisodes + episodes + val episodesFinal = episodes + specialEpisodes val typeinfo = doc.select("div.row div.col-md-6.pl-15 p.fc-dark").text() val tvType = if (typeinfo.contains(Regex("Tipo.*Pel.cula"))) TvType.AnimeMovie else TvType.Anime return newAnimeLoadResponse(title, url, tvType) { From 315f5faeb0602f149d0ee4d321e155c0932c8039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:30:35 -0300 Subject: [PATCH 06/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index d49cbfc..02489cc 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { else -> null } var counter = 0 - val specialEpisodes = app.get(mainUrl, timeout = 120).document.select(".col-xs-4").map { + val specialEpisodes = app.get(mainUrl, timeout = 120).document.select("div.row .col-xs-4").map { counter = counter + 1 if (counter < 7) { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" From 1d4cd6738c994326f4521dcd74e69685dcae8615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:36:08 -0300 Subject: [PATCH 07/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 02489cc..9770f23 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,12 +103,14 @@ class MundoDonghuaProvider : MainAPI() { else -> null } var counter = 0 - val specialEpisodes = app.get(mainUrl, timeout = 120).document.select("div.row .col-xs-4").map { + val specialEpisodes = app.get("https://www.mundodonghua.com", timeout = 120).document.select("div.row .col-xs-4").map { counter = counter + 1 if (counter < 7) { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" - Episode(fixUrl(link), name) + if (name.lowercase().contains(title.lowercase())) { + Episode(fixUrl(link), name) + } } }.reversed() val episodes = doc.select("ul.donghua-list a").map { From 63a1385f993808fe5f8de2b40f4831d445c76c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:44:04 -0300 Subject: [PATCH 08/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 9770f23..55d0fc6 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -118,7 +118,7 @@ class MundoDonghuaProvider : MainAPI() { val link = it.attr("href") Episode(fixUrl(link), name) }.reversed() - val episodesFinal = episodes + specialEpisodes + val episodesFinal = specialEpisodes val typeinfo = doc.select("div.row div.col-md-6.pl-15 p.fc-dark").text() val tvType = if (typeinfo.contains(Regex("Tipo.*Pel.cula"))) TvType.AnimeMovie else TvType.Anime return newAnimeLoadResponse(title, url, tvType) { From e55c6e2febd45ab774557ed6f9aa29fa7677279a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 16:54:56 -0300 Subject: [PATCH 09/30] Update MundoDonghuaProvider.kt --- .../kotlin/com/lagradost/MundoDonghuaProvider.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 55d0fc6..376e09c 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -93,6 +93,7 @@ class MundoDonghuaProvider : MainAPI() { override suspend fun load(url: String): LoadResponse { val doc = app.get(url, timeout = 120).document + Val docSpecial = app.get("https://www.mundodonghua.com", timeout = 120).document val poster = doc.selectFirst("head meta[property=og:image]")?.attr("content") ?: "" val title = doc.selectFirst(".ls-title-serie")?.text() ?: "" val description = doc.selectFirst("p.text-justify.fc-dark")?.text() ?: "" @@ -102,15 +103,11 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - var counter = 0 - val specialEpisodes = app.get("https://www.mundodonghua.com", timeout = 120).document.select("div.row .col-xs-4").map { - counter = counter + 1 - 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) - } + val specialEpisodes = docSpecial.select("div.row .col-xs-4").map { + val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" + val link = it.selectFirst("a")?.attr("href") ?: "" + if (name.contains(title, true) { + Episode(fixUrl(link), name) } }.reversed() val episodes = doc.select("ul.donghua-list a").map { From 665ab514aa64070678ce6fbebaf7a2e191beeaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 17:00:29 -0300 Subject: [PATCH 10/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 376e09c..3ff7a2e 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -93,7 +93,7 @@ class MundoDonghuaProvider : MainAPI() { override suspend fun load(url: String): LoadResponse { val doc = app.get(url, timeout = 120).document - Val docSpecial = app.get("https://www.mundodonghua.com", timeout = 120).document + val docSpecial = app.get("https://www.mundodonghua.com", timeout = 120).document val poster = doc.selectFirst("head meta[property=og:image]")?.attr("content") ?: "" val title = doc.selectFirst(".ls-title-serie")?.text() ?: "" val description = doc.selectFirst("p.text-justify.fc-dark")?.text() ?: "" From 220d62d1dcba8530021485ef50a70c6f32fa8d41 Mon Sep 17 00:00:00 2001 From: contusionglory <102427829+contusionglory@users.noreply.github.com> Date: Mon, 12 Dec 2022 23:03:16 +0000 Subject: [PATCH 11/30] Refactored IlGenioDelloStreaming Provider and fixed it (#65) --- .../build.gradle.kts | 9 +- .../IlGenioDelloStreamingProvider.kt | 339 ++++++++++-------- 2 files changed, 202 insertions(+), 146 deletions(-) diff --git a/IlGenioDelloStreamingProvider/build.gradle.kts b/IlGenioDelloStreamingProvider/build.gradle.kts index 45514eb..fde0550 100644 --- a/IlGenioDelloStreamingProvider/build.gradle.kts +++ b/IlGenioDelloStreamingProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 4 +version = 5 cloudstream { @@ -7,7 +7,7 @@ cloudstream { // All of these properties are optional, you can safely remove them // description = "Lorem Ipsum" - authors = listOf("Adippe") + authors = listOf("Adippe","Forthe") /** * Status int as the following: @@ -16,12 +16,11 @@ cloudstream { * 2: Slow * 3: Beta only * */ - status = 0 // will be 3 if unspecified + status = 1 // will be 3 if unspecified tvTypes = listOf( - "TvSeries}", "TvSeries", "Movie", ) - iconUrl = "https://www.google.com/s2/favicons?domain=ilgeniodellostreaming.quest&sz=%size%" + iconUrl = "https://www.google.com/s2/favicons?domain=ilgeniodellostreaming.hair&sz=%size%" } \ No newline at end of file diff --git a/IlGenioDelloStreamingProvider/src/main/kotlin/com/lagradost/IlGenioDelloStreamingProvider.kt b/IlGenioDelloStreamingProvider/src/main/kotlin/com/lagradost/IlGenioDelloStreamingProvider.kt index 71d89e8..728db9f 100644 --- a/IlGenioDelloStreamingProvider/src/main/kotlin/com/lagradost/IlGenioDelloStreamingProvider.kt +++ b/IlGenioDelloStreamingProvider/src/main/kotlin/com/lagradost/IlGenioDelloStreamingProvider.kt @@ -2,191 +2,248 @@ package com.lagradost import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addRating +import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer +import com.lagradost.cloudstream3.MainAPI +import com.lagradost.cloudstream3.SearchResponse +import com.lagradost.cloudstream3.TvType import com.lagradost.cloudstream3.network.CloudflareKiller +import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.AppUtils.toJson -import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.ExtractorLink -import com.lagradost.cloudstream3.utils.ShortLink +import com.lagradost.cloudstream3.utils.ShortLink.unshorten import com.lagradost.cloudstream3.utils.loadExtractor - - +import org.jsoup.nodes.Element class IlGenioDelloStreamingProvider : MainAPI() { override var lang = "it" - override var mainUrl = "https://ilgeniodellostreaming.quest" + override var mainUrl = "https://ilgeniodellostreaming.hair" override var name = "IlGenioDelloStreaming" override val hasMainPage = true override val hasChromecastSupport = true override var sequentialMainPage = true - override val supportedTypes = setOf( - TvType.Movie, - TvType.TvSeries, - ) - override val mainPage = mainPageOf( - Pair("$mainUrl/category/film/page/", "Film Popolari"), - Pair("$mainUrl/category/serie-tv/page/", "Serie Tv Popolari"), - Pair("$mainUrl/the-most-voted/page/", "I più votati"), - Pair("$mainUrl/prime-visioni/page/", "Ultime uscite"), - ) + override val supportedTypes = + setOf( + TvType.Movie, + TvType.TvSeries, + ) + override val mainPage = + mainPageOf( + Pair("$mainUrl/popular-movies/page/", "Film Popolari"), + Pair("$mainUrl/the-most-voted/page/", "I più votati"), + ) private val interceptor = CloudflareKiller() - override suspend fun getMainPage( - page: Int, - request: MainPageRequest - ): HomePageResponse { + + private fun fixTitle(element: Element?): String { + return element?.text() + ?.trim() + ?.substringBefore("Streaming") + ?.replace("[HD]", "") + ?.replace("\\(\\d{4}\\)".toRegex(), "") + ?: "No Title found" + } + + override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse { val url = request.data + page - val soup = app.get(url, interceptor = interceptor).document - val home = soup.select("div.items > article.item").map { - val title = it.selectFirst("div.data > h3 > a")!!.text().substringBeforeLast("(").substringBeforeLast("[") - val link = it.selectFirst("div.poster > a")!!.attr("href") - val quality = getQualityFromString(it.selectFirst("span.quality")?.text()) - TvSeriesSearchResponse( - title, - link, - this.name, - TvType.Movie, - it.selectFirst("img")!!.attr("src"), - null, - null, - quality = quality - ) + + val soup = app.get(url, referer = mainUrl).document + val home = soup.select("div.items > article.item").mapNotNull { it.toMainPageResult() } + val hasNext = home.isNotEmpty() + return newHomePageResponse(arrayListOf(HomePageList(request.name, home)), hasNext = hasNext) + } + + private fun Element.toMainPageResult(): SearchResponse { + val title = + fixTitle(this.selectFirst("div.data>h3")) + val isMovie = + (this.selectFirst("div.data>h3")?.text() ?: "").contains("\\(\\d{4}\\)".toRegex()) + val link = + this.selectFirst("div.poster>a")?.attr("href") + ?: throw ErrorLoadingException("No Link found") + + val quality = this.selectFirst("div.poster>span.quality")?.text() + val posterUrl = this.selectFirst("div.poster>a>img")?.attr("src") + + return if (isMovie) { + newMovieSearchResponse(title, link, TvType.Movie) { + addPoster(posterUrl) + quality?.let { addQuality(it) } + } + } else { + newTvSeriesSearchResponse(title, link, TvType.TvSeries) { + addPoster(posterUrl) + quality?.let { addQuality(it) } + } } - return newHomePageResponse(request.name, home) } override suspend fun search(query: String): List { - val queryformatted = query.replace(" ", "+") - val url = "$mainUrl?s=$queryformatted" - val doc = app.get(url, interceptor = interceptor, referer = mainUrl).document - return doc.select("div.result-item").map { - val href = it.selectFirst("div.image > div > a")!!.attr("href") - val poster = it.selectFirst("div.image > div > a > img")!!.attr("src") - val name = it.selectFirst("div.details > div.title > a")!!.text().substringBeforeLast("(").substringBeforeLast("[") - MovieSearchResponse( - name, - href, - this.name, - TvType.Movie, - poster - ) + val queryFormatted = query.replace(" ", "+") + val url = "$mainUrl/?s=$queryFormatted" + val doc = app.get(url, referer = mainUrl, interceptor = interceptor).document + return doc.select("div.search-page>div.result-item").map { it.toSearchResult() } + } + private fun Element.toSearchResult(): SearchResponse { + val title = + fixTitle(this.selectFirst("div.title>a")) + val isMovie = + (this.selectFirst("div.title>a")?.text() ?: "").contains("\\(\\d{4}\\)".toRegex()) + val link = + this.selectFirst("div.title>a")?.attr("href") + ?: throw ErrorLoadingException("No Link found") + + val quality = + this.selectFirst("div.title>a")?.text()?.substringAfter("[")?.substringBefore("]") + val posterUrl = this.selectFirst("a>img")?.attr("src") + + return if (isMovie) { + newMovieSearchResponse(title, link, TvType.Movie) { + addPoster(posterUrl) + if (quality != null) { + addQuality(quality) + } + } + } else { + newTvSeriesSearchResponse(title, link, TvType.TvSeries) { + addPoster(posterUrl) + if (quality != null) { + addQuality(quality) + } + } } } override suspend fun load(url: String): LoadResponse { - val page = app.get(url, interceptor = interceptor) - val document = page.document - val type = if (document.select("div.seasons-wraper").isNotEmpty()){TvType.TvSeries} else{TvType.Movie} - val title = document.selectFirst("div.data > h1")!!.text().substringBefore("(").substringBefore("[") - val description = document.selectFirst("div#info")?.selectFirst("p")?.html() - val rating = document.select("span.valor").last()?.text()?.split(" ")?.get(0) - var year = document.selectFirst(" div.data > div.extra > span.date")!!.text().substringAfter(",") - .filter { it.isDigit() } - if (year.length > 4) { - year = year.dropLast(4) - } - - val poster = document.selectFirst("div.poster > img")!!.attr("src") - - val recomm = document.select("article.w_item_b").map { - val href = it.selectFirst("a")!!.attr("href") - val posterUrl = it.selectFirst("img")!!.attr("src") - val name = it.selectFirst("div.data > h3")!!.text().substringBeforeLast("(").substringBeforeLast("[") - MovieSearchResponse( - name, - href, - this.name, - TvType.Movie, - posterUrl - ) - - } - + val document = app.get(url, referer = mainUrl).document + val type = + if (document.select("div.seasons-wraper").isNotEmpty()) TvType.TvSeries + else TvType.Movie + val title = + fixTitle(document.selectFirst("div.data > h1")) + val description = + document.selectFirst("div#info") + ?.text() + ?.substringAfter(".") + ?.substringBefore("Leggi anche") + val year = + document.selectFirst("b.variante>strong>a") + ?.text() + ?.substringBefore("-") + ?.substringAfter(",") + ?.filter { it.isDigit() } + val poster = document.selectFirst("div.poster>img")?.attr("src") + val rating = document.selectFirst("span.valor>strong")?.text()?.toRatingInt() + val trailer = + document.selectFirst("img.youtube__img") + ?.attr("src") + ?.substringAfter("vi/") + ?.substringBefore("/") + ?.let { "https://www.youtube.com/watch?v=$it" } + val recomm = document.select("article.w_item_b").map { it.toRecommendResult() } if (type == TvType.TvSeries) { - - val episodeList = ArrayList() - document.selectFirst("div.seasons-wraper") - ?.select("div.accordion-item ")?.groupBy {it.selectFirst("span.season-title")!!.text() }?.map { seasons -> - seasons.value.map {season -> season.select("div.episode-wrap")}.flatten() - .groupBy { it.selectFirst("li.season-no")?.text()?.substringBeforeLast(" ") } - .map { episodeItaSub -> - val episodes = episodeItaSub.value - val posterUrl = episodes.firstNotNullOf { it.selectFirst("img")?.attr("src")} - val epName = episodes.firstNotNullOf{it.selectFirst("li.other_link")?.text()?:""} - - episodes.map{ episode -> - val seasonNo = episode.selectFirst("li.season-no") - val subtag = seasonNo?.text()?.takeIf {it.contains("Sub")}?.substringAfter(" ") ?: "" - val urls = episode.getElementsByAttributeValue("target", "_blank").map { it.attr("href").trim() } - .filter { it.isNotEmpty()}.toJson() - episodeList.add(Episode( - data = urls, - posterUrl = posterUrl, - season = seasons.key.toIntOrNull(), - name = "$epName ${subtag.uppercase()}", - episode = seasonNo?.text()?.substringAfter("x")?.filter { it.isDigit() }?.toIntOrNull() - - )) - } + val episodeList = + document.select("div.accordion>div.accordion-item") + .map { element -> + val season = + element.selectFirst("li.s_title>span.season-title") + ?.text() + ?.toIntOrNull() + ?: 0 + element.select("div.episode-wrap").map { episode -> + episode.toEpisode(season) } - } + } + .flatten() - - val seasonnames = document.selectFirst("div#info")?.select("p")?.map {it.children() } - ?.filter { it.size<3 && it.isNotEmpty()}?.map{it.text()} - - return newTvSeriesLoadResponse( - title, - url, - type, - episodeList - ){ - addRating(rating) + return newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodeList) { + this.year = year?.toIntOrNull() this.plot = description - this.year = year.toIntOrNull() - this.posterUrl = poster this.recommendations = recomm - this.seasonNames = seasonnames!!.mapIndexed { index, s -> SeasonData(index, s) } - + addPoster(poster) + addRating(rating) + addTrailer(trailer) } - - } else { val actors: List = - document.select("div.cast_wraper > ul > li").map { actorData -> - val actorName = actorData.children()[1].text() - val actorImage : String? = actorData.selectFirst("img")?.attr("data-src") - val roleActor = actorData.children()[2].text() - ActorData(actor = Actor(actorName, image = actorImage), roleString = roleActor ) + document.select("div.cast_wraper>ul>li").map { actordata -> + val actorName = actordata.selectFirst("strong")?.text() ?: "" + val actorImage: String = + actordata.selectFirst("figure>img")?.attr("src") ?: "" + ActorData(actor = Actor(actorName, image = actorImage)) } - return newMovieLoadResponse( - title, - url, - type, - (document.select("div.embed-player") + document.select("a.link_a")).map { (it.attr("href") + it.attr("data-id")).trim() }.distinct().toJson(), - ) { - posterUrl = fixUrlNull(poster) - this.year = year.toIntOrNull() + val data = document.select(".embed-player").map { it.attr("data-id") }.toJson() + return newMovieLoadResponse(title, data, TvType.Movie, data) { + this.year = year?.toIntOrNull() this.plot = description - addRating(rating) - this.recommendations = recomm - this.duration = null this.actors = actors + this.recommendations = recomm + addPoster(poster) + addRating(rating) + addTrailer(trailer) } } } + private fun Element.toRecommendResult(): SearchResponse { + val title = + fixTitle(this.selectFirst("div.data>h3")) + val isMovie = + (this.selectFirst("div.data>h3")?.text() ?: "").contains("\\(\\d{4}\\)".toRegex()) + val link = + this.selectFirst("a")?.attr("href") ?: throw ErrorLoadingException("No Link found") + + val quality = + this.selectFirst("div.data>h3")?.text()?.substringAfter("[")?.substringBefore("]") + val posterUrl = this.selectFirst("div.image>img")?.attr("src") + + return if (isMovie) { + newMovieSearchResponse(title, link, TvType.Movie) { + addPoster(posterUrl) + if (quality != null) { + addQuality(quality) + } + } + } else { + newTvSeriesSearchResponse(title, link, TvType.TvSeries) { + addPoster(posterUrl) + if (quality != null) { + addQuality(quality) + } + } + } + } + + private fun Element.toEpisode(season: Int): Episode { + val data = + this.select("div.fix-table>table>tbody>tr>td>a[target=_blank]") // buckler.link + .map { it.attr("href") } + .toJson() + val epNum = + this.selectFirst("li.season-no") + ?.text() + ?.substringAfter("x") + ?.substringBefore(" ") + ?.filter { it.isDigit() } + .orEmpty().ifBlank { "0" } + + val epTitle = + this.selectFirst("li.other_link>a")?.text().orEmpty().ifBlank { + "Episodio $epNum" + } + val posterUrl = this.selectFirst("img")?.attr("src") + return Episode(data, epTitle, season, epNum?.toInt(), posterUrl = posterUrl) + } + override suspend fun loadLinks( data: String, isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ): Boolean { - val links = tryParseJson>(data) - links?.map { link -> - val url = ShortLink.unshorten(link).replace("/v/", "/e/").replace("/f/", "/e/") - loadExtractor(url, data, subtitleCallback, callback) + parseJson>(data).map { videoUrl -> + loadExtractor(unshorten(videoUrl), data, subtitleCallback, callback) } return true } -} \ No newline at end of file +} From c9c86085e65b83e56849a5a244be9253dbf17c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 22:50:02 -0300 Subject: [PATCH 12/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 3ff7a2e..9abb66f 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -106,7 +106,7 @@ class MundoDonghuaProvider : MainAPI() { val specialEpisodes = docSpecial.select("div.row .col-xs-4").map { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" - if (name.contains(title, true) { + if (name.contains(title, true)) { Episode(fixUrl(link), name) } }.reversed() From 38ac4af7cb04ac84ea7a7fd1d1ff690a2c6cdf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 22:58:01 -0300 Subject: [PATCH 13/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 9abb66f..f9aebc8 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,11 +103,13 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.select("div.row .col-xs-4").map { + val specialEpisodes = docSpecial.select(".col-xs-4").map { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { Episode(fixUrl(link), name) + } else { + Episode(fixUrl(link), "Testing") } }.reversed() val episodes = doc.select("ul.donghua-list a").map { From cee31ebccec49c70450b74bbba2cd14e73f0c2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:10:58 -0300 Subject: [PATCH 14/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index f9aebc8..474e820 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,13 +103,11 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.select(".col-xs-4").map { + val specialEpisodes = docSpecial.select(".col-xs-4").mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { Episode(fixUrl(link), name) - } else { - Episode(fixUrl(link), "Testing") } }.reversed() val episodes = doc.select("ul.donghua-list a").map { From b365758e5c5ad2224382206050b49366afde5db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:16:23 -0300 Subject: [PATCH 15/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 474e820..9c7148c 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -108,6 +108,8 @@ class MundoDonghuaProvider : MainAPI() { val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { Episode(fixUrl(link), name) + } else { + return null } }.reversed() val episodes = doc.select("ul.donghua-list a").map { From e2fabddc936d76e450d97f18294e5200f8163103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:21:42 -0300 Subject: [PATCH 16/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 9c7148c..6e4e819 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -109,7 +109,7 @@ class MundoDonghuaProvider : MainAPI() { if (name.contains(title, true)) { Episode(fixUrl(link), name) } else { - return null + null } }.reversed() val episodes = doc.select("ul.donghua-list a").map { From fd0c5f4b429c7ca9e9f40fda24a50c8a49536c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:29:25 -0300 Subject: [PATCH 17/30] Update MundoDonghuaProvider.kt --- .../kotlin/com/lagradost/MundoDonghuaProvider.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 6e4e819..a0d0635 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,11 +103,17 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } + var counter = 0 val specialEpisodes = docSpecial.select(".col-xs-4").mapNotNull { - val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" - val link = it.selectFirst("a")?.attr("href") ?: "" - if (name.contains(title, true)) { - Episode(fixUrl(link), name) + counter++ + if (counter < 7) { + val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" + val link = it.selectFirst("a")?.attr("href") ?: "" + if (name.contains(title, true)) { + Episode(fixUrl(link), name) + } else { + null + } } else { null } From 6f15c8aa147cfda774e7cea3f0ed5df50aedd501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:33:25 -0300 Subject: [PATCH 18/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index a0d0635..8a639c9 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -104,7 +104,7 @@ class MundoDonghuaProvider : MainAPI() { else -> null } var counter = 0 - val specialEpisodes = docSpecial.select(".col-xs-4").mapNotNull { + val specialEpisodes = docSpecial.select("div.row .col-xs-4").mapNotNull { counter++ if (counter < 7) { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" @@ -123,7 +123,7 @@ class MundoDonghuaProvider : MainAPI() { val link = it.attr("href") Episode(fixUrl(link), name) }.reversed() - val episodesFinal = specialEpisodes + val episodesFinal = episodes + specialEpisodes val typeinfo = doc.select("div.row div.col-md-6.pl-15 p.fc-dark").text() val tvType = if (typeinfo.contains(Regex("Tipo.*Pel.cula"))) TvType.AnimeMovie else TvType.Anime return newAnimeLoadResponse(title, url, tvType) { From 3575073ee2c53e869ccf63c26eb7a4524f431e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:39:29 -0300 Subject: [PATCH 19/30] Update MundoDonghuaProvider.kt --- .../com/lagradost/MundoDonghuaProvider.kt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 8a639c9..e34e9e6 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -92,7 +92,7 @@ class MundoDonghuaProvider : MainAPI() { } override suspend fun load(url: String): LoadResponse { - val doc = app.get(url, timeout = 120).document + val doc = app.get(url, timeout = 120).document.selectFirst("div.row") val docSpecial = app.get("https://www.mundodonghua.com", timeout = 120).document val poster = doc.selectFirst("head meta[property=og:image]")?.attr("content") ?: "" val title = doc.selectFirst(".ls-title-serie")?.text() ?: "" @@ -103,17 +103,11 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - var counter = 0 - val specialEpisodes = docSpecial.select("div.row .col-xs-4").mapNotNull { - counter++ - if (counter < 7) { - val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" - val link = it.selectFirst("a")?.attr("href") ?: "" - if (name.contains(title, true)) { - Episode(fixUrl(link), name) - } else { - null - } + val specialEpisodes = docSpecial.select(".col-xs-4").mapNotNull { + val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" + val link = it.selectFirst("a")?.attr("href") ?: "" + if (name.contains(title, true)) { + Episode(fixUrl(link), name) } else { null } From 14b5bdb26d4232a71fdec001ef25fc35346e7ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:44:54 -0300 Subject: [PATCH 20/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index e34e9e6..7641834 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -92,7 +92,7 @@ class MundoDonghuaProvider : MainAPI() { } override suspend fun load(url: String): LoadResponse { - val doc = app.get(url, timeout = 120).document.selectFirst("div.row") + val doc = app.get(url, timeout = 120).document val docSpecial = app.get("https://www.mundodonghua.com", timeout = 120).document val poster = doc.selectFirst("head meta[property=og:image]")?.attr("content") ?: "" val title = doc.selectFirst(".ls-title-serie")?.text() ?: "" @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.select(".col-xs-4").mapNotNull { + val specialEpisodes = docSpecial.selectFirst("div.row")?.select(".col-xs-4").mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { @@ -111,7 +111,7 @@ class MundoDonghuaProvider : MainAPI() { } else { null } - }.reversed() + }?.reversed() ?: emptyMap() val episodes = doc.select("ul.donghua-list a").map { val name = it.selectFirst(".fs-16")?.text() val link = it.attr("href") From 721759582d62c5770cb934668ed1308fde7cfb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:49:55 -0300 Subject: [PATCH 21/30] Final commit with all fixed --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 7641834..2fb0641 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.selectFirst("div.row")?.select(".col-xs-4").mapNotNull { + val specialEpisodes = docSpecial.selectFirst("div.row")?.select(".col-xs-4")?.mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { From b17f625b920b7cd39f4f51b76995aaf5b6c79808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:58:33 -0300 Subject: [PATCH 22/30] Final commit with syntax errors fixed --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 2fb0641..e8b5c20 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -111,7 +111,7 @@ class MundoDonghuaProvider : MainAPI() { } else { null } - }?.reversed() ?: emptyMap() + }?.reversed() ?: emptyMap() val episodes = doc.select("ul.donghua-list a").map { val name = it.selectFirst(".fs-16")?.text() val link = it.attr("href") From b3bc1196d0e739a1f6bebb8433899fd5034aa999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:15:53 -0300 Subject: [PATCH 23/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index e8b5c20..294fa79 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -111,7 +111,7 @@ class MundoDonghuaProvider : MainAPI() { } else { null } - }?.reversed() ?: emptyMap() + }?.reversed() ?: null val episodes = doc.select("ul.donghua-list a").map { val name = it.selectFirst(".fs-16")?.text() val link = it.attr("href") From 854acaac717d9d31723735fa017b4c46bc79bffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:21:00 -0300 Subject: [PATCH 24/30] Final commit with fully tested code --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 294fa79..4b1269b 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -111,7 +111,7 @@ class MundoDonghuaProvider : MainAPI() { } else { null } - }?.reversed() ?: null + }?.reversed() val episodes = doc.select("ul.donghua-list a").map { val name = it.selectFirst(".fs-16")?.text() val link = it.attr("href") From f854c21b892dcf640f0eadf351487d36143d61a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:28:45 -0300 Subject: [PATCH 25/30] Addition of special chapters to the chapters list --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 4b1269b..7fd1c53 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.selectFirst("div.row")?.select(".col-xs-4")?.mapNotNull { + val specialEpisodes = docSpecial.selectFirst(".sm-row.bg-white.pt-10.pr-20.pb-15.pl-20")?.select(".col-xs-4")?.mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { From 1b8e8df8cb88ef8e68144b42210c877a6fa33ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:31:51 -0300 Subject: [PATCH 26/30] Selection issues fixed --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 7fd1c53..01a25e6 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.selectFirst(".sm-row.bg-white.pt-10.pr-20.pb-15.pl-20")?.select(".col-xs-4")?.mapNotNull { + val specialEpisodes = docSpecial.selectFirst("div.sm-row.bg-white.pt-10.pr-20.pb-15.pl-20")?.select(".col-xs-4")?.mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { From a436f9dca877113a608d0a3460a09c62091a3a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:41:12 -0300 Subject: [PATCH 27/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 01a25e6..2397430 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.selectFirst("div.sm-row.bg-white.pt-10.pr-20.pb-15.pl-20")?.select(".col-xs-4")?.mapNotNull { + val specialEpisodes = docSpecial.selectFirst("div.sm-row.bg-white div.row")?.select(".col-xs-4")?.mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { From eb2999a58387be890615302ed5d5f26537a68d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:44:33 -0300 Subject: [PATCH 28/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 2397430..c3bd11e 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.selectFirst("div.sm-row.bg-white div.row")?.select(".col-xs-4")?.mapNotNull { + val specialEpisodes = docSpecial.selectFirst("div.sm-row.bg-white.pt-10.pr-20.pb-15.pl-20 div.row")?.select(".col-xs-4")?.mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { From 0bb79c657e1b5460a33827fddb3d09f0445133bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 00:51:43 -0300 Subject: [PATCH 29/30] Update MundoDonghuaProvider.kt --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index c3bd11e..2eb3e06 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,7 +103,7 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } - val specialEpisodes = docSpecial.selectFirst("div.sm-row.bg-white.pt-10.pr-20.pb-15.pl-20 div.row")?.select(".col-xs-4")?.mapNotNull { + val specialEpisodes = docSpecial.select("div.sm-row.bg-white.pt-10.pr-20.pb-15.pl-20 div.item.col-lg-2.col-md-2.col-xs-4").mapNotNull { val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" val link = it.selectFirst("a")?.attr("href") ?: "" if (name.contains(title, true)) { @@ -111,7 +111,7 @@ class MundoDonghuaProvider : MainAPI() { } else { null } - }?.reversed() + }.reversed() val episodes = doc.select("ul.donghua-list a").map { val name = it.selectFirst(".fs-16")?.text() val link = it.attr("href") From 57aa94dd12a2e4a03f1f50b56418264e3b1c7676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Tue, 13 Dec 2022 09:53:42 -0300 Subject: [PATCH 30/30] Improvements --- .../src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 2eb3e06..afe3d3b 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -93,7 +93,7 @@ class MundoDonghuaProvider : MainAPI() { override suspend fun load(url: String): LoadResponse { val doc = app.get(url, timeout = 120).document - val docSpecial = app.get("https://www.mundodonghua.com", timeout = 120).document + val docSpecial = app.get(mainUrl, timeout = 120).document val poster = doc.selectFirst("head meta[property=og:image]")?.attr("content") ?: "" val title = doc.selectFirst(".ls-title-serie")?.text() ?: "" val description = doc.selectFirst("p.text-justify.fc-dark")?.text() ?: "" @@ -122,7 +122,7 @@ class MundoDonghuaProvider : MainAPI() { val tvType = if (typeinfo.contains(Regex("Tipo.*Pel.cula"))) TvType.AnimeMovie else TvType.Anime return newAnimeLoadResponse(title, url, tvType) { posterUrl = poster - addEpisodes(DubStatus.Subbed, episodesFinal.filterNotNull().filterIsInstance()) + addEpisodes(DubStatus.Subbed, episodesFinal) showStatus = status plot = description tags = genres