From 864b266f9ef981260b9cdd85cd9ea348a7397486 Mon Sep 17 00:00:00 2001 From: sora Date: Thu, 20 Jul 2023 19:35:26 +0700 Subject: [PATCH] fixed Rebahin and moved Ngefilm --- Gomov/build.gradle.kts | 4 +- .../src/main/kotlin/com/hexated/DutaMovie.kt | 7 - Gomov/src/main/kotlin/com/hexated/Gomov.kt | 21 ++- .../main/kotlin/com/hexated/GomovPlugin.kt | 1 + Gomov/src/main/kotlin/com/hexated/Ngefilm.kt | 40 +++++ Ngefilm/build.gradle.kts | 27 --- Ngefilm/src/main/AndroidManifest.xml | 2 - .../src/main/kotlin/com/hexated/Ngefilm.kt | 164 ------------------ .../main/kotlin/com/hexated/NgefilmPlugin.kt | 14 -- .../kotlin/com/hexated/Phim1080Provider.kt | 8 +- RebahinProvider/build.gradle.kts | 4 +- .../src/main/kotlin/com/hexated/Cgvindo.kt | 9 + .../kotlin/com/hexated/RebahinProvider.kt | 3 +- .../com/hexated/RebahinProviderPlugin.kt | 6 +- 14 files changed, 76 insertions(+), 234 deletions(-) create mode 100644 Gomov/src/main/kotlin/com/hexated/Ngefilm.kt delete mode 100644 Ngefilm/build.gradle.kts delete mode 100644 Ngefilm/src/main/AndroidManifest.xml delete mode 100644 Ngefilm/src/main/kotlin/com/hexated/Ngefilm.kt delete mode 100644 Ngefilm/src/main/kotlin/com/hexated/NgefilmPlugin.kt create mode 100644 RebahinProvider/src/main/kotlin/com/hexated/Cgvindo.kt diff --git a/Gomov/build.gradle.kts b/Gomov/build.gradle.kts index 58ecbc21..7f2b8216 100644 --- a/Gomov/build.gradle.kts +++ b/Gomov/build.gradle.kts @@ -1,12 +1,12 @@ // use an integer for version numbers -version = 2 +version = 3 cloudstream { language = "id" // All of these properties are optional, you can safely remove them - description = "Include: DutaMovie" + description = "Include: DutaMovie, Ngefilm" authors = listOf("Hexated") /** diff --git a/Gomov/src/main/kotlin/com/hexated/DutaMovie.kt b/Gomov/src/main/kotlin/com/hexated/DutaMovie.kt index 01a903bb..7912713c 100644 --- a/Gomov/src/main/kotlin/com/hexated/DutaMovie.kt +++ b/Gomov/src/main/kotlin/com/hexated/DutaMovie.kt @@ -8,13 +8,6 @@ import com.lagradost.cloudstream3.utils.loadExtractor class DutaMovie : Gomov() { override var mainUrl = "https://dutamovie21.live" override var name = "DutaMovie" - override val hasMainPage = true - override var lang = "id" - override val supportedTypes = setOf( - TvType.Movie, - TvType.TvSeries, - TvType.AsianDrama - ) override val mainPage = mainPageOf( "category/box-office/page/%d/" to "Box Office", diff --git a/Gomov/src/main/kotlin/com/hexated/Gomov.kt b/Gomov/src/main/kotlin/com/hexated/Gomov.kt index 2c2b1d36..36128fb2 100644 --- a/Gomov/src/main/kotlin/com/hexated/Gomov.kt +++ b/Gomov/src/main/kotlin/com/hexated/Gomov.kt @@ -43,8 +43,8 @@ open class Gomov : MainAPI() { private fun Element.toSearchResult(): SearchResponse? { val title = this.selectFirst("h2.entry-title > a")?.text()?.trim() ?: return null val href = fixUrl(this.selectFirst("a")!!.attr("href")) - val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src")) - val quality = this.select("div.gmr-qual").text().trim() + val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src"))?.fixImageQuality() + val quality = this.select("div.gmr-qual, div.gmr-quality-item > a").text().trim().replace("-", "") return if (quality.isEmpty()) { val episode = this.select("div.gmr-numbeps > span").text().toIntOrNull() newAnimeSearchResponse(title, href, TvType.TvSeries) { @@ -59,10 +59,10 @@ open class Gomov : MainAPI() { } } - private fun Element.toBottomSearchResult(): SearchResponse? { + private fun Element.toRecommendResult(): SearchResponse? { val title = this.selectFirst("a > span.idmuvi-rp-title")?.text()?.trim() ?: return null val href = this.selectFirst("a")!!.attr("href") - val posterUrl = fixUrl(this.selectFirst("a > img")?.attr("data-src").toString()) + val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src").fixImageQuality()) return newMovieSearchResponse(title, href, TvType.Movie) { this.posterUrl = posterUrl } @@ -82,7 +82,7 @@ open class Gomov : MainAPI() { document.selectFirst("h1.entry-title")?.text()?.substringBefore("Season")?.trim() .toString() val poster = - fixUrl(document.selectFirst("figure.pull-left > img")?.attr("src").toString()) + fixUrlNull(document.selectFirst("figure.pull-left > img")?.attr("src"))?.fixImageQuality() val tags = document.select("span.gmr-movie-genre:contains(Genre:) > a").map { it.text() } val year = @@ -97,7 +97,7 @@ open class Gomov : MainAPI() { ?.map { it.select("a").text() } val recommendations = document.select("div.idmuvi-rp ul li").mapNotNull { - it.toBottomSearchResult() + it.toRecommendResult() } return if (tvType == TvType.TvSeries) { @@ -109,7 +109,7 @@ open class Gomov : MainAPI() { Episode( href, name, - season = season, + season = if(name.contains(" ")) season else null, episode = episode, ) }.filter { it.episode != null } @@ -160,4 +160,11 @@ open class Gomov : MainAPI() { } + private fun String?.fixImageQuality(): String? { + if(this == null) return null + val regex = Regex("(-\\d*x\\d*)").find(this)?.groupValues + if(regex?.isEmpty() == true) return this + return this.replace(regex?.get(0) ?: return null, "") + } + } \ No newline at end of file diff --git a/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt b/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt index 99c3213d..b3043cb7 100644 --- a/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt +++ b/Gomov/src/main/kotlin/com/hexated/GomovPlugin.kt @@ -11,6 +11,7 @@ class GomovPlugin: Plugin() { // All providers should be added in this manner. Please don't edit the providers list directly. registerMainAPI(Gomov()) registerMainAPI(DutaMovie()) + registerMainAPI(Ngefilm()) registerExtractorAPI(Filelions()) registerExtractorAPI(Likessb()) registerExtractorAPI(DbGdriveplayer()) diff --git a/Gomov/src/main/kotlin/com/hexated/Ngefilm.kt b/Gomov/src/main/kotlin/com/hexated/Ngefilm.kt new file mode 100644 index 00000000..7c4be51f --- /dev/null +++ b/Gomov/src/main/kotlin/com/hexated/Ngefilm.kt @@ -0,0 +1,40 @@ +package com.hexated + +import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.apmap +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.fixUrl +import com.lagradost.cloudstream3.mainPageOf +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.loadExtractor + +class Ngefilm : Gomov() { + override var mainUrl = "https://ngefilm21.lol" + override var name = "Ngefilm" + + override val mainPage = mainPageOf( + "/page/%d/?s&search=advanced&post_type=movie&index&orderby&genre&movieyear&country&quality=" to "Movies Terbaru", + "/page/%d/?s=&search=advanced&post_type=tv&index=&orderby=&genre=&movieyear=&country=&quality=" to "Series Terbaru", + "/page/%d/?s=&search=advanced&post_type=tv&index=&orderby=&genre=drakor&movieyear=&country=&quality=" to "Series Korea", + "/page/%d/?s=&search=advanced&post_type=tv&index=&orderby=&genre=&movieyear=&country=indonesia&quality=" to "Series Indonesia", + ) + + override suspend fun loadLinks( + data: String, + isCasting: Boolean, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ): Boolean { + + val document = app.get(data).document + document.select("ul.muvipro-player-tabs li a").apmap { server -> + val iframe = app.get(fixUrl(server.attr("href"))).document.selectFirst("div.gmr-embed-responsive iframe") + ?.attr("src")?.let { fixUrl(it) } ?: return@apmap + loadExtractor(iframe, "$mainUrl/", subtitleCallback, callback) + } + + return true + + } + +} \ No newline at end of file diff --git a/Ngefilm/build.gradle.kts b/Ngefilm/build.gradle.kts deleted file mode 100644 index 0903f827..00000000 --- a/Ngefilm/build.gradle.kts +++ /dev/null @@ -1,27 +0,0 @@ -// use an integer for version numbers -version = 4 - - -cloudstream { - language = "id" - // All of these properties are optional, you can safely remove them - - // description = "Lorem Ipsum" - authors = listOf("Hexated") - - /** - * Status int as the following: - * 0: Down - * 1: Ok - * 2: Slow - * 3: Beta only - * */ - status = 1 // will be 3 if unspecified - tvTypes = listOf( - "AsianDrama", - "TvSeries", - "Movie", - ) - - iconUrl = "https://www.google.com/s2/favicons?domain=ngefilm21.club&sz=%size%" -} \ No newline at end of file diff --git a/Ngefilm/src/main/AndroidManifest.xml b/Ngefilm/src/main/AndroidManifest.xml deleted file mode 100644 index c98063f8..00000000 --- a/Ngefilm/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/Ngefilm/src/main/kotlin/com/hexated/Ngefilm.kt b/Ngefilm/src/main/kotlin/com/hexated/Ngefilm.kt deleted file mode 100644 index 84a14d7d..00000000 --- a/Ngefilm/src/main/kotlin/com/hexated/Ngefilm.kt +++ /dev/null @@ -1,164 +0,0 @@ -package com.hexated - -import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.LoadResponse.Companion.addActors -import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer -import com.lagradost.cloudstream3.utils.ExtractorLink -import com.lagradost.cloudstream3.utils.loadExtractor -import org.jsoup.nodes.Element - -class Ngefilm : MainAPI() { - override var mainUrl = "https://ngefilm21.cfd" - override var name = "Ngefilm" - override val hasMainPage = true - override var lang = "id" - override val hasDownloadSupport = true - override val supportedTypes = setOf( - TvType.Movie, - TvType.TvSeries, - TvType.AsianDrama - ) - - override val mainPage = mainPageOf( - "?s&search=advanced&post_type=movie&index&orderby&genre&movieyear&country&quality=" to "Movies Terbaru", - "?s=&search=advanced&post_type=tv&index=&orderby=&genre=&movieyear=&country=&quality=" to "Series Terbaru", - "?s=&search=advanced&post_type=tv&index=&orderby=&genre=drakor&movieyear=&country=&quality=" to "Series Korea", - "?s=&search=advanced&post_type=tv&index=&orderby=&genre=&movieyear=&country=indonesia&quality=" to "Series Indonesia", - ) - - override suspend fun getMainPage( - page: Int, - request: MainPageRequest - ): HomePageResponse { - val document = app.get("$mainUrl/page/$page/${request.data}").document - val home = document.select("main#main article").mapNotNull { - it.toSearchResult() - } - return newHomePageResponse(request.name, home) - } - - override suspend fun search(query: String): List { - val link = "$mainUrl/?s=$query&post_type[]=post&post_type[]=tv" - val document = app.get(link).document - return document.select("main#main article").mapNotNull { - it.toSearchResult() - } - } - - override suspend fun load(url: String): LoadResponse { - val document = app.get(url).document - - val title = - document.selectFirst("h1.entry-title")?.text()?.substringBefore("Season")?.trim() ?: "" - val poster = fixUrlNull( - document.selectFirst("figure.pull-left > img")?.attr("src")?.fixImageQuality() - ) - val tags = document.select("span.gmr-movie-genre:contains(Genre:) > a").map { it.text() } - - val year = - document.select("span.gmr-movie-genre:contains(Year:) > a").text().trim().toIntOrNull() - val tvType = if (url.contains("/tv/")) TvType.TvSeries else TvType.Movie - val description = document.selectFirst("div[itemprop=description] > p")?.text()?.trim() - val trailer = document.selectFirst("ul.gmr-player-nav li a.gmr-trailer-popup")?.attr("href") - val rating = - document.selectFirst("div.gmr-meta-rating > span[itemprop=ratingValue]")?.text() - ?.toRatingInt() - val actors = document.select("div.gmr-moviedata").last()?.select("span[itemprop=actors]") - ?.map { it.select("a").text() } - - val recommendations = document.select("div.idmuvi-rp ul li").mapNotNull { - it.toRecommendResult() - } - - return if (tvType == TvType.TvSeries) { - val episodes = document.select("div.gmr-listseries > a") - .filter { element -> !element.text().contains("Pilih Episode", true) } - .map { eps -> - val href = fixUrl(eps.attr("href")) - val episode = eps.text().substringAfter("Eps").toIntOrNull() - val season = - eps.text().split(" ").first().substringAfter("S").toIntOrNull() ?: 1 - Episode( - href, - season = season, - episode = episode, - ) - } - newTvSeriesLoadResponse(title, url, TvType.TvSeries, episodes) { - this.posterUrl = poster - this.year = year - this.plot = description - this.tags = tags - this.rating = rating - addActors(actors) - this.recommendations = recommendations - addTrailer(trailer) - } - } else { - newMovieLoadResponse(title, url, TvType.Movie, url) { - this.posterUrl = poster - this.year = year - this.plot = description - this.tags = tags - this.rating = rating - addActors(actors) - this.recommendations = recommendations - addTrailer(trailer) - } - } - } - - override suspend fun loadLinks( - data: String, - isCasting: Boolean, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ): Boolean { - - val document = app.get(data).document - - document.select("ul.muvipro-player-tabs li a").apmap { server -> - val iframe = app.get(fixUrl(server.attr("href"))).document.selectFirst("div.gmr-embed-responsive iframe") - ?.attr("src")?.let { fixUrl(it) } ?: return@apmap - loadExtractor(iframe, "$mainUrl/", subtitleCallback, callback) - } - - return true - - } - - private fun Element.toSearchResult(): SearchResponse? { - val title = this.selectFirst("h2.entry-title > a")?.text()?.trim() ?: return null - val href = fixUrl(this.selectFirst("a")?.attr("href") ?: return null) - val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src").fixImageQuality()) - val quality = this.select("div.gmr-quality-item > a").text().trim() - return if (quality.isEmpty()) { - val episode = - this.select("div.gmr-numbeps > span").text().filter { it.isDigit() }.toIntOrNull() - newAnimeSearchResponse(title, href, TvType.TvSeries) { - this.posterUrl = posterUrl - addSub(episode) - } - } else { - newMovieSearchResponse(title, href, TvType.Movie) { - this.posterUrl = posterUrl - addQuality(quality.replace("-", "")) - } - } - } - - private fun Element.toRecommendResult(): SearchResponse? { - val title = this.selectFirst("a > span.idmuvi-rp-title")?.text()?.trim() ?: return null - val href = this.selectFirst("a")!!.attr("href") - val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src").fixImageQuality()) - return newMovieSearchResponse(title, href, TvType.Movie) { - this.posterUrl = posterUrl - } - } - - private fun String?.fixImageQuality(): String? { - val quality = Regex("(-\\d*x\\d*)").find(this ?: return null)?.groupValues?.get(0) - return this.replace(quality ?: return null, "") - } - -} \ No newline at end of file diff --git a/Ngefilm/src/main/kotlin/com/hexated/NgefilmPlugin.kt b/Ngefilm/src/main/kotlin/com/hexated/NgefilmPlugin.kt deleted file mode 100644 index 8fc845f8..00000000 --- a/Ngefilm/src/main/kotlin/com/hexated/NgefilmPlugin.kt +++ /dev/null @@ -1,14 +0,0 @@ - -package com.hexated - -import com.lagradost.cloudstream3.plugins.CloudstreamPlugin -import com.lagradost.cloudstream3.plugins.Plugin -import android.content.Context - -@CloudstreamPlugin -class NgefilmPlugin: Plugin() { - override fun load(context: Context) { - // All providers should be added in this manner. Please don't edit the providers list directly. - registerMainAPI(Ngefilm()) - } -} \ No newline at end of file diff --git a/Phim1080/src/main/kotlin/com/hexated/Phim1080Provider.kt b/Phim1080/src/main/kotlin/com/hexated/Phim1080Provider.kt index d4d35368..edadf591 100644 --- a/Phim1080/src/main/kotlin/com/hexated/Phim1080Provider.kt +++ b/Phim1080/src/main/kotlin/com/hexated/Phim1080Provider.kt @@ -22,8 +22,8 @@ class Phim1080Provider : MainAPI() { private fun encodeString(e: String, t: Int): String { var a = "" - for (i in 0 until e.length) { - val r = e[i].code + for (element in e) { + val r = element.code val o = r xor t a += o.toChar() } @@ -109,7 +109,7 @@ class Phim1080Provider : MainAPI() { "Content-Type" to "application/json", "X-Requested-With" to "XMLHttpRequest" ) - ).parsedSafe() + ).parsedSafe() val title = filmInfo?.name?.trim().toString() val poster = filmInfo?.thumbnail val background = filmInfo?.poster @@ -209,7 +209,7 @@ class Phim1080Provider : MainAPI() { return true } - data class filmInfo( + data class FilmInfo( @JsonProperty("name") val name: String? = null, @JsonProperty("poster") val poster: String? = null, @JsonProperty("thumbnail") val thumbnail: String? = null, diff --git a/RebahinProvider/build.gradle.kts b/RebahinProvider/build.gradle.kts index 32b9dd7e..0c5b2fdf 100644 --- a/RebahinProvider/build.gradle.kts +++ b/RebahinProvider/build.gradle.kts @@ -1,12 +1,12 @@ // use an integer for version numbers -version = 6 +version = 7 cloudstream { language = "id" // All of these properties are optional, you can safely remove them - // description = "Lorem Ipsum" + description = "Include: Cgvindo, Kitanonton" authors = listOf("Hexated") /** diff --git a/RebahinProvider/src/main/kotlin/com/hexated/Cgvindo.kt b/RebahinProvider/src/main/kotlin/com/hexated/Cgvindo.kt new file mode 100644 index 00000000..328f0a06 --- /dev/null +++ b/RebahinProvider/src/main/kotlin/com/hexated/Cgvindo.kt @@ -0,0 +1,9 @@ +package com.hexated + +import com.lagradost.cloudstream3.TvType + +class Cgvindo : RebahinProvider() { + override var mainUrl = "http://cgvindo.click" + override var name = "Cgvindo" + +} \ No newline at end of file diff --git a/RebahinProvider/src/main/kotlin/com/hexated/RebahinProvider.kt b/RebahinProvider/src/main/kotlin/com/hexated/RebahinProvider.kt index e8e5ad1e..fcb63f6e 100644 --- a/RebahinProvider/src/main/kotlin/com/hexated/RebahinProvider.kt +++ b/RebahinProvider/src/main/kotlin/com/hexated/RebahinProvider.kt @@ -13,11 +13,10 @@ import org.jsoup.nodes.Element import java.net.URI open class RebahinProvider : MainAPI() { - override var mainUrl = "http://104.237.198.198" + override var mainUrl = "http://179.43.163.50" override var name = "Rebahin" override val hasMainPage = true override var lang = "id" - override val hasDownloadSupport = true open var mainServer = "http://172.96.161.72" override val supportedTypes = setOf( TvType.Movie, diff --git a/RebahinProvider/src/main/kotlin/com/hexated/RebahinProviderPlugin.kt b/RebahinProvider/src/main/kotlin/com/hexated/RebahinProviderPlugin.kt index ab58bb2d..e051cc41 100644 --- a/RebahinProvider/src/main/kotlin/com/hexated/RebahinProviderPlugin.kt +++ b/RebahinProvider/src/main/kotlin/com/hexated/RebahinProviderPlugin.kt @@ -1,4 +1,3 @@ - package com.hexated import com.lagradost.cloudstream3.plugins.CloudstreamPlugin @@ -6,10 +5,11 @@ import com.lagradost.cloudstream3.plugins.Plugin import android.content.Context @CloudstreamPlugin -class RebahinProviderPlugin: Plugin() { +class RebahinProviderPlugin : Plugin() { override fun load(context: Context) { // All providers should be added in this manner. Please don't edit the providers list directly. registerMainAPI(RebahinProvider()) -registerMainAPI(Kitanonton()) + registerMainAPI(Kitanonton()) + registerMainAPI(Cgvindo()) } } \ No newline at end of file