Skip to content

Commit

Permalink
fixed #382, fixed #384
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjohn committed Nov 17, 2023
1 parent 8396000 commit d33a7aa
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion SoraStream/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties

// use an integer for version numbers
version = 194
version = 195

android {
defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions SoraStream/src/main/kotlin/com/hexated/SoraParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions SoraStream/src/main/kotlin/com/hexated/SoraStream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ open class SoraStream : TmdbProvider() {
"$tmdbAPI/movie/popular?api_key=$apiKey&region=US" to "Popular Movies",
"$tmdbAPI/tv/popular?api_key=$apiKey&region=US&with_original_language=en" to "Popular TV Shows",
"$tmdbAPI/tv/airing_today?api_key=$apiKey&region=US&with_original_language=en" to "Airing Today TV Shows",
// "$tmdbAPI/tv/on_the_air?api_key=$apiKey&region=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+",
Expand All @@ -155,8 +154,8 @@ open class SoraStream : TmdbProvider() {
"$tmdbAPI/tv/top_rated?api_key=$apiKey&region=US" to "Top Rated TV Shows",
"$tmdbAPI/movie/upcoming?api_key=$apiKey&region=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",
)
Expand Down Expand Up @@ -661,9 +660,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
// {
// if (!res.isAnime) invokeWatchflx(res.id, res.season, res.episode, callback)
// },
{
invokeZshow(
res.title,
Expand Down
8 changes: 0 additions & 8 deletions SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 15 additions & 0 deletions SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<String>, item: Int): List<String> {
Expand Down

0 comments on commit d33a7aa

Please sign in to comment.