fixed Watchsomuch

This commit is contained in:
hexated 2023-02-19 12:30:23 +07:00
parent 06f0c31903
commit 1c63995b44

View file

@ -1946,21 +1946,21 @@ object SoraExtractor : SoraStream() {
} }
} ?: return } ?: return
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
val subUrl = if (season == null) { val subUrl = if (season == null) {
"$watchSomuchAPI/Watch/ajMovieSubtitles.aspx?mid=$id&tid=$epsId&part=" "$watchSomuchAPI/Watch/ajMovieSubtitles.aspx?mid=$id&tid=$epsId&part="
} else { } else {
"$watchSomuchAPI/Watch/ajMovieSubtitles.aspx?mid=$id&tid=$epsId&part=S0${season}E0${episode}" "$watchSomuchAPI/Watch/ajMovieSubtitles.aspx?mid=$id&tid=$epsId&part=S${seasonSlug}E${episodeSlug}"
} }
app.get(subUrl) app.get(subUrl)
.parsedSafe<WatchsomuchSubResponses>()?.subtitles .parsedSafe<WatchsomuchSubResponses>()?.subtitles
?.filter { it.url?.startsWith("https") == true }
?.map { sub -> ?.map { sub ->
Log.i("hexated", "${sub.label} => ${sub.url}")
subtitleCallback.invoke( subtitleCallback.invoke(
SubtitleFile( SubtitleFile(
sub.label ?: "", sub.label ?: "",
sub.url ?: return@map null fixUrl(sub.url ?: return@map null, watchSomuchAPI)
) )
) )
} }