mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
[Sora] experiment index site
This commit is contained in:
parent
23662597e5
commit
315b6b3cdb
4 changed files with 33 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 80
|
version = 81
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -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 =
|
||||||
|
|
|
@ -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®ion=US" to "Trending",
|
"$tmdbAPI/trending/all/day?api_key=$apiKey®ion=US" to "Trending",
|
||||||
"$tmdbAPI/movie/popular?api_key=$apiKey®ion=US" to "Popular Movies",
|
"$tmdbAPI/movie/popular?api_key=$apiKey®ion=US" to "Popular Movies",
|
||||||
"$tmdbAPI/tv/popular?api_key=$apiKey®ion=US" to "Popular TV Shows",
|
"$tmdbAPI/tv/popular?api_key=$apiKey®ion=US" to "Popular TV Shows",
|
||||||
// "$tmdbAPI/tv/airing_today?api_key=$apiKey®ion=" to "Airing Today TV Shows",
|
"$tmdbAPI/tv/airing_today?api_key=$apiKey®ion=US" to "Airing Today TV Shows",
|
||||||
"$tmdbAPI/tv/on_the_air?api_key=$apiKey®ion=US" to "On The Air 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=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(
|
||||||
|
@ -538,7 +552,7 @@ open class SoraStream : TmdbProvider() {
|
||||||
invokeSmashyStream(res.id, res.season, res.episode, subtitleCallback, callback)
|
invokeSmashyStream(res.id, res.season, res.episode, subtitleCallback, callback)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
if(!res.isAnime) invokeBaymovies(
|
if (!res.isAnime) invokeBaymovies(
|
||||||
res.title,
|
res.title,
|
||||||
res.year,
|
res.year,
|
||||||
res.season,
|
res.season,
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue