Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjohn committed Dec 9, 2023
1 parent 4e3678a commit d5d15af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
20 changes: 9 additions & 11 deletions SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.nicehttp.Requests
import com.lagradost.nicehttp.Session
import com.lagradost.cloudstream3.extractors.helper.AesHelper.cryptoAESHandler
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
import com.lagradost.cloudstream3.network.CloudflareKiller
import com.lagradost.nicehttp.RequestBodyTypes
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody
import org.jsoup.Jsoup
Expand Down Expand Up @@ -2196,7 +2194,7 @@ object SoraExtractor : SoraStream() {

}

suspend fun invokeWatchOnline(
suspend fun invokeCinemaTv(
imdbId: String? = null,
title: String? = null,
year: Int? = null,
Expand All @@ -2208,9 +2206,9 @@ object SoraExtractor : SoraStream() {
val id = imdbId?.removePrefix("tt")
val slug = title.createSlug()
val url = if (season == null) {
"$watchOnlineAPI/movies/play/$id-$slug-$year"
"$cinemaTvAPI/movies/play/$id-$slug-$year"
} else {
"$watchOnlineAPI/shows/play/$id-$slug-$year"
"$cinemaTvAPI/shows/play/$id-$slug-$year"
}

val headers = mapOf(
Expand All @@ -2230,9 +2228,9 @@ object SoraExtractor : SoraStream() {
}).let { it.toRegex().find(script)?.groupValues?.get(1) }

val videoUrl = if (season == null) {
"$watchOnlineAPI/api/v1/security/movie-access?id_movie=$episodeId&hash=$hash&expires=$expires"
"$cinemaTvAPI/api/v1/security/movie-access?id_movie=$episodeId&hash=$hash&expires=$expires"
} else {
"$watchOnlineAPI/api/v1/security/episode-access?id_episode=$episodeId&hash=$hash&expires=$expires"
"$cinemaTvAPI/api/v1/security/episode-access?id_episode=$episodeId&hash=$hash&expires=$expires"
}

val sources = app.get(
Expand All @@ -2244,10 +2242,10 @@ object SoraExtractor : SoraStream() {
sources?.streams?.mapKeys { source ->
callback.invoke(
ExtractorLink(
"WatchOnline",
"WatchOnline",
"CinemaTv",
"CinemaTv",
source.value,
"$watchOnlineAPI/",
"$cinemaTvAPI/",
getQualityFromName(source.key),
true
)
Expand All @@ -2259,7 +2257,7 @@ object SoraExtractor : SoraStream() {
subtitleCallback.invoke(
SubtitleFile(
sub.language ?: return@map,
if (file.startsWith("[")) return@map else fixUrl(file, watchOnlineAPI),
if (file.startsWith("[")) return@map else fixUrl(file, cinemaTvAPI),
)
)
}
Expand Down
6 changes: 3 additions & 3 deletions SoraStream/src/main/kotlin/com/hexated/SoraStream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import com.hexated.SoraExtractor.invokeTvMovies
import com.hexated.SoraExtractor.invokeUhdmovies
import com.hexated.SoraExtractor.invokeVegamovies
import com.hexated.SoraExtractor.invokeVidsrcto
import com.hexated.SoraExtractor.invokeWatchOnline
import com.hexated.SoraExtractor.invokeCinemaTv
import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow
import com.lagradost.cloudstream3.LoadResponse.Companion.addImdbId
Expand Down Expand Up @@ -93,7 +93,7 @@ open class SoraStream : TmdbProvider() {
const val flixonAPI = "https://flixon.lol"
const val smashyStreamAPI = "https://embed.smashystream.com"
const val watchSomuchAPI = "https://watchsomuch.tv" // sub only
const val watchOnlineAPI = "https://www.lookmovie2.to"
var cinemaTvAPI = base64DecodeAPI("bw==LnQ=ZTI=dmk=bW8=b2s=bG8=dy4=d3c=Ly8=czo=dHA=aHQ=")
const val nineTvAPI = "https://moviesapi.club"
const val nowTvAPI = "https://myfilestorage.xyz"
const val gokuAPI = "https://goku.sx"
Expand Down Expand Up @@ -572,7 +572,7 @@ open class SoraStream : TmdbProvider() {
)
},
{
invokeWatchOnline(
invokeCinemaTv(
res.imdbId,
res.title,
res.airedYear ?: res.year,
Expand Down
4 changes: 2 additions & 2 deletions SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.hexated.SoraExtractor.invokeSFMovies
import com.hexated.SoraExtractor.invokeShowflix
import com.hexated.SoraExtractor.invokeVidSrc
import com.hexated.SoraExtractor.invokeVidsrcto
import com.hexated.SoraExtractor.invokeWatchOnline
import com.hexated.SoraExtractor.invokeCinemaTv
import com.hexated.SoraExtractor.invokeWatchsomuch
import com.hexated.SoraExtractor.invokeZshow
import com.lagradost.cloudstream3.SubtitleFile
Expand Down Expand Up @@ -198,7 +198,7 @@ class SoraStreamLite : SoraStream() {
if (!res.isAnime) invokeFlixon(res.id, res.imdbId, res.season, res.episode, callback)
},
{
invokeWatchOnline(
invokeCinemaTv(
res.imdbId,
res.title,
res.airedYear ?: res.year,
Expand Down

0 comments on commit d5d15af

Please sign in to comment.