sora: removed gamMovies and try adding edithxMovies[test]

This commit is contained in:
hexated 2023-02-07 23:45:21 +07:00
parent 603889c3d6
commit 2a09b5daf9
4 changed files with 75 additions and 25 deletions

View File

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

View File

@ -2180,6 +2180,28 @@ object SoraExtractor : SoraStream() {
) )
} }
suspend fun invokeEdithxmovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
password: String? = null,
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
password,
)
}
private suspend fun invokeIndex( private suspend fun invokeIndex(
apiUrl: String, apiUrl: String,
api: String, api: String,
@ -2196,17 +2218,25 @@ object SoraExtractor : SoraStream() {
"Blackmovies", "Blackmovies",
"CodexMovies", "CodexMovies",
"Rinzrymovies", "Rinzrymovies",
"Edithxmovies",
) )
val lockedIndex = arrayOf( val lockedIndex = arrayOf(
"CodexMovies" "CodexMovies",
"Edithxmovies",
)
val premiumIndex = arrayOf(
"Edithxmovies"
) )
val passHeaders = mapOf( val passHeaders = mapOf(
"Authorization" to password "Authorization" to password
) )
val query = getIndexQuery(title, year, season, episode) val query = getIndexQuery(title, year, season, episode).let {
if(api in premiumIndex) "$it mkv" else it
}
val body = val body =
"""{"q":"$query","password":null,"page_token":null,"page_index":0}""".toRequestBody( """{"q":"$query","password":null,"page_token":null,"page_index":0}""".toRequestBody(
RequestBodyTypes.JSON.toMediaTypeOrNull() RequestBodyTypes.JSON.toMediaTypeOrNull()
@ -2227,8 +2257,8 @@ object SoraExtractor : SoraStream() {
} else { } else {
app.post("${apiUrl}search", requestBody = body).text app.post("${apiUrl}search", requestBody = body).text
} }
val media = searchIndex(title, season, episode, year, search) ?: return val media = if(api in premiumIndex) searchIndex(title, season, episode, year, search, false) else searchIndex(title, season, episode, year, search)
media.apmap { file -> media?.apmap { file ->
val pathBody = """{"id":"${file.id ?: return@apmap null}"}""".toRequestBody( val pathBody = """{"id":"${file.id ?: return@apmap null}"}""".toRequestBody(
RequestBodyTypes.JSON.toMediaTypeOrNull() RequestBodyTypes.JSON.toMediaTypeOrNull()
) )
@ -2263,7 +2293,9 @@ object SoraExtractor : SoraStream() {
} }
}.encodeUrl() }.encodeUrl()
if (!app.get(path).isSuccessful) return@apmap null // removed due to rate limit
// 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

@ -23,11 +23,11 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.metaproviders.TmdbProvider import com.lagradost.cloudstream3.metaproviders.TmdbProvider
import com.hexated.SoraExtractor.invokeCrunchyroll import com.hexated.SoraExtractor.invokeCrunchyroll
import com.hexated.SoraExtractor.invokeEdithxmovies
import com.hexated.SoraExtractor.invokeFDMovies import com.hexated.SoraExtractor.invokeFDMovies
import com.hexated.SoraExtractor.invokeFlixon import com.hexated.SoraExtractor.invokeFlixon
import com.hexated.SoraExtractor.invokeFwatayako import com.hexated.SoraExtractor.invokeFwatayako
import com.hexated.SoraExtractor.invokeGMovies import com.hexated.SoraExtractor.invokeGMovies
import com.hexated.SoraExtractor.invokeGammovies
import com.hexated.SoraExtractor.invokeJsmovies import com.hexated.SoraExtractor.invokeJsmovies
import com.hexated.SoraExtractor.invokeKisskh import com.hexated.SoraExtractor.invokeKisskh
import com.hexated.SoraExtractor.invokeLing import com.hexated.SoraExtractor.invokeLing
@ -114,11 +114,12 @@ open class SoraStream : TmdbProvider() {
const val baymoviesAPI = "https://thebayindexpublicgroupapi.zindex.eu.org" // dead const val baymoviesAPI = "https://thebayindexpublicgroupapi.zindex.eu.org" // 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
const val gamMoviesAPI = "https://drive.gamick.workers.dev/0:" const val gamMoviesAPI = "https://drive.gamick.workers.dev/0:" // dead
const val jsMoviesAPI = "https://jsupload.jnsbot.workers.dev/0:" const val jsMoviesAPI = "https://jsupload.jnsbot.workers.dev/0:"
const val blackMoviesAPI = "https://dl.blacklistedbois.workers.dev/0:" const val blackMoviesAPI = "https://dl.blacklistedbois.workers.dev/0:"
const val rinzryMoviesAPI = "https://rinzry.stream/0:" const val rinzryMoviesAPI = "https://rinzry.stream/0:"
const val codexMoviesAPI = "https://packs.codexcloudx.tech/0:" const val codexMoviesAPI = "https://packs.codexcloudx.tech/0:"
const val edithxMoviesAPI = "https://index.edithx.ga/0:"
fun getType(t: String?): TvType { fun getType(t: String?): TvType {
return when (t) { return when (t) {
@ -587,17 +588,17 @@ open class SoraStream : TmdbProvider() {
// callback // callback
// ) // )
// }, // },
{ // {
if (!res.isAnime) invokeGammovies( // if (!res.isAnime) invokeGammovies(
gamMoviesAPI, // gamMoviesAPI,
"Gammovies", // "Gammovies",
res.title, // res.title,
res.year, // res.year,
res.season, // res.season,
res.episode, // res.episode,
callback // callback
) // )
}, // },
{ {
invokeWatchsomuch( invokeWatchsomuch(
res.imdbId, res.imdbId,
@ -650,6 +651,18 @@ open class SoraStream : TmdbProvider() {
callback, callback,
"Basic Y29kZXg6Y29kZXhjbG91ZA==" "Basic Y29kZXg6Y29kZXhjbG91ZA=="
) )
},
{
if (!res.isAnime) invokeEdithxmovies(
edithxMoviesAPI,
"Edithxmovies",
res.title,
res.year,
res.season,
res.episode,
callback,
"Basic ZWRpdGg6amFydmlz"
)
} }
) )

View File

@ -547,7 +547,8 @@ fun searchIndex(
season: Int? = null, season: Int? = null,
episode: Int? = null, episode: Int? = null,
year: Int? = null, year: Int? = null,
response: String response: String,
isTrimmed: Boolean = true,
): List<IndexMedia>? { ): List<IndexMedia>? {
val (dotSlug, spaceSlug) = getTitleSlug(title) val (dotSlug, spaceSlug) = getTitleSlug(title)
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode) val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
@ -575,11 +576,15 @@ fun searchIndex(
).contains("$spaceSlug", true)) ).contains("$spaceSlug", true))
}?.distinctBy { it.name }?.sortedByDescending { it.size?.toLongOrNull() ?: 0 } ?: return null }?.distinctBy { it.name }?.sortedByDescending { it.size?.toLongOrNull() ?: 0 } ?: return null
return files.let { file -> return if (isTrimmed) {
listOfNotNull( files.let { file ->
file.find { it.name?.contains("2160p", true) == true }, listOfNotNull(
file.find { it.name?.contains("1080p", true) == true } file.find { it.name?.contains("2160p", true) == true },
) file.find { it.name?.contains("1080p", true) == true }
)
}
} else {
files
} }
} }