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
VfFilmProvider/build.gradle.kts
Normal file
22
VfFilmProvider/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
VfFilmProvider/src/main/AndroidManifest.xml
Normal file
2
VfFilmProvider/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.lagradost"/>
|
122
VfFilmProvider/src/main/kotlin/com/lagradost/VfFilmProvider.kt
Normal file
122
VfFilmProvider/src/main/kotlin/com/lagradost/VfFilmProvider.kt
Normal file
|
@ -0,0 +1,122 @@
|
|||
package com.lagradost
|
||||
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
// referer = https://vf-film.org, USERAGENT ALSO REQUIRED
|
||||
class VfFilmProvider : MainAPI() {
|
||||
override var mainUrl = "https://vf-film.me"
|
||||
override var name = "vf-film.me"
|
||||
override var lang = "fr"
|
||||
override val hasQuickSearch = false
|
||||
override val hasMainPage = false
|
||||
override val hasChromecastSupport = false
|
||||
|
||||
override val supportedTypes = setOf(TvType.Movie)
|
||||
|
||||
override suspend fun search(query: String): List<SearchResponse> {
|
||||
val url = "$mainUrl/?s=$query"
|
||||
val response = app.get(url).text
|
||||
val document = Jsoup.parse(response)
|
||||
val items = document.select("ul.MovieList > li > article > a")
|
||||
if (items.isNullOrEmpty()) return ArrayList()
|
||||
|
||||
val returnValue = ArrayList<SearchResponse>()
|
||||
for (item in items) {
|
||||
val href = item.attr("href")
|
||||
|
||||
val poster = item.selectFirst("> div.Image > figure > img")!!.attr("src")
|
||||
.replace("//image", "https://image")
|
||||
|
||||
val name = item.selectFirst("> h3.Title")!!.text()
|
||||
|
||||
val year = item.selectFirst("> span.Year")!!.text().toIntOrNull()
|
||||
|
||||
returnValue.add(MovieSearchResponse(name, href, this.name, TvType.Movie, poster, year))
|
||||
}
|
||||
return returnValue
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
): Boolean {
|
||||
if (data.length <= 4) return false
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
this.name,
|
||||
this.name,
|
||||
data,
|
||||
"",
|
||||
Qualities.P720.value,
|
||||
false
|
||||
)
|
||||
)
|
||||
return true
|
||||
}
|
||||
|
||||
private suspend fun getDirect(original: String): String { // original data, https://vf-film.org/?trembed=1&trid=55313&trtype=1 for example
|
||||
val response = app.get(original).text
|
||||
val url = "iframe .*src=\"(.*?)\"".toRegex().find(response)?.groupValues?.get(1)
|
||||
.toString() // https://vudeo.net/embed-uweno86lzx8f.html for example
|
||||
val vudoResponse = app.get(url).text
|
||||
val document = Jsoup.parse(vudoResponse)
|
||||
val vudoUrl = Regex("sources: \\[\"(.*?)\"]").find(document.html())?.groupValues?.get(1)
|
||||
.toString() // direct mp4 link, https://m11.vudeo.net/2vp3ukyw2avjdohilpebtzuct42q5jwvpmpsez3xjs6d7fbs65dpuey2rbra/v.mp4 for exemple
|
||||
return vudoUrl
|
||||
}
|
||||
|
||||
override suspend fun load(url: String): LoadResponse {
|
||||
val response = app.get(url).text
|
||||
val document = Jsoup.parse(response)
|
||||
val title = document.selectFirst("div.SubTitle")?.text()
|
||||
?: throw ErrorLoadingException("Service might be unavailable")
|
||||
|
||||
val year = document.select("span.Date").text().toIntOrNull()
|
||||
|
||||
// val rating = document.select("span.AAIco-star").text()
|
||||
|
||||
val duration = document.select("span.Time").text().toIntOrNull()
|
||||
|
||||
val poster = document.selectFirst("div.Image > figure > img")!!.attr("src")
|
||||
.replace("//image", "https://image")
|
||||
|
||||
val descript = document.selectFirst("div.Description > p")!!.text()
|
||||
|
||||
val players = document.select("ul.TPlayerNv > li")
|
||||
var number_player = 0
|
||||
var found = false
|
||||
for (player in players) {
|
||||
if (player.selectFirst("> span")!!.text() == "Vudeo") {
|
||||
found = true
|
||||
break
|
||||
} else {
|
||||
number_player += 1
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
number_player = 0
|
||||
}
|
||||
val i = number_player.toString()
|
||||
val trid = Regex("iframe .*trid=(.*?)&").find(document.html())?.groupValues?.get(1)
|
||||
|
||||
val data = getDirect("$mainUrl/?trembed=$i&trid=$trid&trtype=1")
|
||||
|
||||
return newMovieLoadResponse(
|
||||
title,
|
||||
url,
|
||||
TvType.Movie,
|
||||
data
|
||||
) {
|
||||
this.posterUrl = poster
|
||||
this.year = year
|
||||
this.plot = descript
|
||||
//this.rating = rating
|
||||
this.duration = duration
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 VfFilmProviderPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(VfFilmProvider())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue