mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
small improvement
This commit is contained in:
parent
182a48e1da
commit
5508344128
1 changed files with 6 additions and 9 deletions
|
@ -757,14 +757,11 @@ object SoraExtractor : SoraStream() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val jsonResponse = app.get(
|
val epsId = app.get(
|
||||||
"$netMoviesAPI/detail?category=$type&id=$id",
|
"$netMoviesAPI/detail?category=$type&id=$id",
|
||||||
)
|
).parsedSafe<Load>()?.data?.episodeVo?.find {
|
||||||
|
|
||||||
if (!jsonResponse.isSuccessful) return
|
|
||||||
val epsId = jsonResponse.parsedSafe<Load>()?.data?.episodeVo?.find {
|
|
||||||
it.seriesNo == (episode ?: 0)
|
it.seriesNo == (episode ?: 0)
|
||||||
}?.id
|
}?.id ?: return
|
||||||
|
|
||||||
val sources = app.get("$netMoviesAPI/episode?category=$type&id=$id&episode=$epsId")
|
val sources = app.get("$netMoviesAPI/episode?category=$type&id=$id&episode=$epsId")
|
||||||
.parsedSafe<NetMoviesSources>()?.data ?: return
|
.parsedSafe<NetMoviesSources>()?.data ?: return
|
||||||
|
@ -854,10 +851,10 @@ object SoraExtractor : SoraStream() {
|
||||||
val jsonResponse = app.get(
|
val jsonResponse = app.get(
|
||||||
"$vipAPI/movieDrama/get?id=${id}&category=${type}",
|
"$vipAPI/movieDrama/get?id=${id}&category=${type}",
|
||||||
headers = headers
|
headers = headers
|
||||||
)
|
).parsedSafe<Load>()?.data
|
||||||
|
|
||||||
if (!jsonResponse.isSuccessful) invokeNetMovies(id, type, episode, subtitleCallback, callback)
|
if (jsonResponse == null) invokeNetMovies(id, type, episode, subtitleCallback, callback)
|
||||||
val json = jsonResponse.parsedSafe<Load>()?.data?.episodeVo?.find {
|
val json = jsonResponse?.episodeVo?.find {
|
||||||
it.seriesNo == (episode ?: 0)
|
it.seriesNo == (episode ?: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue