small improvement

This commit is contained in:
hexated 2023-01-09 11:31:31 +07:00
parent 182a48e1da
commit 5508344128

View file

@ -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)
} }