From 1d420814bda9cecb05c13df604e41d2259068ef7 Mon Sep 17 00:00:00 2001 From: hexated Date: Sat, 15 Apr 2023 21:53:51 +0700 Subject: [PATCH] sora: added new sources --- SoraStream/build.gradle.kts | 2 +- .../main/kotlin/com/hexated/SoraExtractor.kt | 39 +++++++++++++++++++ .../src/main/kotlin/com/hexated/SoraStream.kt | 8 ++++ .../src/main/kotlin/com/hexated/SoraUtils.kt | 2 +- 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index 9f3be0b6..787ec88c 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 117 +version = 118 cloudstream { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index fd5d0e8e..c8255dea 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -2965,8 +2965,29 @@ object SoraExtractor : SoraStream() { ) } } + } + suspend fun invokeCryMovies( + imdbId: String? = null, + callback: (ExtractorLink) -> Unit + ) { + app.get("$cryMoviesAPI/stream/movie/$imdbId.json").parsedSafe()?.streams?.map { stream -> + val quality = getIndexQuality(stream.title) + val tags = getIndexQualityTags(stream.title) + val size = stream.title?.substringAfter("\uD83D\uDCBE")?.trim() + val headers = stream.behaviorHints?.proxyHeaders?.request ?: mapOf() + callback.invoke( + ExtractorLink( + "CryMovies", + "CryMovies $tags [${size}]", + stream.url ?: return@map, + "", + quality, + headers = headers + ) + ) + } } @@ -3453,4 +3474,22 @@ data class ShivamhwSources( @JsonProperty("stream_link") val stream_link: String? = null, @JsonProperty("name") val name: String? = null, @JsonProperty("size") val size: String? = null, +) + +data class CryMoviesProxyHeaders( + @JsonProperty("request") val request: Map?, +) + +data class CryMoviesBehaviorHints( + @JsonProperty("proxyHeaders") val proxyHeaders: CryMoviesProxyHeaders?, +) + +data class CryMoviesStream( + @JsonProperty("title") val title: String? = null, + @JsonProperty("url") val url: String? = null, + @JsonProperty("behaviorHints") val behaviorHints: CryMoviesBehaviorHints? = null, +) + +data class CryMoviesResponse( + @JsonProperty("streams") val streams: List? = null, ) \ No newline at end of file diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 02e1832f..70dff40f 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -8,6 +8,7 @@ import com.hexated.SoraExtractor.invokeBlackmovies import com.hexated.SoraExtractor.invokeBollyMaza import com.hexated.SoraExtractor.invokeCodexmovies import com.hexated.SoraExtractor.invokeCrunchyroll +import com.hexated.SoraExtractor.invokeCryMovies import com.hexated.SoraExtractor.invokeDbgo import com.hexated.SoraExtractor.invokeFilmxy import com.hexated.SoraExtractor.invokeHDMovieBox @@ -146,6 +147,7 @@ open class SoraStream : TmdbProvider() { const val shinobiMovieAPI = "https://home.shinobicloud.cf/0:" const val vitoenMovieAPI = "https://openmatte.vitoencodes.workers.dev/0:" const val shivamhwAPI = "https://foogle.shivamhw.me" + val cryMoviesAPI = base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=") fun getType(t: String?): TvType { return when (t) { @@ -818,6 +820,12 @@ open class SoraStream : TmdbProvider() { res.episode, callback ) + }, + { + if(!res.isAnime && res.season == null) invokeCryMovies( + res.imdbId, + callback + ) } ) diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index 3cb80664..5d04c2db 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -1035,7 +1035,7 @@ fun String.getFileSize() : Float? { } fun getIndexQualityTags(str: String?): String { - return Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4|avi)").find(str ?: "")?.groupValues?.getOrNull(1) + return Regex("(?i)\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4|avi)").find(str ?: "")?.groupValues?.getOrNull(1) ?.replace(".", " ")?.trim() ?: str ?: "" }