mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: removed sorastream
This commit is contained in:
parent
7ee31320ed
commit
69a138b367
2 changed files with 7 additions and 107 deletions
|
@ -717,59 +717,17 @@ object SoraExtractor : SoraStream() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun invokeNetMovies(
|
|
||||||
id: String? = null,
|
|
||||||
type: String? = null,
|
|
||||||
episode: Int? = null,
|
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
|
||||||
callback: (ExtractorLink) -> Unit
|
|
||||||
) {
|
|
||||||
val epsId = app.get(
|
|
||||||
"$netMoviesAPI/detail?category=$type&id=$id",
|
|
||||||
).parsedSafe<Load>()?.data?.episodeVo?.find {
|
|
||||||
it.seriesNo == (episode ?: 0)
|
|
||||||
}?.id ?: return
|
|
||||||
|
|
||||||
val sources = app.get("$netMoviesAPI/episode?category=$type&id=$id&episode=$epsId")
|
|
||||||
.parsedSafe<NetMoviesSources>()?.data ?: return
|
|
||||||
|
|
||||||
sources.subtitles?.map { sub ->
|
|
||||||
subtitleCallback.invoke(
|
|
||||||
SubtitleFile(
|
|
||||||
getVipLanguage(sub.lang ?: return@map null),
|
|
||||||
sub.url ?: return@map null
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
sources.qualities?.map { source ->
|
|
||||||
callback.invoke(
|
|
||||||
ExtractorLink(
|
|
||||||
"NetMovies",
|
|
||||||
"NetMovies",
|
|
||||||
source.url ?: return@map null,
|
|
||||||
"",
|
|
||||||
source.quality?.toIntOrNull() ?: Qualities.Unknown.value,
|
|
||||||
isM3u8 = true,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun invokeSoraStream(
|
suspend fun invokeSoraStream(
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
year: Int? = null,
|
year: Int? = null,
|
||||||
season: Int? = null,
|
season: Int? = null,
|
||||||
episode: Int? = null,
|
episode: Int? = null,
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
|
||||||
) {
|
) {
|
||||||
val headers = mapOf(
|
val headers = mapOf(
|
||||||
"lang" to "en",
|
"lang" to "en",
|
||||||
"versioncode" to "11",
|
"versioncode" to "32",
|
||||||
"clienttype" to "ios_jike_default"
|
"clienttype" to "android_tem3",
|
||||||
)
|
)
|
||||||
val vipAPI =
|
val vipAPI =
|
||||||
base64DecodeAPI("cA==YXA=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
|
base64DecodeAPI("cA==YXA=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
|
||||||
|
@ -814,17 +772,14 @@ object SoraExtractor : SoraStream() {
|
||||||
val id = script?.third?.last() ?: return
|
val id = script?.third?.last() ?: return
|
||||||
val type = script.third?.get(2) ?: return
|
val type = script.third?.get(2) ?: return
|
||||||
|
|
||||||
val jsonResponse = app.get(
|
val json = app.get(
|
||||||
"$vipAPI/movieDrama/get?id=${id}&category=${type}",
|
"$vipAPI/movieDrama/get?id=${id}&category=${type}",
|
||||||
headers = headers
|
headers = headers
|
||||||
).parsedSafe<Load>()?.data
|
).parsedSafe<Load>()?.data?.episodeVo?.find {
|
||||||
?: return invokeNetMovies(id, type, episode, subtitleCallback, callback)
|
|
||||||
|
|
||||||
val json = jsonResponse.episodeVo?.find {
|
|
||||||
it.seriesNo == (episode ?: 0)
|
it.seriesNo == (episode ?: 0)
|
||||||
}
|
} ?: return
|
||||||
|
|
||||||
json?.subtitlingList?.map { sub ->
|
json.subtitlingList?.map { sub ->
|
||||||
subtitleCallback.invoke(
|
subtitleCallback.invoke(
|
||||||
SubtitleFile(
|
SubtitleFile(
|
||||||
getVipLanguage(sub.languageAbbr ?: return@map),
|
getVipLanguage(sub.languageAbbr ?: return@map),
|
||||||
|
@ -833,28 +788,6 @@ object SoraExtractor : SoraStream() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
json?.definitionList?.apmap { video ->
|
|
||||||
val body =
|
|
||||||
"""[{"category":$type,"contentId":"$id","episodeId":${json.id},"definition":"${video.code}"}]""".toRequestBody(
|
|
||||||
RequestBodyTypes.JSON.toMediaTypeOrNull()
|
|
||||||
)
|
|
||||||
val response = app.post(
|
|
||||||
"${vipAPI}/media/bathGetplayInfo",
|
|
||||||
requestBody = body,
|
|
||||||
headers = headers,
|
|
||||||
).text.let { tryParseJson<PreviewResponse>(it)?.data?.firstOrNull() }
|
|
||||||
callback.invoke(
|
|
||||||
ExtractorLink(
|
|
||||||
this.name,
|
|
||||||
this.name,
|
|
||||||
response?.mediaUrl ?: return@apmap null,
|
|
||||||
"",
|
|
||||||
getSoraQuality(response.currentDefinition ?: ""),
|
|
||||||
isM3u8 = true,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun invokeXmovies(
|
suspend fun invokeXmovies(
|
||||||
|
@ -2462,26 +2395,6 @@ data class Load(
|
||||||
@JsonProperty("data") val data: MediaDetail? = null,
|
@JsonProperty("data") val data: MediaDetail? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
data class NetMoviesSubtitles(
|
|
||||||
@JsonProperty("lang") val lang: String? = null,
|
|
||||||
@JsonProperty("language") val language: String? = null,
|
|
||||||
@JsonProperty("url") val url: String? = null,
|
|
||||||
)
|
|
||||||
|
|
||||||
data class NetMoviesQualities(
|
|
||||||
@JsonProperty("quality") val quality: String? = null,
|
|
||||||
@JsonProperty("url") val url: String? = null,
|
|
||||||
)
|
|
||||||
|
|
||||||
data class NetMoviesData(
|
|
||||||
@JsonProperty("subtitles") val subtitles: ArrayList<NetMoviesSubtitles>? = arrayListOf(),
|
|
||||||
@JsonProperty("qualities") val qualities: ArrayList<NetMoviesQualities>? = arrayListOf(),
|
|
||||||
)
|
|
||||||
|
|
||||||
data class NetMoviesSources(
|
|
||||||
@JsonProperty("data") val data: NetMoviesData? = null,
|
|
||||||
)
|
|
||||||
|
|
||||||
data class ConsumetHeaders(
|
data class ConsumetHeaders(
|
||||||
@JsonProperty("Referer") val referer: String? = null,
|
@JsonProperty("Referer") val referer: String? = null,
|
||||||
)
|
)
|
||||||
|
@ -2577,15 +2490,6 @@ data class DirectDl(
|
||||||
@JsonProperty("download_url") val download_url: String? = null,
|
@JsonProperty("download_url") val download_url: String? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
data class PreviewResponse(
|
|
||||||
@JsonProperty("data") val data: ArrayList<PreviewVideos>? = arrayListOf(),
|
|
||||||
)
|
|
||||||
|
|
||||||
data class PreviewVideos(
|
|
||||||
@JsonProperty("mediaUrl") val mediaUrl: String? = null,
|
|
||||||
@JsonProperty("currentDefinition") val currentDefinition: String? = null,
|
|
||||||
)
|
|
||||||
|
|
||||||
data class Safelink(
|
data class Safelink(
|
||||||
@JsonProperty("safelink") val safelink: String? = null,
|
@JsonProperty("safelink") val safelink: String? = null,
|
||||||
)
|
)
|
||||||
|
|
|
@ -73,13 +73,10 @@ open class SoraStream : TmdbProvider() {
|
||||||
|
|
||||||
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
|
||||||
|
// private val mainAPI =
|
||||||
// private val mainAPI =
|
|
||||||
// base64DecodeAPI("cHA=LmE=ZWw=cmM=dmU=aC4=dGM=d2E=eHA=Ly8=czo=dHA=aHQ=")
|
// base64DecodeAPI("cHA=LmE=ZWw=cmM=dmU=aC4=dGM=d2E=eHA=Ly8=czo=dHA=aHQ=")
|
||||||
// private var mainServerAPI =
|
// private var mainServerAPI =
|
||||||
// base64DecodeAPI("cA==YXA=bC4=Y2U=ZXI=LnY=aWU=b3Y=LW0=cmE=c28=Ly8=czo=dHA=aHQ=")
|
// base64DecodeAPI("cA==YXA=bC4=Y2U=ZXI=LnY=aWU=b3Y=LW0=cmE=c28=Ly8=czo=dHA=aHQ=")
|
||||||
var netMoviesAPI =
|
|
||||||
base64DecodeAPI("aQ==YXA=cC8=YXA=bC4=Y2U=ZXI=LnY=bG0=Zmk=dC0=bmU=Ly8=czo=dHA=aHQ=")
|
|
||||||
|
|
||||||
// ALL SOURCES
|
// ALL SOURCES
|
||||||
const val twoEmbedAPI = "https://www.2embed.to"
|
const val twoEmbedAPI = "https://www.2embed.to"
|
||||||
|
@ -345,7 +342,6 @@ open class SoraStream : TmdbProvider() {
|
||||||
res.season,
|
res.season,
|
||||||
res.episode,
|
res.episode,
|
||||||
subtitleCallback,
|
subtitleCallback,
|
||||||
callback
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue