From 6cdeb659222cee55e38bd25dee7c93227f158217 Mon Sep 17 00:00:00 2001 From: hexated Date: Mon, 11 Sep 2023 11:55:09 +0700 Subject: [PATCH] sora: added omega --- SoraStream/build.gradle.kts | 2 +- .../main/kotlin/com/hexated/SoraExtractor.kt | 73 ++++++------------- .../src/main/kotlin/com/hexated/SoraParser.kt | 14 ++++ .../src/main/kotlin/com/hexated/SoraStream.kt | 32 ++++---- .../main/kotlin/com/hexated/SoraStreamLite.kt | 18 ++--- 5 files changed, 57 insertions(+), 82 deletions(-) diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index ee899967..129c982d 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 165 +version = 166 android { defaultConfig { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index a7b59f8a..5b80bdfd 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -263,58 +263,6 @@ object SoraExtractor : SoraStream() { } } - suspend fun invokeSeries9( - title: String? = null, - year: Int? = null, - season: Int? = null, - episode: Int? = null, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ) { - val fixTitle = title.createSlug() - val doc = if (season == null) { - val res = app.get("$series9API/film/$fixTitle/watching.html") - if (!res.isSuccessful) app.get("$series9API/film/$fixTitle-$year/watching.html").document else res.document - } else { - app.get("$series9API/film/$fixTitle-season-$season/watching.html").document - } - - val server = doc.select("div#list-eps div.le-server").map { ele -> - if (season == null) { - ele.select("a").attr("player-data") - } else { - ele.select("a[episode-data=$episode]").attr("player-data") - } - }.find { it.contains(Regex("movembed|membed")) } - - val iframe = app.get(httpsify(server ?: return)) - val iframeDoc = iframe.document - - argamap({ - iframeDoc.select(".list-server-items > .linkserver") - .forEach { element -> - val status = element.attr("data-status") ?: return@forEach - if (status != "1") return@forEach - val extractorData = element.attr("data-video") ?: return@forEach - loadExtractor(extractorData, iframe.url, subtitleCallback, callback) - } - }, { - val iv = "9225679083961858" - val secretKey = "25742532592138496744665879883281" - GogoHelper.extractVidstream( - iframe.url, - "Vidstream", - callback, - iv, - secretKey, - secretKey, - isUsingAdaptiveKeys = false, - isUsingAdaptiveData = true, - iframeDocument = iframeDoc - ) - }) - } - suspend fun invokeIdlix( title: String? = null, year: Int? = null, @@ -2292,6 +2240,27 @@ object SoraExtractor : SoraStream() { } + suspend fun invokeOmega( + tmdbId: Int? = null, + callback: (ExtractorLink) -> Unit, + ) { + app.get("$omegaAPI/v3/movie/sources/$tmdbId") + .parsedSafe()?.sources?.filter { it.label != "2" }?.map { sources -> + sources.sources?.map source@{ source -> + callback.invoke( + ExtractorLink( + "Omega ${sources.label}", + "Omega ${sources.label}", + source.url ?: return@source, + "", + getQualityFromName(source.quality), + INFER_TYPE + ) + ) + } + } + } + suspend fun invokeAsk4Movies( title: String? = null, year: Int? = null, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt index 483be230..fe32debf 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt @@ -58,6 +58,20 @@ data class KisskhSources( @JsonProperty("ThirdParty") val thirdParty: String?, ) +data class OmegaSource( + @JsonProperty("quality") val quality: String? = null, + @JsonProperty("url") val url: String? = null, +) + +data class OmegaSources( + @JsonProperty("label") val label: String? = null, + @JsonProperty("sources") val sources: ArrayList? = arrayListOf(), +) + +data class OmegaResponse( + @JsonProperty("sources") val sources: ArrayList? = arrayListOf(), +) + data class KisskhSubtitle( @JsonProperty("src") val src: String?, @JsonProperty("label") val label: String?, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index c58f07ec..617ecb57 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -11,7 +11,6 @@ import com.hexated.SoraExtractor.invokeFilmxy import com.hexated.SoraExtractor.invokeIdlix import com.hexated.SoraExtractor.invokeKimcartoon import com.hexated.SoraExtractor.invokeMovieHab -import com.hexated.SoraExtractor.invokeSeries9 import com.hexated.SoraExtractor.invokeVidSrc import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer @@ -44,9 +43,9 @@ import com.hexated.SoraExtractor.invokeJump1 import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeNetmovies +import com.hexated.SoraExtractor.invokeOmega import com.hexated.SoraExtractor.invokePobmovies import com.hexated.SoraExtractor.invokePrimewire -import com.hexated.SoraExtractor.invokeSusflix import com.hexated.SoraExtractor.invokeTvMovies import com.hexated.SoraExtractor.invokeUhdmovies import com.hexated.SoraExtractor.invokeVidsrcto @@ -91,7 +90,6 @@ open class SoraStream : TmdbProvider() { const val dbgoAPI = "https://dbgo.fun" const val movieHabAPI = "https://moviehab.com" const val dreamfilmAPI = "https://dreamfilmsw.net" - const val series9API = "https://series9.cx" const val idlixAPI = "https://tv.idlixplus.net" const val noverseAPI = "https://www.nollyverse.com" const val filmxyAPI = "https://www.filmxy.vip" @@ -134,6 +132,7 @@ open class SoraStream : TmdbProvider() { const val animetoshoAPI = "https://animetosho.org" const val susflixAPI = "https://susflix.tv" const val jump1API = "https://ca.jump1.net" + const val omegaAPI = "https://prod.omega.themoviearchive.site" // INDEX SITE const val dahmerMoviesAPI = "https://edytjedhgmdhm.abfhaqrhbnf.workers.dev" @@ -249,7 +248,8 @@ open class SoraStream : TmdbProvider() { val year = releaseDate?.split("-")?.first()?.toIntOrNull() val rating = res.vote_average.toString().toRatingInt() val genres = res.genres?.mapNotNull { it.name } - val isAnime = genres?.contains("Animation") == true && (res.original_language == "zh" || res.original_language == "ja") + val isAnime = + genres?.contains("Animation") == true && (res.original_language == "zh" || res.original_language == "ja") val isAsian = !isAnime && (res.original_language == "zh" || res.original_language == "ko") val keywords = res.keywords?.results?.mapNotNull { it.name }.orEmpty() .ifEmpty { res.keywords?.keywords?.mapNotNull { it.name } } @@ -426,16 +426,6 @@ open class SoraStream : TmdbProvider() { callback ) }, - { - invokeSeries9( - res.title, - res.year, - res.season, - res.episode, - subtitleCallback, - callback - ) - }, { invokeIdlix( res.title, @@ -528,7 +518,7 @@ open class SoraStream : TmdbProvider() { ) }, { - if(!res.isAnime) invokeM4uhd( + if (!res.isAnime) invokeM4uhd( res.title, res.airedYear ?: res.year, res.season, @@ -723,7 +713,7 @@ open class SoraStream : TmdbProvider() { ) }, { - if(res.isAsian) invokeDramaday( + if (res.isAsian) invokeDramaday( res.title, res.year, res.season, @@ -733,13 +723,13 @@ open class SoraStream : TmdbProvider() { ) }, { - if(!res.isAnime) invoke2embed(res.imdbId,res.season,res.episode,callback) + if (!res.isAnime) invoke2embed(res.imdbId, res.season, res.episode, callback) }, // { // invokeSusflix(res.id,res.season,res.episode,subtitleCallback,callback) // }, { - if(!res.isAnime) invokeJump1( + if (!res.isAnime) invokeJump1( res.id, res.tvdbId, res.title, @@ -749,6 +739,12 @@ open class SoraStream : TmdbProvider() { callback ) }, + { + if (!res.isAnime && res.season == null) invokeOmega( + res.id, + callback + ) + }, ) return true diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt index abe0c861..d0f9146e 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt @@ -22,7 +22,6 @@ import com.hexated.SoraExtractor.invokeNinetv import com.hexated.SoraExtractor.invokeNowTv import com.hexated.SoraExtractor.invokeRStream import com.hexated.SoraExtractor.invokeRidomovies -import com.hexated.SoraExtractor.invokeSeries9 import com.hexated.SoraExtractor.invokeSmashyStream import com.hexated.SoraExtractor.invokeDumpStream import com.hexated.SoraExtractor.invokeEmovies @@ -31,6 +30,7 @@ import com.hexated.SoraExtractor.invokeJump1 import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeNetmovies +import com.hexated.SoraExtractor.invokeOmega import com.hexated.SoraExtractor.invokePrimewire import com.hexated.SoraExtractor.invokeVidSrc import com.hexated.SoraExtractor.invokeVidsrcto @@ -134,16 +134,6 @@ class SoraStreamLite : SoraStream() { callback ) }, - { - invokeSeries9( - res.title, - res.year, - res.season, - res.episode, - subtitleCallback, - callback - ) - }, { invokeIdlix( res.title, @@ -245,6 +235,12 @@ class SoraStreamLite : SoraStream() { callback ) }, + { + if (!res.isAnime && res.season == null) invokeOmega( + res.id, + callback + ) + }, { invokeRStream(res.id, res.season, res.episode, callback) },