mirror of
https://github.com/recloudstream/cloudstream-extensions.git
synced 2024-08-15 03:03:54 +00:00
Possible TheFlixToProvider fix
This commit is contained in:
parent
4bce415690
commit
52a300c1d7
2 changed files with 109 additions and 96 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 1
|
||||
version = 2
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -22,7 +22,6 @@ class TheFlixToProvider : MainAPI() {
|
|||
)
|
||||
|
||||
|
||||
|
||||
data class HomeJson(
|
||||
@JsonProperty("props") val props: HomeProps = HomeProps(),
|
||||
)
|
||||
|
@ -130,7 +129,8 @@ class TheFlixToProvider : MainAPI() {
|
|||
"Referer" to mainUrl,
|
||||
"Sec-Fetch-Dest" to "empty",
|
||||
"Sec-Fetch-Mode" to "cors",
|
||||
"Sec-Fetch-Site" to "same-site",)
|
||||
"Sec-Fetch-Site" to "same-site",
|
||||
)
|
||||
).cookies
|
||||
/* val cookieRegex = Regex("(theflix\\..*?id\\=[a-zA-Z0-9]{0,8}[a-zA-Z0-9_-]+)")
|
||||
val findcookie = cookieRegex.findAll(cookieResponse.toString()).map { it.value }.toList()
|
||||
|
@ -177,7 +177,12 @@ class TheFlixToProvider : MainAPI() {
|
|||
if (type?.contains("TV") == true) TvType.TvSeries else TvType.Movie
|
||||
val link =
|
||||
if (typeinfo == TvType.Movie) "$mainUrl/movie/${info.id}-${cleanTitle(title)}"
|
||||
else "$mainUrl/tv-show/${info.id}-${cleanTitle(title).replace("?","")}/season-1/episode-1"
|
||||
else "$mainUrl/tv-show/${info.id}-${
|
||||
cleanTitle(title).replace(
|
||||
"?",
|
||||
""
|
||||
)
|
||||
}/season-1/episode-1"
|
||||
TvSeriesSearchResponse(
|
||||
title,
|
||||
link,
|
||||
|
@ -272,6 +277,7 @@ class TheFlixToProvider : MainAPI() {
|
|||
}
|
||||
return search
|
||||
}
|
||||
|
||||
data class LoadMain(
|
||||
@JsonProperty("props") val props: LoadProps? = LoadProps(),
|
||||
@JsonProperty("page") val page: String? = null,
|
||||
|
@ -319,6 +325,7 @@ class TheFlixToProvider : MainAPI() {
|
|||
@JsonProperty("videos") val videos: ArrayList<String>? = arrayListOf(),
|
||||
@JsonProperty("runtime") val runtime: Int? = null,
|
||||
)
|
||||
|
||||
data class Seasons(
|
||||
@JsonProperty("name") val name: String? = null,
|
||||
@JsonProperty("numberOfEpisodes") val numberOfEpisodes: Int? = null,
|
||||
|
@ -545,28 +552,31 @@ class TheFlixToProvider : MainAPI() {
|
|||
val qualityReg = Regex("(\\d+p)")
|
||||
if (isMovie) {
|
||||
json.props?.pageProps?.movie?.videos?.apmap { id ->
|
||||
val jsonmovie = app.get("$authhost/movies/videos/$id/request-access?contentUsageType=Viewing",
|
||||
headers = latestCookies).parsedSafe<VideoData>() ?: return@apmap false
|
||||
val extractedlink = jsonmovie.url
|
||||
if (!extractedlink.isNullOrEmpty()) {
|
||||
val quality = qualityReg.find(extractedlink)?.value ?: ""
|
||||
val videoData = app.get(
|
||||
"$authhost/movies/videos/$id/request-access?contentUsageType=Viewing",
|
||||
cookies = latestCookies
|
||||
).parsedSafe<VideoData>() ?: return@apmap false
|
||||
val extractedLink = videoData.url
|
||||
|
||||
if (!extractedLink.isNullOrEmpty()) {
|
||||
val quality = qualityReg.find(extractedLink)?.value ?: ""
|
||||
callback(
|
||||
ExtractorLink(
|
||||
name,
|
||||
name,
|
||||
extractedlink,
|
||||
"",
|
||||
extractedLink,
|
||||
this.mainUrl + "/",
|
||||
getQualityFromName(quality),
|
||||
false
|
||||
)
|
||||
)
|
||||
} else null
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
val dataRegex = Regex("(season-(\\d+)\\/episode-(\\d+))")
|
||||
val cleandatainfo = dataRegex.find(data)?.value?.replace(Regex("(season-|episode-)"),"")?.replace("/","x")
|
||||
val cleandatainfo =
|
||||
dataRegex.find(data)?.value?.replace(Regex("(season-|episode-)"), "")
|
||||
?.replace("/", "x")
|
||||
val tesatt = cleandatainfo.let { str ->
|
||||
str?.split("x")?.mapNotNull { subStr -> subStr.toIntOrNull() }
|
||||
}
|
||||
|
@ -577,7 +587,10 @@ class TheFlixToProvider : MainAPI() {
|
|||
val epsInfo = Triple(it.seasonNumber, it.episodeNumber, it.videos)
|
||||
if (epsInfo.first == seasonid && epsInfo.second == epID) {
|
||||
epsInfo.third?.apmap { id ->
|
||||
val jsonserie = app.get("$authhost/tv/videos/$id/request-access?contentUsageType=Viewing", headers = latestCookies).parsedSafe<VideoData>() ?: return@apmap false
|
||||
val jsonserie = app.get(
|
||||
"$authhost/tv/videos/$id/request-access?contentUsageType=Viewing",
|
||||
cookies = latestCookies
|
||||
).parsedSafe<VideoData>() ?: return@apmap false
|
||||
val extractedlink = jsonserie.url
|
||||
if (!extractedlink.isNullOrEmpty()) {
|
||||
val quality = qualityReg.find(extractedlink)?.value ?: ""
|
||||
|
@ -586,7 +599,7 @@ class TheFlixToProvider : MainAPI() {
|
|||
name,
|
||||
name,
|
||||
extractedlink,
|
||||
"",
|
||||
this.mainUrl + "/",
|
||||
getQualityFromName(quality),
|
||||
false
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue