small clean

This commit is contained in:
hexated 2023-02-26 19:40:53 +07:00
parent 2564094d6a
commit b980ed0678
2 changed files with 8 additions and 3 deletions

View File

@ -119,7 +119,7 @@ open class SoraStream : TmdbProvider() {
const val movie123NetAPI = "https://ww7.0123movie.net" const val movie123NetAPI = "https://ww7.0123movie.net"
const val smashyStreamAPI = "https://embed.smashystream.com" const val smashyStreamAPI = "https://embed.smashystream.com"
const val watchSomuchAPI = "https://watchsomuch.tv" // sub only const val watchSomuchAPI = "https://watchsomuch.tv" // sub only
const val gomoviesAPI = "https://gomovies-online.com" val gomoviesAPI = base64DecodeAPI("bQ==Y28=ZS4=aW4=bmw=LW8=ZXM=dmk=bW8=Z28=Ly8=czo=dHA=aHQ=")
const val baymoviesAPI = "https://opengatewayindex.pages.dev" // dead const val baymoviesAPI = "https://opengatewayindex.pages.dev" // dead
const val chillmovies0API = "https://chill.aicirou.workers.dev/0:" // dead const val chillmovies0API = "https://chill.aicirou.workers.dev/0:" // dead
const val chillmovies1API = "https://chill.aicirou.workers.dev/1:" // dead const val chillmovies1API = "https://chill.aicirou.workers.dev/1:" // dead

View File

@ -485,7 +485,7 @@ suspend fun getSoraIdAndType(title: String?, year: Int?, season: Int?) : Pair<St
) && (it.second == year || it.first.contains("Season $season", true)) ) && (it.second == year || it.first.contains("Season $season", true))
} }
else -> { else -> {
(it.first.contains(Regex("(?i)$title\\s?($season|${season.toRomanNumeral()}|Season\\s$season)")) || it.first.equals(title, true)) && it.second == year it.first.contains(Regex("(?i)$title\\s?($season|${season.toRomanNumeral()}|Season\\s$season)")) && it.second == year
} }
} }
} }
@ -534,7 +534,7 @@ suspend fun invokeSapphire(
res?.subtitles?.map { sub -> res?.subtitles?.map { sub ->
subtitleCallback.invoke( subtitleCallback.invoke(
SubtitleFile( SubtitleFile(
getLanguage(sub.language ?: return@map null), getKaaLanguage(sub.language ?: return@map null) ?: sub.language,
sub.url ?: return@map null sub.url ?: return@map null
) )
) )
@ -968,6 +968,11 @@ fun getDbgoLanguage(str: String): String {
} }
} }
fun getKaaLanguage(language: String?): String? {
return SubtitleHelper.fromTwoLettersToLanguage(language ?: return null)
?: SubtitleHelper.fromTwoLettersToLanguage(language.substringBefore("-"))
}
fun getDeviceId(length: Int = 16): String { fun getDeviceId(length: Int = 16): String {
val allowedChars = ('a'..'f') + ('0'..'9') val allowedChars = ('a'..'f') + ('0'..'9')
return (1..length) return (1..length)