[Sora] experiment index site

This commit is contained in:
hexated 2023-02-02 00:27:45 +07:00
parent 23662597e5
commit 315b6b3cdb
4 changed files with 33 additions and 23 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 80 version = 81
cloudstream { cloudstream {

View file

@ -2101,9 +2101,7 @@ object SoraExtractor : SoraStream() {
val encryptedExpiry = base64Encode(CryptoAES.encrypt(key, expiry).toByteArray()) val encryptedExpiry = base64Encode(CryptoAES.encrypt(key, expiry).toByteArray())
val worker = getConfig().workers.randomOrNull() ?: return@apmap null val worker = getConfig().workers.randomOrNull() ?: return@apmap null
val link = val link = "https://api.$worker.workers.dev/download.aspx?file=$encryptedId&expiry=$encryptedExpiry&mac=$hmacSign"
"https://api.$worker.workers.dev/download.aspx?file=$encryptedId&expiry=$encryptedExpiry&mac=$hmacSign"
if(!app.get(link).isSuccessful) return@apmap null
val size = file.size?.toDouble() ?: return@apmap null val size = file.size?.toDouble() ?: return@apmap null
val sizeFile = "%.2f GB".format(bytesToGigaBytes(size)) val sizeFile = "%.2f GB".format(bytesToGigaBytes(size))
val tags = Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4)").find( val tags = Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4)").find(
@ -2230,7 +2228,6 @@ object SoraExtractor : SoraStream() {
}).text.let { }).text.let {
fixUrl(it, apiUrl) fixUrl(it, apiUrl)
}.encodeUrl() }.encodeUrl()
if (!app.get(path).isSuccessful) return@apmap null
val size = file.size?.toDouble() ?: return@apmap null val size = file.size?.toDouble() ?: return@apmap null
val sizeFile = "%.2f GB".format(bytesToGigaBytes(size)) val sizeFile = "%.2f GB".format(bytesToGigaBytes(size))
val quality = val quality =

View file

@ -48,10 +48,9 @@ import kotlin.math.roundToInt
open class SoraStream : TmdbProvider() { open class SoraStream : TmdbProvider() {
override var name = "SoraStream" override var name = "SoraStream"
override val hasMainPage = true override val hasMainPage = true
override val hasDownloadSupport = true
override val instantLinkLoading = true override val instantLinkLoading = true
override val useMetaLoadResponse = true override val useMetaLoadResponse = true
override val hasChromecastSupport = true override val hasQuickSearch = true
override val supportedTypes = setOf( override val supportedTypes = setOf(
TvType.Movie, TvType.Movie,
TvType.TvSeries, TvType.TvSeries,
@ -61,19 +60,23 @@ open class SoraStream : TmdbProvider() {
/** AUTHOR : Hexated & Sora */ /** AUTHOR : Hexated & Sora */
companion object { companion object {
private const val tmdbAPI = "https://api.themoviedb.org/3" private const val tmdbAPI = "https://api.themoviedb.org/3"
private val apiKey =
base64DecodeAPI("ZTM=NTg=MjM=MjM=ODc=MzI=OGQ=MmE=Nzk=Nzk=ZjI=NTA=NDY=NDA=MzA=YjA=") // PLEASE DON'T STEAL
const val tmdb2mal = "https://tmdb2mal.slidemovies.org" const val tmdb2mal = "https://tmdb2mal.slidemovies.org"
const val jikanAPI = "https://api.jikan.moe/v4" const val jikanAPI = "https://api.jikan.moe/v4"
const val gdbot = "https://gdbot.xyz" const val gdbot = "https://gdbot.xyz"
const val consumetAnilistAPI = "https://api.consumet.org/meta/anilist" const val consumetAnilistAPI = "https://api.consumet.org/meta/anilist"
const val kamyrollAPI = "https://api.kamyroll.tech" const val kamyrollAPI = "https://api.kamyroll.tech"
var baymovies = "https://opengatewayindex.pages.dev"
private val mainAPI = base64DecodeAPI("cHA=LmE=ZWw=cmM=dmU=aC4=dGM=d2E=eHA=Ly8=czo=dHA=aHQ=") private val apiKey =
var baymovies = base64DecodeAPI("Zw==b3I=dS4=LmU=ZXg=bmQ=emk=aS4=YXA=dXA=cm8=Y2c=bGk=dWI=eHA=ZGU=aW4=YXk=ZWI=dGg=Ly8=czo=dHA=aHQ=") base64DecodeAPI("ZTM=NTg=MjM=MjM=ODc=MzI=OGQ=MmE=Nzk=Nzk=ZjI=NTA=NDY=NDA=MzA=YjA=") // PLEASE DON'T STEAL
// private var mainServerAPI = base64DecodeAPI("cA==YXA=bC4=Y2U=ZXI=LnY=aWU=b3Y=LW0=cmE=c28=Ly8=czo=dHA=aHQ=") // private val mainAPI =
var netMoviesAPI = base64DecodeAPI("aQ==YXA=cC8=YXA=bC4=Y2U=ZXI=LnY=bG0=Zmk=dC0=bmU=Ly8=czo=dHA=aHQ=") // base64DecodeAPI("cHA=LmE=ZWw=cmM=dmU=aC4=dGM=d2E=eHA=Ly8=czo=dHA=aHQ=")
// private var mainServerAPI =
// base64DecodeAPI("cA==YXA=bC4=Y2U=ZXI=LnY=aWU=b3Y=LW0=cmE=c28=Ly8=czo=dHA=aHQ=")
var netMoviesAPI =
base64DecodeAPI("aQ==YXA=cC8=YXA=bC4=Y2U=ZXI=LnY=bG0=Zmk=dC0=bmU=Ly8=czo=dHA=aHQ=")
// ALL SOURCES
const val twoEmbedAPI = "https://www.2embed.to" const val twoEmbedAPI = "https://www.2embed.to"
const val vidSrcAPI = "https://v2.vidsrc.me" const val vidSrcAPI = "https://v2.vidsrc.me"
const val dbgoAPI = "https://dbgo.fun" const val dbgoAPI = "https://dbgo.fun"
@ -137,8 +140,8 @@ open class SoraStream : TmdbProvider() {
"$tmdbAPI/trending/all/day?api_key=$apiKey&region=US" to "Trending", "$tmdbAPI/trending/all/day?api_key=$apiKey&region=US" to "Trending",
"$tmdbAPI/movie/popular?api_key=$apiKey&region=US" to "Popular Movies", "$tmdbAPI/movie/popular?api_key=$apiKey&region=US" to "Popular Movies",
"$tmdbAPI/tv/popular?api_key=$apiKey&region=US" to "Popular TV Shows", "$tmdbAPI/tv/popular?api_key=$apiKey&region=US" to "Popular TV Shows",
// "$tmdbAPI/tv/airing_today?api_key=$apiKey&region=" to "Airing Today TV Shows", "$tmdbAPI/tv/airing_today?api_key=$apiKey&region=US" to "Airing Today TV Shows",
"$tmdbAPI/tv/on_the_air?api_key=$apiKey&region=US" to "On The Air 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=213" to "Netflix",
"$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=1024" to "Amazon", "$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=1024" to "Amazon",
"$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=2739" to "Disney+", "$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=2739" to "Disney+",
@ -190,10 +193,11 @@ open class SoraStream : TmdbProvider() {
} }
} }
override suspend fun quickSearch(query: String): List<SearchResponse>? = search(query)
override suspend fun search(query: String): List<SearchResponse>? { override suspend fun search(query: String): List<SearchResponse>? {
return app.get( return app.get(
"$tmdbAPI/search/multi?api_key=$apiKey&language=en-US&query=$query&page=1&include_adult=${settingsForProvider.enableAdult}", "$tmdbAPI/search/multi?api_key=$apiKey&language=en-US&query=$query&page=1&include_adult=${settingsForProvider.enableAdult}"
referer = "$mainAPI/"
).parsedSafe<Results>()?.results?.mapNotNull { media -> ).parsedSafe<Results>()?.results?.mapNotNull { media ->
media.toSearchResponse() media.toSearchResponse()
} }
@ -217,7 +221,8 @@ open class SoraStream : TmdbProvider() {
val year = (res.releaseDate ?: res.firstAirDate)?.split("-")?.first()?.toIntOrNull() val year = (res.releaseDate ?: res.firstAirDate)?.split("-")?.first()?.toIntOrNull()
val rating = res.vote_average.toString().toRatingInt() val rating = res.vote_average.toString().toRatingInt()
val genres = res.genres?.mapNotNull { it.name } 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 keywords = res.keywords?.results?.mapNotNull { it.name }.orEmpty() val keywords = res.keywords?.results?.mapNotNull { it.name }.orEmpty()
.ifEmpty { res.keywords?.keywords?.mapNotNull { it.name } } .ifEmpty { res.keywords?.keywords?.mapNotNull { it.name } }
@ -367,7 +372,16 @@ open class SoraStream : TmdbProvider() {
// ) // )
// }, // },
{ {
if (res.isAnime) invokeAnimes(res.id, res.title, res.epsTitle, res.year, res.season, res.episode, subtitleCallback, callback) if (res.isAnime) invokeAnimes(
res.id,
res.title,
res.epsTitle,
res.year,
res.season,
res.episode,
subtitleCallback,
callback
)
}, },
{ {
if (res.season != null && res.isAnime) invokeCrunchyroll( if (res.season != null && res.isAnime) invokeCrunchyroll(

View file

@ -648,9 +648,8 @@ fun searchIndex(
} else { } else {
media.name?.contains(Regex("(?i)S${seasonSlug}.?E${episodeSlug}")) == true media.name?.contains(Regex("(?i)S${seasonSlug}.?E${episodeSlug}")) == true
}) && media.name?.contains( }) && media.name?.contains(
"720p", Regex("(?i)(2160p|1080p)")
true ) == true && (media.mimeType in mimeType) && (media.name.replace(
) == false && (media.mimeType in mimeType) && (media.name.replace(
"-", "-",
"." "."
).contains( ).contains(