sora: small fix indexsite

This commit is contained in:
hexated 2023-02-22 03:40:08 +07:00
parent 0c66fd9266
commit 5e71686299
3 changed files with 20 additions and 8 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 94
version = 95
cloudstream {

View file

@ -2362,11 +2362,16 @@ object SoraExtractor : SoraStream() {
if (api in lockedIndex) app.post(
"${apiUrl}search",
data = data,
headers = passHeaders
).text else app.post("${apiUrl}search", data = data).text
headers = passHeaders,
referer = apiUrl
).text else app.post(
"${apiUrl}search",
data = data,
referer = apiUrl
).text
)
} else {
app.post("${apiUrl}search", requestBody = body).text
app.post("${apiUrl}search", requestBody = body,referer = apiUrl).text
}
val media = if (api in untrimmedIndex) searchIndex(
title,
@ -2388,15 +2393,16 @@ object SoraExtractor : SoraStream() {
app.post(
"${apiUrl}id2path",
data = pathData,
headers = passHeaders
headers = passHeaders,
referer = apiUrl
)
} else {
app.post(
"${apiUrl}id2path", data = pathData
"${apiUrl}id2path", data = pathData, referer = apiUrl
)
}
} else {
app.post("${apiUrl}id2path", requestBody = pathBody)
app.post("${apiUrl}id2path", requestBody = pathBody, referer = apiUrl)
}).text.let { path ->
if (api == "RinzryMovies") {
val worker = app.get(

View file

@ -262,7 +262,7 @@ open class SoraStream : TmdbProvider() {
?.randomOrNull()
return if (type == TvType.TvSeries) {
val lastSeason = res.seasons?.lastOrNull()?.seasonNumber
val lastSeason = res.last_episode_to_air?.season_number
val episodes = res.seasons?.mapNotNull { season ->
app.get("$tmdbAPI/${data.type}/${data.id}/season/${season.seasonNumber}?api_key=$apiKey")
.parsedSafe<MediaDetailEpisodes>()?.episodes?.map { eps ->
@ -882,6 +882,11 @@ open class SoraStream : TmdbProvider() {
@JsonProperty("results") val results: ArrayList<Media>? = arrayListOf(),
)
data class LastEpisodeToAir(
@JsonProperty("episode_number") val episode_number: Int? = null,
@JsonProperty("season_number") val season_number: Int? = null,
)
data class MediaDetail(
@JsonProperty("id") val id: Int? = null,
@JsonProperty("imdb_id") val imdbId: String? = null,
@ -900,6 +905,7 @@ open class SoraStream : TmdbProvider() {
@JsonProperty("status") val status: String? = null,
@JsonProperty("genres") val genres: ArrayList<Genres>? = arrayListOf(),
@JsonProperty("keywords") val keywords: KeywordResults? = null,
@JsonProperty("last_episode_to_air") val last_episode_to_air: LastEpisodeToAir? = null,
@JsonProperty("seasons") val seasons: ArrayList<Seasons>? = arrayListOf(),
@JsonProperty("videos") val videos: ResultsTrailer? = null,
@JsonProperty("external_ids") val external_ids: ExternalIds? = null,