small fix

This commit is contained in:
jack 2023-11-15 17:35:11 +07:00
parent e999b97a00
commit 3ea91518ef
3 changed files with 8 additions and 4 deletions

View file

@ -2243,14 +2243,18 @@ object SoraExtractor : SoraStream() {
suspend fun invokeNowTv(
tmdbId: Int? = null,
imdbId: String? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit
) {
val referer = "https://bflix.gs/"
val slug = getEpisodeSlug(season, episode)
val url = if (season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${slug.second}.mp4"
var url = if (season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${slug.second}.mp4"
if (!app.get(url, referer = referer).isSuccessful) {
url = if (season == null) "$nowTvAPI/$imdbId.mp4" else "$nowTvAPI/tv/$imdbId/s${season}e${slug.second}.mp4"
if (!app.get(url, referer = referer).isSuccessful) return
}
callback.invoke(
ExtractorLink(
"NowTv",

View file

@ -571,7 +571,7 @@ open class SoraStream : TmdbProvider() {
)
},
{
if (!res.isAnime) invokeNowTv(res.id, res.season, res.episode, callback)
if (!res.isAnime) invokeNowTv(res.id, res.imdbId, res.season, res.episode, callback)
},
{
if (!res.isAnime && res.season == null) invokeRidomovies(

View file

@ -209,7 +209,7 @@ class SoraStreamLite : SoraStream() {
)
},
{
if (!res.isAnime) invokeNowTv(res.id, res.season, res.episode, callback)
if (!res.isAnime) invokeNowTv(res.id, res.imdbId, res.season, res.episode, callback)
},
{
invokeNavy(res.imdbId, res.season, res.episode, callback)