mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixo sflixo, removo dopeboxo
This commit is contained in:
parent
3a42ca2f6b
commit
8c7312e492
2 changed files with 49 additions and 40 deletions
|
@ -66,10 +66,6 @@ object APIHolder {
|
||||||
|
|
||||||
AsianLoadProvider(),
|
AsianLoadProvider(),
|
||||||
|
|
||||||
SflixProvider("https://sflix.to", "Sflix"),
|
|
||||||
SflixProvider("https://dopebox.to", "Dopebox"),
|
|
||||||
SflixProvider("https://solarmovie.pe", "Solarmovie"),
|
|
||||||
|
|
||||||
BflixProvider("https://bflix.ru","Bflix"),
|
BflixProvider("https://bflix.ru","Bflix"),
|
||||||
BflixProvider("https://fmovies.to","Fmovies.to"),
|
BflixProvider("https://fmovies.to","Fmovies.to"),
|
||||||
BflixProvider("https://sflix.pro","Sflix.pro"),
|
BflixProvider("https://sflix.pro","Sflix.pro"),
|
||||||
|
@ -102,6 +98,10 @@ object APIHolder {
|
||||||
private val backwardsCompatibleProviders = arrayListOf(
|
private val backwardsCompatibleProviders = arrayListOf(
|
||||||
KawaiifuProvider(), // removed due to cloudflare
|
KawaiifuProvider(), // removed due to cloudflare
|
||||||
HDMProvider(),// removed due to cloudflare
|
HDMProvider(),// removed due to cloudflare
|
||||||
|
|
||||||
|
SflixProvider("https://sflix.to", "Sflix"),
|
||||||
|
SflixProvider("https://dopebox.to", "Dopebox"),
|
||||||
|
SflixProvider("https://solarmovie.pe", "Solarmovie"),
|
||||||
)
|
)
|
||||||
|
|
||||||
fun getApiFromName(apiName: String?): MainAPI {
|
fun getApiFromName(apiName: String?): MainAPI {
|
||||||
|
|
|
@ -2,11 +2,10 @@ package com.lagradost.cloudstream3.movieproviders
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
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.utils.*
|
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
|
|
||||||
class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
override val mainUrl = providerUrl
|
override val mainUrl = providerUrl
|
||||||
|
@ -18,6 +17,7 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
TvType.Movie,
|
TvType.Movie,
|
||||||
TvType.TvSeries,
|
TvType.TvSeries,
|
||||||
)
|
)
|
||||||
|
|
||||||
override suspend fun getMainPage(): HomePageResponse {
|
override suspend fun getMainPage(): HomePageResponse {
|
||||||
val items = ArrayList<HomePageList>()
|
val items = ArrayList<HomePageList>()
|
||||||
val urls = listOf(
|
val urls = listOf(
|
||||||
|
@ -52,6 +52,7 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
if (items.size <= 0) throw ErrorLoadingException()
|
if (items.size <= 0) throw ErrorLoadingException()
|
||||||
return HomePageResponse(items)
|
return HomePageResponse(items)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Credits to https://github.com/jmir1
|
//Credits to https://github.com/jmir1
|
||||||
val key = "eST4kCjadnvlAm5b1BOGyLJzrE90Q6oKgRfhV+M8NDYtcxW3IP/qp2i7XHuwZFUs"
|
val key = "eST4kCjadnvlAm5b1BOGyLJzrE90Q6oKgRfhV+M8NDYtcxW3IP/qp2i7XHuwZFUs"
|
||||||
|
|
||||||
|
@ -195,7 +196,6 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
@JsonProperty("html") val html: String
|
@JsonProperty("html") val html: String
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
override suspend fun load(url: String): LoadResponse? {
|
override suspend fun load(url: String): LoadResponse? {
|
||||||
val soup = app.get(url).document
|
val soup = app.get(url).document
|
||||||
val movieid = soup.selectFirst("div#watch").attr("data-id")
|
val movieid = soup.selectFirst("div#watch").attr("data-id")
|
||||||
|
@ -212,23 +212,30 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
|
|
||||||
val tags = soup.select("div.info .meta div:contains(Genre) a").map { it.text() }
|
val tags = soup.select("div.info .meta div:contains(Genre) a").map { it.text() }
|
||||||
val episodes = if (tvType == TvType.TvSeries) Jsoup.parse(
|
val episodes = if (tvType == TvType.TvSeries) Jsoup.parse(
|
||||||
parseJson<Response>(
|
|
||||||
app.get(
|
app.get(
|
||||||
"$mainUrl/ajax/film/servers?id=$movieid&vrf=$movieidencoded"
|
"$mainUrl/ajax/film/servers?id=$movieid&vrf=$movieidencoded"
|
||||||
).text
|
).mapped<Response>().html
|
||||||
).html
|
|
||||||
).select("div.episode").map {
|
).select("div.episode").map {
|
||||||
val href = fixUrl(it.selectFirst("a").attr("href"))
|
val a = it.selectFirst("a")
|
||||||
|
val href = fixUrl(a.attr("href"))
|
||||||
|
val extraData = a.attr("data-kname")?.let { str ->
|
||||||
|
str.split("-").mapNotNull { subStr -> subStr.toIntOrNull() }
|
||||||
|
}
|
||||||
|
val isValid = extraData?.size == 2
|
||||||
|
val episode = if (isValid) extraData?.getOrNull(1) else null
|
||||||
|
val season = if (isValid) extraData?.getOrNull(0) else null
|
||||||
|
|
||||||
val eptitle = it.selectFirst(".episode a span.name").text()
|
val eptitle = it.selectFirst(".episode a span.name").text()
|
||||||
TvSeriesEpisode(
|
TvSeriesEpisode(
|
||||||
eptitle,
|
eptitle,
|
||||||
null,
|
season,
|
||||||
null,
|
episode,
|
||||||
href,
|
href,
|
||||||
)
|
)
|
||||||
} else null
|
} else null
|
||||||
val recommendations =
|
val recommendations =
|
||||||
soup.select("div.bl-2 section.bl div.content div.filmlist div.item")?.mapNotNull { element ->
|
soup.select("div.bl-2 section.bl div.content div.filmlist div.item")
|
||||||
|
?.mapNotNull { element ->
|
||||||
val recTitle = element.select("h3 a").text() ?: return@mapNotNull null
|
val recTitle = element.select("h3 a").text() ?: return@mapNotNull null
|
||||||
val image = element.select("a.poster img")?.attr("src")
|
val image = element.select("a.poster img")?.attr("src")
|
||||||
val recUrl = fixUrl(element.select("a").attr("href"))
|
val recUrl = fixUrl(element.select("a").attr("href"))
|
||||||
|
@ -321,7 +328,8 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
val servers = if (tvType == TvType.Movie) it.select(".episode a").attr("data-ep")
|
val servers = if (tvType == TvType.Movie) it.select(".episode a").attr("data-ep")
|
||||||
else
|
else
|
||||||
it.select(".episode a[href=$cleandata]").attr("data-ep")
|
it.select(".episode a[href=$cleandata]").attr("data-ep")
|
||||||
?: it.select(".episode a[href=${cleandata.replace("/1-full","")}]").attr("data-ep")
|
?: it.select(".episode a[href=${cleandata.replace("/1-full", "")}]")
|
||||||
|
.attr("data-ep")
|
||||||
val jsonservers = parseJson<Servers?>(servers) ?: return@map
|
val jsonservers = parseJson<Servers?>(servers) ?: return@map
|
||||||
listOfNotNull(
|
listOfNotNull(
|
||||||
jsonservers.vidstream,
|
jsonservers.vidstream,
|
||||||
|
@ -340,7 +348,8 @@ class BflixProvider(providerUrl: String, providerName: String) : MainAPI() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
//Apparently any server works, I haven't found any diference
|
//Apparently any server works, I haven't found any diference
|
||||||
val sublink = app.get("$mainUrl/ajax/episode/subtitles/${jsonservers.vidstream}").text
|
val sublink =
|
||||||
|
app.get("$mainUrl/ajax/episode/subtitles/${jsonservers.vidstream}").text
|
||||||
val jsonsub = parseJson<List<Subtitles>>(sublink)
|
val jsonsub = parseJson<List<Subtitles>>(sublink)
|
||||||
jsonsub.forEach { subtitle ->
|
jsonsub.forEach { subtitle ->
|
||||||
subtitleCallback(
|
subtitleCallback(
|
||||||
|
|
Loading…
Reference in a new issue