small fix

This commit is contained in:
helo 2023-09-29 10:10:49 +07:00
parent 2c1c0e88c7
commit c2e751805a
5 changed files with 1 additions and 129 deletions

View file

@ -1,7 +1,6 @@
package com.hexated package com.hexated
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder.unixTime
import com.lagradost.cloudstream3.APIHolder.unixTimeMS import com.lagradost.cloudstream3.APIHolder.unixTimeMS
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
@ -2548,56 +2547,5 @@ object SoraExtractor : SoraStream() {
) )
} }
suspend fun invokeNetflix(
imdbId: String? = null,
title: String? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val headers = mapOf("X-Requested-With" to "XMLHttpRequest", "Cookie" to "hd=on")
val netflixId = imdbToNetflixId(imdbId, season) ?: run {
app.get("$netflixAPI/search.php?s=$title&t=${unixTime}", headers = headers)
.parsedSafe<NetflixSearch>()?.searchResult?.find { it.t.equals(title) }?.id
}
val (t, id) = app.get(
"$netflixAPI/post.php?id=${netflixId ?: return}&t=${unixTime}",
headers = headers
).parsedSafe<NetflixResponse>().let { media ->
if (season == null) {
media?.title to netflixId
} else {
val seasonId = media?.season?.find { it.s == "$season" }?.id
val episodeId =
app.get(
"$netflixAPI/episodes.php?s=${seasonId}&series=$netflixId&t=${unixTime}",
headers = headers
)
.parsedSafe<NetflixResponse>()?.episodes?.find { it.ep == "E$episode" }?.id
media?.title to episodeId
}
}
app.get(
"$netflixAPI/playlist.php?id=${id ?: return}&t=${t ?: return}&tm=${unixTime}",
headers = headers
).text.let {
tryParseJson<ArrayList<NetflixResponse>>(it)
}?.firstOrNull()?.sources?.map {
callback.invoke(
ExtractorLink(
"Netflix",
"Netflix",
fixUrl(it.file ?: return@map, netflixAPI),
"$netflixAPI/",
getQualityFromName(it.file.substringAfter("q=")),
INFER_TYPE,
headers = mapOf("Cookie" to "hd=on")
)
)
}
}
} }

View file

@ -392,45 +392,3 @@ data class EMovieTraks(
@JsonProperty("file") val file: String? = null, @JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String? = null, @JsonProperty("label") val label: String? = null,
) )
data class WatchhubStream(
@JsonProperty("name") val name: String? = null,
@JsonProperty("externalUrl") val externalUrl: String? = null,
)
data class WatchhubResponse(
@JsonProperty("streams") val streams: ArrayList<WatchhubStream>? = arrayListOf(),
)
data class NetflixSources(
@JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String? = null,
)
data class NetflixEpisodes(
@JsonProperty("id") val id: String? = null,
@JsonProperty("t") val t: String? = null,
@JsonProperty("s") val s: String? = null,
@JsonProperty("ep") val ep: String? = null,
)
data class NetflixSeason(
@JsonProperty("s") val s: String? = null,
@JsonProperty("id") val id: String? = null,
)
data class NetflixResponse(
@JsonProperty("title") val title: String? = null,
@JsonProperty("season") val season: ArrayList<NetflixSeason>? = arrayListOf(),
@JsonProperty("episodes") val episodes: ArrayList<NetflixEpisodes>? = arrayListOf(),
@JsonProperty("sources") val sources: ArrayList<NetflixSources>? = arrayListOf(),
)
data class NetflixSearchResult(
@JsonProperty("t") val t: String? = null,
@JsonProperty("id") val id: String? = null,
)
data class NetflixSearch(
@JsonProperty("searchResult") val searchResult: ArrayList<NetflixSearchResult>? = arrayListOf(),
)

View file

@ -39,7 +39,6 @@ import com.hexated.SoraExtractor.invokeHdmovies4u
import com.hexated.SoraExtractor.invokeJump1 import com.hexated.SoraExtractor.invokeJump1
import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMoment
import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeMultimovies
import com.hexated.SoraExtractor.invokeNetflix
import com.hexated.SoraExtractor.invokeNetmovies import com.hexated.SoraExtractor.invokeNetmovies
import com.hexated.SoraExtractor.invokePobmovies import com.hexated.SoraExtractor.invokePobmovies
import com.hexated.SoraExtractor.invokeGomovies import com.hexated.SoraExtractor.invokeGomovies
@ -80,7 +79,6 @@ open class SoraStream : TmdbProvider() {
const val anilistAPI = "https://graphql.anilist.co" const val anilistAPI = "https://graphql.anilist.co"
const val malsyncAPI = "https://api.malsync.moe" const val malsyncAPI = "https://api.malsync.moe"
const val jikanAPI = "https://api.jikan.moe/v4" const val jikanAPI = "https://api.jikan.moe/v4"
const val watchhubApi = "https://watchhub.strem.io"
private val apiKey = private val apiKey =
base64DecodeAPI("ZTM=NTg=MjM=MjM=ODc=MzI=OGQ=MmE=Nzk=Nzk=ZjI=NTA=NDY=NDA=MzA=YjA=") // PLEASE DON'T STEAL base64DecodeAPI("ZTM=NTg=MjM=MjM=ODc=MzI=OGQ=MmE=Nzk=Nzk=ZjI=NTA=NDY=NDA=MzA=YjA=") // PLEASE DON'T STEAL
@ -128,7 +126,6 @@ open class SoraStream : TmdbProvider() {
const val susflixAPI = "https://susflix.tv" const val susflixAPI = "https://susflix.tv"
const val jump1API = "https://ca.jump1.net" const val jump1API = "https://ca.jump1.net"
const val vegaMoviesAPI = "https://vegamovies.im" const val vegaMoviesAPI = "https://vegamovies.im"
const val netflixAPI = "https://m.netflixmirror.com"
const val hdmovies4uAPI = "https://hdmovies4u.name" const val hdmovies4uAPI = "https://hdmovies4u.name"
const val watchflxAPI = "https://watchflx.tv" const val watchflxAPI = "https://watchflx.tv"
const val gomoviesAPI = "https://gomovies-online.cam" const val gomoviesAPI = "https://gomovies-online.cam"
@ -717,15 +714,6 @@ open class SoraStream : TmdbProvider() {
callback callback
) )
}, },
{
if (!res.isAnime) invokeNetflix(
res.imdbId,
res.title,
res.season,
res.episode,
callback
)
},
{ {
if (!res.isAnime) invokeHdmovies4u( if (!res.isAnime) invokeHdmovies4u(
res.title, res.title,

View file

@ -25,7 +25,6 @@ import com.hexated.SoraExtractor.invokeEmovies
import com.hexated.SoraExtractor.invokeJump1 import com.hexated.SoraExtractor.invokeJump1
import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMoment
import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeMultimovies
import com.hexated.SoraExtractor.invokeNetflix
import com.hexated.SoraExtractor.invokeNetmovies import com.hexated.SoraExtractor.invokeNetmovies
import com.hexated.SoraExtractor.invokeGomovies import com.hexated.SoraExtractor.invokeGomovies
import com.hexated.SoraExtractor.invokePutactor import com.hexated.SoraExtractor.invokePutactor
@ -295,15 +294,6 @@ class SoraStreamLite : SoraStream() {
callback callback
) )
}, },
{
if (!res.isAnime) invokeNetflix(
res.imdbId,
res.title,
res.season,
res.episode,
callback
)
},
{ {
invokeZshow( invokeZshow(
res.title, res.title,

View file

@ -12,7 +12,6 @@ import com.hexated.SoraStream.Companion.smashyStreamAPI
import com.hexated.SoraStream.Companion.tvMoviesAPI import com.hexated.SoraStream.Companion.tvMoviesAPI
import com.hexated.SoraStream.Companion.watchOnlineAPI import com.hexated.SoraStream.Companion.watchOnlineAPI
import com.hexated.SoraStream.Companion.watchflxAPI import com.hexated.SoraStream.Companion.watchflxAPI
import com.hexated.SoraStream.Companion.watchhubApi
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.APIHolder.getCaptchaToken import com.lagradost.cloudstream3.APIHolder.getCaptchaToken
import com.lagradost.cloudstream3.APIHolder.unixTimeMS import com.lagradost.cloudstream3.APIHolder.unixTimeMS
@ -1015,17 +1014,6 @@ suspend fun tmdbToAnimeId(title: String?, year: Int?, season: String?, type: TvT
} }
suspend fun imdbToNetflixId(imdbId: String?, season: Int?): String? {
val url = if (season == null) {
"$watchhubApi/stream/movie/$imdbId.json"
} else {
"$watchhubApi/stream/series/$imdbId:1:1.json"
}
return app.get(url)
.parsedSafe<WatchhubResponse>()?.streams?.find { it.name == "Netflix" }?.externalUrl
?.substringAfterLast("/")
}
fun generateWpKey(r: String, m: String): String { fun generateWpKey(r: String, m: String): String {
val rList = r.split("\\x").toTypedArray() val rList = r.split("\\x").toTypedArray()
var n = "" var n = ""