diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index 3849e5a00..2c4fa5aa0 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 = 194 +version = 195 android { defaultConfig { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 8fc75df57..07357b12b 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -2445,7 +2445,7 @@ object SoraExtractor : SoraStream() { ExtractorLink( "SFMovies", "SFMovies", - fixUrl(video, "https://watchfree.blob.core.windows.net/watchfree"), + fixUrl(video, base64DecodeAPI("YQ==bm4=dGE=YXQ=L3I=ZXQ=Lm4=d3M=ZG8=aW4=Lnc=cmU=Y28=Yi4=bG8=LmI=bmE=YW4=dHQ=cmE=Ly8=czo=dHA=aHQ=")), "", Qualities.P1080.value, INFER_TYPE diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt index 27095a677..fee8e3b90 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt @@ -14,6 +14,11 @@ data class AniIds( var idMal: Int? = null ) +data class TmdbDate( + val today: String, + val nextWeek: String, +) + data class AniMedia( @JsonProperty("id") var id: Int? = null, @JsonProperty("idMal") var idMal: Int? = null diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 03bf74362..2eef7b54f 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -142,7 +142,6 @@ open class SoraStream : TmdbProvider() { "$tmdbAPI/movie/popular?api_key=$apiKey®ion=US" to "Popular Movies", "$tmdbAPI/tv/popular?api_key=$apiKey®ion=US&with_original_language=en" to "Popular TV Shows", "$tmdbAPI/tv/airing_today?api_key=$apiKey®ion=US&with_original_language=en" to "Airing Today TV Shows", -// "$tmdbAPI/tv/on_the_air?api_key=$apiKey®ion=US" to "On The Air TV Shows", "$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=213" to "Netflix", "$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=1024" to "Amazon", "$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=2739" to "Disney+", @@ -155,8 +154,8 @@ open class SoraStream : TmdbProvider() { "$tmdbAPI/tv/top_rated?api_key=$apiKey®ion=US" to "Top Rated TV Shows", "$tmdbAPI/movie/upcoming?api_key=$apiKey®ion=US" to "Upcoming Movies", "$tmdbAPI/discover/tv?api_key=$apiKey&with_original_language=ko" to "Korean Shows", - "$tmdbAPI/tv/airing_today?api_key=$apiKey&with_keywords=210024|222243&sort_by=primary_release_date.desc" to "Airing Today Anime", - "$tmdbAPI/tv/on_the_air?api_key=$apiKey&with_keywords=210024|222243&sort_by=primary_release_date.desc" to "Ongoing Anime", + "$tmdbAPI/discover/tv?api_key=$apiKey&with_keywords=210024|222243&sort_by=popularity.desc&air_date.lte=${getDate().today}&air_date.gte=${getDate().today}" to "Airing Today Anime", + "$tmdbAPI/discover/tv?api_key=$apiKey&with_keywords=210024|222243&sort_by=popularity.desc&air_date.lte=${getDate().nextWeek}&air_date.gte=${getDate().today}" to "On The Air Anime", "$tmdbAPI/discover/tv?api_key=$apiKey&with_keywords=210024|222243" to "Anime", "$tmdbAPI/discover/movie?api_key=$apiKey&with_keywords=210024|222243" to "Anime Movies", ) @@ -661,9 +660,6 @@ open class SoraStream : TmdbProvider() { callback ) }, -// { -// if (!res.isAnime) invokeWatchflx(res.id, res.season, res.episode, callback) -// }, { invokeZshow( res.title, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt index 5a3cb447a..ecc42e582 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt @@ -264,14 +264,6 @@ class SoraStreamLite : SoraStream() { callback ) }, -// { -// if (!res.isAnime) invokeWatchflx( -// res.id, -// res.season, -// res.episode, -// callback -// ) -// }, { if(!res.isAnime) invoke2embed( res.imdbId, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index 37141d0ff..9a95bd776 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -34,6 +34,8 @@ import java.security.* import java.security.spec.PKCS8EncodedKeySpec import java.security.spec.X509EncodedKeySpec import java.text.SimpleDateFormat +import java.time.LocalDate +import java.time.format.DateTimeFormatter import java.util.* import javax.crypto.Cipher import javax.crypto.spec.GCMParameterSpec @@ -1279,10 +1281,23 @@ fun isUpcoming(dateString: String?): Boolean { } } +fun getDate() : TmdbDate { + val formatter = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) + val calender = Calendar.getInstance() + val today = formatter.format(calender.time) + calender.add(Calendar.WEEK_OF_YEAR, 1) + val nextWeek = formatter.format(calender.time) + return TmdbDate(today, nextWeek) +} + fun decode(input: String): String = URLDecoder.decode(input, "utf-8") fun encode(input: String): String = URLEncoder.encode(input, "utf-8").replace("+", "%20") +fun base64DecodeAPI(api: String): String { + return api.chunked(4).map { base64Decode(it) }.reversed().joinToString("") +} + fun decryptStreamUrl(data: String): String { fun getTrash(arr: List, item: Int): List {