From ef851fea19fb383bf986f791a64bfbfbc13fb090 Mon Sep 17 00:00:00 2001 From: sora Date: Thu, 27 Jul 2023 23:09:25 +0700 Subject: [PATCH] added Hdmovie2 --- Aniworld/build.gradle.kts | 2 +- DramaidProvider/build.gradle.kts | 2 +- Gomov/build.gradle.kts | 2 +- Movierulzhd/build.gradle.kts | 4 +- .../src/main/kotlin/com/hexated/Extractors.kt | 28 ++++++ .../src/main/kotlin/com/hexated/Hdmovie2.kt | 88 +++++++++++++++++ .../main/kotlin/com/hexated/Movierulzhd.kt | 98 ++++++++++--------- .../kotlin/com/hexated/MovierulzhdPlugin.kt | 2 + RebahinProvider/build.gradle.kts | 2 +- Xcineio/build.gradle.kts | 2 +- YomoviesProvider/build.gradle.kts | 2 +- 11 files changed, 179 insertions(+), 53 deletions(-) create mode 100644 Movierulzhd/src/main/kotlin/com/hexated/Hdmovie2.kt diff --git a/Aniworld/build.gradle.kts b/Aniworld/build.gradle.kts index d303a028..36d39d31 100644 --- a/Aniworld/build.gradle.kts +++ b/Aniworld/build.gradle.kts @@ -6,7 +6,7 @@ cloudstream { language = "de" // All of these properties are optional, you can safely remove them - description = "Include: Serienstream" + description = "Included: Serienstream" authors = listOf("Hexated") /** diff --git a/DramaidProvider/build.gradle.kts b/DramaidProvider/build.gradle.kts index a1beeb4d..02f0a559 100644 --- a/DramaidProvider/build.gradle.kts +++ b/DramaidProvider/build.gradle.kts @@ -6,7 +6,7 @@ cloudstream { language = "id" // All of these properties are optional, you can safely remove them - description = "Include: Oppadrama" + description = "Included: Oppadrama" authors = listOf("Hexated") /** diff --git a/Gomov/build.gradle.kts b/Gomov/build.gradle.kts index a14f2a82..65c73ec0 100644 --- a/Gomov/build.gradle.kts +++ b/Gomov/build.gradle.kts @@ -6,7 +6,7 @@ cloudstream { language = "id" // All of these properties are optional, you can safely remove them - description = "Include: DutaMovie, Ngefilm, Nodrakorid" + description = "Included: DutaMovie, Ngefilm, Nodrakorid" authors = listOf("Hexated") /** diff --git a/Movierulzhd/build.gradle.kts b/Movierulzhd/build.gradle.kts index 1d596ef2..1da0d4c3 100644 --- a/Movierulzhd/build.gradle.kts +++ b/Movierulzhd/build.gradle.kts @@ -1,12 +1,12 @@ // use an integer for version numbers -version = 37 +version = 38 cloudstream { language = "hi" // All of these properties are optional, you can safely remove them -// description = "Movierulzhd recently have prank feature that the enable and disable cloudflare a " + description = "Included: Hdmovie2" authors = listOf("Hexated") /** diff --git a/Movierulzhd/src/main/kotlin/com/hexated/Extractors.kt b/Movierulzhd/src/main/kotlin/com/hexated/Extractors.kt index 87ae7b6d..a96e9c7b 100644 --- a/Movierulzhd/src/main/kotlin/com/hexated/Extractors.kt +++ b/Movierulzhd/src/main/kotlin/com/hexated/Extractors.kt @@ -112,6 +112,34 @@ open class Sbflix : ExtractorApi() { } +open class Akamaicdn : ExtractorApi() { + override val name = "Akamaicdn" + override val mainUrl = "https://akamaicdn.life" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val res = app.get(url, referer = referer).document + val mapper = res.select("script:containsData(sniff)").last()?.data()?.substringAfter("sniff(") + ?.substringBefore(");")?.split(",")?.map { it.replace("\"", "").trim() } ?: return + callback.invoke( + ExtractorLink( + this.name, + this.name, + "$mainUrl/m3u8/${mapper[1]}/${mapper[2]}/master.txt?s=1&cache=1", + url, + Qualities.Unknown.value, + isM3u8 = true, + ) + ) + } + +} + suspend fun invokeTwoEmbed( url: String? = null, subtitleCallback: (SubtitleFile) -> Unit, diff --git a/Movierulzhd/src/main/kotlin/com/hexated/Hdmovie2.kt b/Movierulzhd/src/main/kotlin/com/hexated/Hdmovie2.kt new file mode 100644 index 00000000..5fde2e77 --- /dev/null +++ b/Movierulzhd/src/main/kotlin/com/hexated/Hdmovie2.kt @@ -0,0 +1,88 @@ +package com.hexated + +import com.fasterxml.jackson.annotation.JsonProperty +import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.apmap +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.mainPageOf +import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.loadExtractor +import org.jsoup.Jsoup + +class Hdmovie2 : Movierulzhd() { + override var mainUrl = "https://hdmovie2.bar" + override var name = "Hdmovie2" + + override val mainPage = mainPageOf( + "trending" to "Trending", + "movies" to "Movies", + "genre/tv-series" to "TV-Series", + "genre/netflix" to "Netflix", + "genre/zee5-tv-series" to "Zee5 TV Series", + ) + + override suspend fun loadLinks( + data: String, + isCasting: Boolean, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ): Boolean { + if (data.startsWith("{")) { + val loadData = tryParseJson(data) + val source = app.get( + url = "$directUrl/wp-json/dooplayer/v2/${loadData?.post}/${loadData?.type}/${loadData?.nume}", + referer = data, + headers = mapOf("X-Requested-With" to "XMLHttpRequest") + ).parsed().embed_url.getIframe() + if (!source.contains("youtube")) loadExtractor( + source, + "$directUrl/", + subtitleCallback, + callback + ) + } else { + var document = app.get(data).document + if (document.select("title").text() == "Just a moment...") { + document = app.get(data, interceptor = interceptor).document + } + val id = document.select("meta#dooplay-ajax-counter").attr("data-postid") + val type = if (data.contains("/movies/")) "movie" else "tv" + + document.select("ul#playeroptionsul > li").map { + it.attr("data-nume") + }.apmap { nume -> + val source = app.get( + url = "$directUrl/wp-json/dooplayer/v2/${id}/${type}/${nume}", + referer = data, + headers = mapOf("X-Requested-With" to "XMLHttpRequest") + ).parsed().embed_url.getIframe() + when { + !source.contains("youtube") -> loadExtractor( + source, + "$directUrl/", + subtitleCallback, + callback + ) + else -> return@apmap + } + } + } + return true + } + + private fun String.getIframe(): String { + return Jsoup.parse(this).select("iframe").attr("src") + } + + data class LinkData( + val type: String? = null, + val post: String? = null, + val nume: String? = null, + ) + + data class ResponseHash( + @JsonProperty("embed_url") val embed_url: String, + @JsonProperty("type") val type: String?, + ) +} \ No newline at end of file diff --git a/Movierulzhd/src/main/kotlin/com/hexated/Movierulzhd.kt b/Movierulzhd/src/main/kotlin/com/hexated/Movierulzhd.kt index 263375b7..ba4452d9 100644 --- a/Movierulzhd/src/main/kotlin/com/hexated/Movierulzhd.kt +++ b/Movierulzhd/src/main/kotlin/com/hexated/Movierulzhd.kt @@ -4,16 +4,15 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addActors import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer -import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.network.CloudflareKiller import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.AppUtils.toJson import org.jsoup.nodes.Element import java.net.URI -class Movierulzhd : MainAPI() { - override var mainUrl = "https://movierulzhd.help" - private var directUrl = mainUrl +open class Movierulzhd : MainAPI() { + override var mainUrl = "https://movierulzhd.gold" + var directUrl = "" override var name = "Movierulzhd" override val hasMainPage = true override var lang = "hi" @@ -24,24 +23,24 @@ class Movierulzhd : MainAPI() { ) override val mainPage = mainPageOf( - "$mainUrl/trending/page/" to "Trending", - "$mainUrl/movies/page/" to "Movies", - "$mainUrl/tvshows/page/" to "TV Shows", - "$mainUrl/genre/netflix/page/" to "Netflix", - "$mainUrl/genre/amazon-prime/page/" to "Amazon Prime", - "$mainUrl/genre/Zee5/page/" to "Zee5", - "$mainUrl/seasons/page/" to "Season", - "$mainUrl/episodes/page/" to "Episode", + "trending" to "Trending", + "movies" to "Movies", + "tvshows" to "TV Shows", + "genre/netflix" to "Netflix", + "genre/amazon-prime" to "Amazon Prime", + "genre/Zee5" to "Zee5", + "seasons" to "Season", + "episodes" to "Episode", ) - private val interceptor = CloudflareKiller() + val interceptor = CloudflareKiller() override suspend fun getMainPage( page: Int, request: MainPageRequest ): HomePageResponse { - var document = app.get(request.data + page).document - if(document.select("title").text() == "Just a moment...") { + var document = app.get("$mainUrl/${request.data}/page/$page").document + if (document.select("title").text() == "Just a moment...") { document = app.get(request.data + page, interceptor = interceptor).document } val home = @@ -58,11 +57,13 @@ class Movierulzhd : MainAPI() { title = Regex("(.+?)-season").find(title)?.groupValues?.get(1).toString() "$mainUrl/tvshows/$title" } + uri.contains("/seasons/") -> { var title = uri.substringAfter("$mainUrl/seasons/") title = Regex("(.+?)-season").find(title)?.groupValues?.get(1).toString() "$mainUrl/tvshows/$title" } + else -> { uri } @@ -72,7 +73,7 @@ class Movierulzhd : MainAPI() { private fun Element.toSearchResult(): SearchResponse? { val title = this.selectFirst("h3 > a")?.text() ?: return null val href = getProperLink(fixUrl(this.selectFirst("h3 > a")!!.attr("href"))) - val posterUrl = fixUrlNull(this.select("div.poster > img").attr("src")) + val posterUrl = fixUrlNull(this.select("div.poster img").last()?.attr("src")) val quality = getQualityFromString(this.select("span.quality").text()) return newMovieSearchResponse(title, href, TvType.Movie) { this.posterUrl = posterUrl @@ -85,7 +86,7 @@ class Movierulzhd : MainAPI() { override suspend fun search(query: String): List { val link = "$mainUrl/search/$query" var document = app.get(link).document - if(document.select("title").text() == "Just a moment...") { + if (document.select("title").text() == "Just a moment...") { document = app.get(link, interceptor = interceptor).document } @@ -104,13 +105,13 @@ class Movierulzhd : MainAPI() { override suspend fun load(url: String): LoadResponse { val request = app.get(url) var document = request.document - if(document.select("title").text() == "Just a moment...") { + if (document.select("title").text() == "Just a moment...") { document = app.get(url, interceptor = interceptor).document } directUrl = getBaseUrl(request.url) val title = document.selectFirst("div.data > h1")?.text()?.trim().toString() - val poster = document.select("div.poster > img").attr("src").toString() + val poster = fixUrlNull(document.select("div.poster img:last-child").attr("src")) val tags = document.select("div.sgeneros > a").map { it.text() } val year = Regex(",\\s?(\\d+)").find( @@ -119,7 +120,7 @@ class Movierulzhd : MainAPI() { val tvType = if (document.select("ul#section > li:nth-child(1)").text() .contains("Episodes") || document.selectFirst("ul#playeroptionsul li span.title") ?.text()?.contains( - Regex("Episode\\s\\d+") + Regex("Episode\\s+\\d+|EP\\d+|PE\\d+") ) == true ) TvType.TvSeries else TvType.Movie val description = document.select("div.wp-content > p").text().trim() @@ -127,7 +128,10 @@ class Movierulzhd : MainAPI() { val rating = document.selectFirst("span.dt_rating_vgs")?.text()?.toRatingInt() val actors = document.select("div.persons > div[itemprop=actor]").map { - Actor(it.select("meta[itemprop=name]").attr("content"), it.select("img").attr("src")) + Actor( + it.select("meta[itemprop=name]").attr("content"), + it.select("img:last-child").attr("src") + ) } val recommendations = document.select("div.owl-item").map { @@ -142,15 +146,17 @@ class Movierulzhd : MainAPI() { } return if (tvType == TvType.TvSeries) { - val episodes = if(document.select("ul.episodios > li").isNotEmpty()) { + val episodes = if (document.select("ul.episodios > li").isNotEmpty()) { document.select("ul.episodios > li").map { val href = it.select("a").attr("href") val name = fixTitle(it.select("div.episodiotitle > a").text().trim()) val image = it.select("div.imagen > img").attr("src") - val episode = it.select("div.numerando").text().replace(" ", "").split("-").last() - .toIntOrNull() - val season = it.select("div.numerando").text().replace(" ", "").split("-").first() - .toIntOrNull() + val episode = + it.select("div.numerando").text().replace(" ", "").split("-").last() + .toIntOrNull() + val season = + it.select("div.numerando").text().replace(" ", "").split("-").first() + .toIntOrNull() Episode( href, name, @@ -210,7 +216,7 @@ class Movierulzhd : MainAPI() { callback: (ExtractorLink) -> Unit ): Boolean { - if(data.startsWith("{")) { + if (data.startsWith("{")) { val loadData = AppUtils.tryParseJson(data) val source = app.post( url = "$directUrl/wp-admin/admin-ajax.php", @@ -223,7 +229,7 @@ class Movierulzhd : MainAPI() { referer = data, headers = mapOf("X-Requested-With" to "XMLHttpRequest") ).parsed().embed_url - if(!source.contains("youtube")) loadExtractor(source, data, subtitleCallback, callback) + if (!source.contains("youtube")) loadExtractor(source, data, subtitleCallback, callback) } else { var document = app.get(data).document if (document.select("title").text() == "Just a moment...") { @@ -235,24 +241,26 @@ class Movierulzhd : MainAPI() { document.select("ul#playeroptionsul > li").map { it.attr("data-nume") }.apmap { nume -> - safeApiCall { - val source = app.post( - url = "$directUrl/wp-admin/admin-ajax.php", - data = mapOf( - "action" to "doo_player_ajax", - "post" to id, - "nume" to nume, - "type" to type - ), - referer = data, - headers = mapOf("X-Requested-With" to "XMLHttpRequest") - ).parsed().embed_url + val source = app.post( + url = "$directUrl/wp-admin/admin-ajax.php", + data = mapOf( + "action" to "doo_player_ajax", + "post" to id, + "nume" to nume, + "type" to type + ), + referer = data, + headers = mapOf("X-Requested-With" to "XMLHttpRequest") + ).parsed().embed_url - when { - source.contains("2embed") -> invokeTwoEmbed(source,subtitleCallback, callback) - !source.contains("youtube") -> loadExtractor(source, data, subtitleCallback, callback) - else -> return@safeApiCall - } + when { + !source.contains("youtube") -> loadExtractor( + source, + data, + subtitleCallback, + callback + ) + else -> return@apmap } } } diff --git a/Movierulzhd/src/main/kotlin/com/hexated/MovierulzhdPlugin.kt b/Movierulzhd/src/main/kotlin/com/hexated/MovierulzhdPlugin.kt index 21710b9d..a97f4cc9 100644 --- a/Movierulzhd/src/main/kotlin/com/hexated/MovierulzhdPlugin.kt +++ b/Movierulzhd/src/main/kotlin/com/hexated/MovierulzhdPlugin.kt @@ -10,9 +10,11 @@ class MovierulzhdPlugin: Plugin() { override fun load(context: Context) { // All providers should be added in this manner. Please don't edit the providers list directly. registerMainAPI(Movierulzhd()) + registerMainAPI(Hdmovie2()) registerExtractorAPI(Sbflix()) registerExtractorAPI(Sbrulz()) registerExtractorAPI(Sbmiz()) registerExtractorAPI(Sbnmp()) + registerExtractorAPI(Akamaicdn()) } } \ No newline at end of file diff --git a/RebahinProvider/build.gradle.kts b/RebahinProvider/build.gradle.kts index 0c5b2fdf..b509bf93 100644 --- a/RebahinProvider/build.gradle.kts +++ b/RebahinProvider/build.gradle.kts @@ -6,7 +6,7 @@ cloudstream { language = "id" // All of these properties are optional, you can safely remove them - description = "Include: Cgvindo, Kitanonton" + description = "Included: Cgvindo, Kitanonton" authors = listOf("Hexated") /** diff --git a/Xcineio/build.gradle.kts b/Xcineio/build.gradle.kts index 2434acfa..56bc2180 100644 --- a/Xcineio/build.gradle.kts +++ b/Xcineio/build.gradle.kts @@ -6,7 +6,7 @@ cloudstream { language = "de" // All of these properties are optional, you can safely remove them - description = "Include: Movie4k" + description = "Included: Movie4k" authors = listOf("Hexated") /** diff --git a/YomoviesProvider/build.gradle.kts b/YomoviesProvider/build.gradle.kts index f5249c1c..ba22fc9a 100644 --- a/YomoviesProvider/build.gradle.kts +++ b/YomoviesProvider/build.gradle.kts @@ -6,7 +6,7 @@ cloudstream { language = "hi" // All of these properties are optional, you can safely remove them - description = "Include: Watchomovies" + description = "Included: Watchomovies" authors = listOf("Hexated") /**