added Hdmovie2

This commit is contained in:
sora 2023-07-27 23:09:25 +07:00
parent d1c109cf20
commit ef851fea19
11 changed files with 179 additions and 53 deletions

View file

@ -6,7 +6,7 @@ cloudstream {
language = "de" language = "de"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "Include: Serienstream" description = "Included: Serienstream"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**

View file

@ -6,7 +6,7 @@ cloudstream {
language = "id" language = "id"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "Include: Oppadrama" description = "Included: Oppadrama"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**

View file

@ -6,7 +6,7 @@ cloudstream {
language = "id" language = "id"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "Include: DutaMovie, Ngefilm, Nodrakorid" description = "Included: DutaMovie, Ngefilm, Nodrakorid"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**

View file

@ -1,12 +1,12 @@
// use an integer for version numbers // use an integer for version numbers
version = 37 version = 38
cloudstream { cloudstream {
language = "hi" language = "hi"
// All of these properties are optional, you can safely remove them // 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") authors = listOf("Hexated")
/** /**

View file

@ -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( suspend fun invokeTwoEmbed(
url: String? = null, url: String? = null,
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,

View file

@ -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<LinkData>(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<ResponseHash>().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<ResponseHash>().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?,
)
}

View file

@ -4,16 +4,15 @@ import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.mvvm.safeApiCall
import com.lagradost.cloudstream3.network.CloudflareKiller import com.lagradost.cloudstream3.network.CloudflareKiller
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.utils.AppUtils.toJson import com.lagradost.cloudstream3.utils.AppUtils.toJson
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.net.URI import java.net.URI
class Movierulzhd : MainAPI() { open class Movierulzhd : MainAPI() {
override var mainUrl = "https://movierulzhd.help" override var mainUrl = "https://movierulzhd.gold"
private var directUrl = mainUrl var directUrl = ""
override var name = "Movierulzhd" override var name = "Movierulzhd"
override val hasMainPage = true override val hasMainPage = true
override var lang = "hi" override var lang = "hi"
@ -24,24 +23,24 @@ class Movierulzhd : MainAPI() {
) )
override val mainPage = mainPageOf( override val mainPage = mainPageOf(
"$mainUrl/trending/page/" to "Trending", "trending" to "Trending",
"$mainUrl/movies/page/" to "Movies", "movies" to "Movies",
"$mainUrl/tvshows/page/" to "TV Shows", "tvshows" to "TV Shows",
"$mainUrl/genre/netflix/page/" to "Netflix", "genre/netflix" to "Netflix",
"$mainUrl/genre/amazon-prime/page/" to "Amazon Prime", "genre/amazon-prime" to "Amazon Prime",
"$mainUrl/genre/Zee5/page/" to "Zee5", "genre/Zee5" to "Zee5",
"$mainUrl/seasons/page/" to "Season", "seasons" to "Season",
"$mainUrl/episodes/page/" to "Episode", "episodes" to "Episode",
) )
private val interceptor = CloudflareKiller() val interceptor = CloudflareKiller()
override suspend fun getMainPage( override suspend fun getMainPage(
page: Int, page: Int,
request: MainPageRequest request: MainPageRequest
): HomePageResponse { ): HomePageResponse {
var document = app.get(request.data + page).document var document = app.get("$mainUrl/${request.data}/page/$page").document
if(document.select("title").text() == "Just a moment...") { if (document.select("title").text() == "Just a moment...") {
document = app.get(request.data + page, interceptor = interceptor).document document = app.get(request.data + page, interceptor = interceptor).document
} }
val home = val home =
@ -58,11 +57,13 @@ class Movierulzhd : MainAPI() {
title = Regex("(.+?)-season").find(title)?.groupValues?.get(1).toString() title = Regex("(.+?)-season").find(title)?.groupValues?.get(1).toString()
"$mainUrl/tvshows/$title" "$mainUrl/tvshows/$title"
} }
uri.contains("/seasons/") -> { uri.contains("/seasons/") -> {
var title = uri.substringAfter("$mainUrl/seasons/") var title = uri.substringAfter("$mainUrl/seasons/")
title = Regex("(.+?)-season").find(title)?.groupValues?.get(1).toString() title = Regex("(.+?)-season").find(title)?.groupValues?.get(1).toString()
"$mainUrl/tvshows/$title" "$mainUrl/tvshows/$title"
} }
else -> { else -> {
uri uri
} }
@ -72,7 +73,7 @@ class Movierulzhd : MainAPI() {
private fun Element.toSearchResult(): SearchResponse? { private fun Element.toSearchResult(): SearchResponse? {
val title = this.selectFirst("h3 > a")?.text() ?: return null val title = this.selectFirst("h3 > a")?.text() ?: return null
val href = getProperLink(fixUrl(this.selectFirst("h3 > a")!!.attr("href"))) 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()) val quality = getQualityFromString(this.select("span.quality").text())
return newMovieSearchResponse(title, href, TvType.Movie) { return newMovieSearchResponse(title, href, TvType.Movie) {
this.posterUrl = posterUrl this.posterUrl = posterUrl
@ -85,7 +86,7 @@ class Movierulzhd : MainAPI() {
override suspend fun search(query: String): List<SearchResponse> { override suspend fun search(query: String): List<SearchResponse> {
val link = "$mainUrl/search/$query" val link = "$mainUrl/search/$query"
var document = app.get(link).document 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 document = app.get(link, interceptor = interceptor).document
} }
@ -104,13 +105,13 @@ class Movierulzhd : MainAPI() {
override suspend fun load(url: String): LoadResponse { override suspend fun load(url: String): LoadResponse {
val request = app.get(url) val request = app.get(url)
var document = request.document 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 document = app.get(url, interceptor = interceptor).document
} }
directUrl = getBaseUrl(request.url) directUrl = getBaseUrl(request.url)
val title = val title =
document.selectFirst("div.data > h1")?.text()?.trim().toString() 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 tags = document.select("div.sgeneros > a").map { it.text() }
val year = Regex(",\\s?(\\d+)").find( 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() val tvType = if (document.select("ul#section > li:nth-child(1)").text()
.contains("Episodes") || document.selectFirst("ul#playeroptionsul li span.title") .contains("Episodes") || document.selectFirst("ul#playeroptionsul li span.title")
?.text()?.contains( ?.text()?.contains(
Regex("Episode\\s\\d+") Regex("Episode\\s+\\d+|EP\\d+|PE\\d+")
) == true ) == true
) TvType.TvSeries else TvType.Movie ) TvType.TvSeries else TvType.Movie
val description = document.select("div.wp-content > p").text().trim() val description = document.select("div.wp-content > p").text().trim()
@ -127,7 +128,10 @@ class Movierulzhd : MainAPI() {
val rating = val rating =
document.selectFirst("span.dt_rating_vgs")?.text()?.toRatingInt() document.selectFirst("span.dt_rating_vgs")?.text()?.toRatingInt()
val actors = document.select("div.persons > div[itemprop=actor]").map { 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 { val recommendations = document.select("div.owl-item").map {
@ -142,15 +146,17 @@ class Movierulzhd : MainAPI() {
} }
return if (tvType == TvType.TvSeries) { 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 { document.select("ul.episodios > li").map {
val href = it.select("a").attr("href") val href = it.select("a").attr("href")
val name = fixTitle(it.select("div.episodiotitle > a").text().trim()) val name = fixTitle(it.select("div.episodiotitle > a").text().trim())
val image = it.select("div.imagen > img").attr("src") val image = it.select("div.imagen > img").attr("src")
val episode = it.select("div.numerando").text().replace(" ", "").split("-").last() val episode =
.toIntOrNull() it.select("div.numerando").text().replace(" ", "").split("-").last()
val season = it.select("div.numerando").text().replace(" ", "").split("-").first() .toIntOrNull()
.toIntOrNull() val season =
it.select("div.numerando").text().replace(" ", "").split("-").first()
.toIntOrNull()
Episode( Episode(
href, href,
name, name,
@ -210,7 +216,7 @@ class Movierulzhd : MainAPI() {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
): Boolean { ): Boolean {
if(data.startsWith("{")) { if (data.startsWith("{")) {
val loadData = AppUtils.tryParseJson<LinkData>(data) val loadData = AppUtils.tryParseJson<LinkData>(data)
val source = app.post( val source = app.post(
url = "$directUrl/wp-admin/admin-ajax.php", url = "$directUrl/wp-admin/admin-ajax.php",
@ -223,7 +229,7 @@ class Movierulzhd : MainAPI() {
referer = data, referer = data,
headers = mapOf("X-Requested-With" to "XMLHttpRequest") headers = mapOf("X-Requested-With" to "XMLHttpRequest")
).parsed<ResponseHash>().embed_url ).parsed<ResponseHash>().embed_url
if(!source.contains("youtube")) loadExtractor(source, data, subtitleCallback, callback) if (!source.contains("youtube")) loadExtractor(source, data, subtitleCallback, callback)
} else { } else {
var document = app.get(data).document var document = app.get(data).document
if (document.select("title").text() == "Just a moment...") { if (document.select("title").text() == "Just a moment...") {
@ -235,24 +241,26 @@ class Movierulzhd : MainAPI() {
document.select("ul#playeroptionsul > li").map { document.select("ul#playeroptionsul > li").map {
it.attr("data-nume") it.attr("data-nume")
}.apmap { nume -> }.apmap { nume ->
safeApiCall { val source = app.post(
val source = app.post( url = "$directUrl/wp-admin/admin-ajax.php",
url = "$directUrl/wp-admin/admin-ajax.php", data = mapOf(
data = mapOf( "action" to "doo_player_ajax",
"action" to "doo_player_ajax", "post" to id,
"post" to id, "nume" to nume,
"nume" to nume, "type" to type
"type" to type ),
), referer = data,
referer = data, headers = mapOf("X-Requested-With" to "XMLHttpRequest")
headers = mapOf("X-Requested-With" to "XMLHttpRequest") ).parsed<ResponseHash>().embed_url
).parsed<ResponseHash>().embed_url
when { when {
source.contains("2embed") -> invokeTwoEmbed(source,subtitleCallback, callback) !source.contains("youtube") -> loadExtractor(
!source.contains("youtube") -> loadExtractor(source, data, subtitleCallback, callback) source,
else -> return@safeApiCall data,
} subtitleCallback,
callback
)
else -> return@apmap
} }
} }
} }

View file

@ -10,9 +10,11 @@ class MovierulzhdPlugin: Plugin() {
override fun load(context: Context) { override fun load(context: Context) {
// All providers should be added in this manner. Please don't edit the providers list directly. // All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(Movierulzhd()) registerMainAPI(Movierulzhd())
registerMainAPI(Hdmovie2())
registerExtractorAPI(Sbflix()) registerExtractorAPI(Sbflix())
registerExtractorAPI(Sbrulz()) registerExtractorAPI(Sbrulz())
registerExtractorAPI(Sbmiz()) registerExtractorAPI(Sbmiz())
registerExtractorAPI(Sbnmp()) registerExtractorAPI(Sbnmp())
registerExtractorAPI(Akamaicdn())
} }
} }

View file

@ -6,7 +6,7 @@ cloudstream {
language = "id" language = "id"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "Include: Cgvindo, Kitanonton" description = "Included: Cgvindo, Kitanonton"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**

View file

@ -6,7 +6,7 @@ cloudstream {
language = "de" language = "de"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "Include: Movie4k" description = "Included: Movie4k"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**

View file

@ -6,7 +6,7 @@ cloudstream {
language = "hi" language = "hi"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "Include: Watchomovies" description = "Included: Watchomovies"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**