mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
added Hdmovie2
This commit is contained in:
parent
d1c109cf20
commit
ef851fea19
11 changed files with 179 additions and 53 deletions
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
|
@ -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,
|
||||
|
|
88
Movierulzhd/src/main/kotlin/com/hexated/Hdmovie2.kt
Normal file
88
Movierulzhd/src/main/kotlin/com/hexated/Hdmovie2.kt
Normal 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?,
|
||||
)
|
||||
}
|
|
@ -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,23 +23,23 @@ 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
|
||||
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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -110,7 +111,7 @@ class Movierulzhd : MainAPI() {
|
|||
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 {
|
||||
|
@ -147,9 +151,11 @@ class Movierulzhd : MainAPI() {
|
|||
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()
|
||||
val episode =
|
||||
it.select("div.numerando").text().replace(" ", "").split("-").last()
|
||||
.toIntOrNull()
|
||||
val season = it.select("div.numerando").text().replace(" ", "").split("-").first()
|
||||
val season =
|
||||
it.select("div.numerando").text().replace(" ", "").split("-").first()
|
||||
.toIntOrNull()
|
||||
Episode(
|
||||
href,
|
||||
|
@ -235,7 +241,6 @@ 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(
|
||||
|
@ -249,10 +254,13 @@ class Movierulzhd : MainAPI() {
|
|||
).parsed<ResponseHash>().embed_url
|
||||
|
||||
when {
|
||||
source.contains("2embed") -> invokeTwoEmbed(source,subtitleCallback, callback)
|
||||
!source.contains("youtube") -> loadExtractor(source, data, subtitleCallback, callback)
|
||||
else -> return@safeApiCall
|
||||
}
|
||||
!source.contains("youtube") -> loadExtractor(
|
||||
source,
|
||||
data,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
else -> return@apmap
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
}
|
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
|
@ -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")
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue