mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Ported over all movie providers (some disabled)
This commit is contained in:
parent
c0509c5db9
commit
5c5a8d142f
283 changed files with 17532 additions and 76 deletions
22
HDMovie5/build.gradle.kts
Normal file
22
HDMovie5/build.gradle.kts
Normal file
|
@ -0,0 +1,22 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
|
||||
|
||||
cloudstream {
|
||||
// All of these properties are optional, you can safely remove them
|
||||
|
||||
// description = "Lorem Ipsum"
|
||||
// authors = listOf("Cloudburst")
|
||||
|
||||
/**
|
||||
* Status int as the following:
|
||||
* 0: Down
|
||||
* 1: Ok
|
||||
* 2: Slow
|
||||
* 3: Beta only
|
||||
* */
|
||||
status = 1 // will be 3 if unspecified
|
||||
|
||||
// Set to true to get an 18+ symbol next to the plugin
|
||||
adult = false // will be false if unspecified
|
||||
}
|
2
HDMovie5/src/main/AndroidManifest.xml
Normal file
2
HDMovie5/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
154
HDMovie5/src/main/kotlin/com/lagradost/HDMovie5.kt
Normal file
154
HDMovie5/src/main/kotlin/com/lagradost/HDMovie5.kt
Normal file
|
@ -0,0 +1,154 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.httpsify
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class HDMovie5 : MainAPI() {
|
||||
override var mainUrl = "https://hdmovie2.click"
|
||||
override var name = "HDMovie"
|
||||
override var lang = "hi"
|
||||
|
||||
override val hasQuickSearch = true
|
||||
override val hasMainPage = true
|
||||
override val supportedTypes = setOf(
|
||||
TvType.Movie,
|
||||
TvType.TvSeries,
|
||||
)
|
||||
|
||||
override val mainPage = mainPageOf(
|
||||
"$mainUrl/genre/tv-movie/page/" to "TV Movie",
|
||||
"$mainUrl/genre/tv-show/page/" to "TV- Show",
|
||||
"$mainUrl/genre/hindi-dubbed/page/" to "Hindi Dubbed",
|
||||
"$mainUrl/genre/netflix/page/" to "NETFLIX",
|
||||
)
|
||||
|
||||
override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
|
||||
val home = app.get(request.data + page).document.select("article.item").mapNotNull {
|
||||
it.toSearchResult()
|
||||
}
|
||||
return newHomePageResponse(request.name, home)
|
||||
}
|
||||
|
||||
private fun Element.toSearchResult(): SearchResponse? {
|
||||
val title = this.selectFirst("h3 > a")?.text()?.trim() ?: return null
|
||||
val href = fixUrl(this.selectFirst("a")!!.attr("href"))
|
||||
val posterUrl = this.selectFirst("img")?.attr("src")
|
||||
return newMovieSearchResponse(title, href, TvType.Movie) {
|
||||
addPoster(posterUrl)
|
||||
}
|
||||
}
|
||||
|
||||
private data class QuickSearchResponse(
|
||||
val title: String,
|
||||
val url: String,
|
||||
val img: String,
|
||||
val extra: Extra
|
||||
) {
|
||||
data class Extra(
|
||||
val date: String
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun quickSearch(query: String): List<SearchResponse> {
|
||||
return app.get("$mainUrl/wp-json/dooplay/search/?keyword=$query&nonce=ddbde04d9c")
|
||||
.parsed<Map<String, QuickSearchResponse>>().map {
|
||||
val res = it.value
|
||||
MovieSearchResponse(
|
||||
res.title,
|
||||
res.url,
|
||||
this.name,
|
||||
TvType.Movie,
|
||||
res.img,
|
||||
res.extra.date.toIntOrNull()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
return app.get("$mainUrl/?s=$query").document.select(".search-page>div.result-item").map {
|
||||
val image = it.select(".image")
|
||||
MovieSearchResponse(
|
||||
image.select("img").attr("alt"),
|
||||
image.select("a").attr("href"),
|
||||
this.name,
|
||||
TvType.Movie,
|
||||
image.select("img").attr("src"),
|
||||
it.select(".year").text().toIntOrNull()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
val doc = app.get(url).document
|
||||
val info = doc.select(".sheader")
|
||||
val links = doc.select("#playeroptionsul>li")
|
||||
val data = links.joinToString(",") { it.attr("data-post") }
|
||||
return MovieLoadResponse(
|
||||
info.select(".data>h1").text(),
|
||||
url,
|
||||
this.name,
|
||||
TvType.Movie,
|
||||
data,
|
||||
info.select(".poster>img").attr("src"),
|
||||
info.select(".date").text().substringAfter(", ").toIntOrNull(),
|
||||
doc.select(".wp-content>p").let { it.getOrNull(it.size - 1)?.text() },
|
||||
(doc.select("#repimdb>strong").text().toFloatOrNull()?.times(1000))?.toInt(),
|
||||
info.select(".sgeneros>a").map { it.text() },
|
||||
info.select(".runtime").text().substringBefore(" Min.").toIntOrNull(),
|
||||
mutableListOf(),
|
||||
doc.select("#single_relacionados>article>a").map {
|
||||
val img = it.select("img")
|
||||
MovieSearchResponse(
|
||||
img.attr("alt"),
|
||||
it.attr("href"),
|
||||
this.name,
|
||||
TvType.Movie,
|
||||
img.attr("src")
|
||||
)
|
||||
},
|
||||
doc.select("#cast>.persons>.person").mapNotNull {
|
||||
if (it.attr("itemprop") != "director") {
|
||||
ActorData(
|
||||
Actor(
|
||||
it.select("meta").attr("content"),
|
||||
it.select("img").attr("src")
|
||||
)
|
||||
)
|
||||
} else null
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
private data class PlayerAjaxResponse(
|
||||
@JsonProperty("embed_url")
|
||||
val embedURL: String? = null
|
||||
)
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
return data.split(",").apmapIndexed { index, it ->
|
||||
val p = app.post(
|
||||
"$mainUrl/wp-admin/admin-ajax.php",
|
||||
data = mapOf(
|
||||
"action" to "doo_player_ajax",
|
||||
"post" to it,
|
||||
"nume" to "${index + 1}",
|
||||
"type" to "movie"
|
||||
)
|
||||
)
|
||||
val html = p.parsedSafe<PlayerAjaxResponse>()?.embedURL ?: return@apmapIndexed false
|
||||
val doc = Jsoup.parse(html)
|
||||
val link = doc.select("iframe").attr("src")
|
||||
loadExtractor(httpsify(link), "$mainUrl/", subtitleCallback, callback)
|
||||
}.contains(true)
|
||||
}
|
||||
}
|
14
HDMovie5/src/main/kotlin/com/lagradost/HDMovie5Plugin.kt
Normal file
14
HDMovie5/src/main/kotlin/com/lagradost/HDMovie5Plugin.kt
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
|
||||
import com.lagradost.cloudstream3.plugins.Plugin
|
||||
import android.content.Context
|
||||
|
||||
@CloudstreamPlugin
|
||||
class HDMovie5Plugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(HDMovie5())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue