sora: clean code & remove unworking sources

This commit is contained in:
sora 2023-08-09 04:11:50 +07:00
parent 5aa6051209
commit a7b06dc326
4 changed files with 13 additions and 546 deletions

View file

@ -1,7 +1,7 @@
import org.jetbrains.kotlin.konan.properties.Properties
// use an integer for version numbers
version = 154
version = 155
android {
defaultConfig {

View file

@ -507,70 +507,6 @@ object SoraExtractor : SoraStream() {
}
}
suspend fun invokeUniqueStream(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title.createSlug()
val url = if (season == null) {
"$uniqueStreamAPI/movies/$fixTitle-$year"
} else {
"$uniqueStreamAPI/episodes/$fixTitle-season-$season-episode-$episode"
}
val res = app.get(url)
if (!res.isSuccessful) return
val baseApi = getBaseUrl(res.url)
val document = res.document
val type = if (url.contains("/movies/")) "movie" else "tv"
document.select("ul#playeroptionsul > li").apmap { el ->
val id = el.attr("data-post")
val nume = el.attr("data-nume")
val source = app.post(
url = "$baseApi/wp-admin/admin-ajax.php", data = mapOf(
"action" to "doo_player_ajax", "post" to id, "nume" to nume, "type" to type
), headers = mapOf("X-Requested-With" to "XMLHttpRequest"), referer = url
).parsed<ResponseHash>().embed_url.let { fixUrl(it) }
when {
source.contains("uniquestream") -> {
val resDoc = app.get(
source, referer = "$baseApi/", headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
)
).document
val srcm3u8 =
resDoc.selectFirst("script:containsData(let url =)")?.data()?.let {
Regex("['|\"](.*?.m3u8)['|\"]").find(it)?.groupValues?.getOrNull(1)
}
callback.invoke(
ExtractorLink(
"UniqueStream",
"UniqueStream",
srcm3u8 ?: return@apmap null,
source,
Qualities.P1080.value,
true,
)
)
}
!source.contains("youtube") -> loadExtractor(
source, "$uniqueStreamAPI/", subtitleCallback, callback
)
else -> {
// pass
}
}
}
}
suspend fun invokeNoverse(
title: String? = null,
season: Int? = null,
@ -765,59 +701,6 @@ object SoraExtractor : SoraStream() {
}
}
suspend fun invokeXmovies(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val fixTitle = title.createSlug()
val doc = if (season == null) {
val res = app.get("$xMovieAPI/movies/$fixTitle/watch")
if (res.url == "$xMovieAPI/") app.get("$xMovieAPI/movies/$fixTitle-$year/watch").document else res.document
} else {
app.get("$xMovieAPI/series/$fixTitle-season-$season-episode-$episode/watch").document
}
val script = doc.selectFirst("script:containsData(const player =)")?.data() ?: return
val link =
Regex("[\"|']file[\"|']:\\s?[\"|'](http.*?.(mp4|m3u8))[\"|'],").find(script)?.groupValues?.getOrNull(
1
) ?: return
if (link.contains(".m3u8")) {
M3u8Helper.generateM3u8(
"Xmovie",
link,
"",
).forEach(callback)
} else {
callback.invoke(
ExtractorLink(
"Xmovie",
"Xmovie",
link,
"",
Qualities.P720.value,
)
)
}
Regex(""""file":\s+?"(\S+\.(vtt|srt))""").find(script)?.groupValues?.getOrNull(1)
?.let { sub ->
subtitleCallback.invoke(
SubtitleFile(
"English",
sub,
)
)
}
}
suspend fun invokeFmovies(
title: String? = null,
year: Int? = null,
@ -2035,110 +1918,6 @@ object SoraExtractor : SoraStream() {
}
suspend fun invokeBlackmovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
)
}
suspend fun invokeCodexmovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
password: String = "",
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
password,
)
}
suspend fun invokeEdithxmovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
password: String = "",
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
password,
)
}
suspend fun invokeJmdkhMovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
)
}
suspend fun invokeRubyMovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
)
}
suspend fun invokeShinobiMovies(
apiUrl: String,
api: String,
@ -2159,26 +1938,6 @@ object SoraExtractor : SoraStream() {
)
}
suspend fun invokeVitoenMovies(
apiUrl: String,
api: String,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
invokeIndex(
apiUrl,
api,
title,
year,
season,
episode,
callback,
)
}
private suspend fun invokeIndex(
apiUrl: String,
api: String,
@ -2265,9 +2024,6 @@ object SoraExtractor : SoraStream() {
}
}.encodeUrl()
// removed due to rate limit
// if (!app.get(path).isSuccessful) return@apmap null
val size =
"%.2f GB".format(bytesToGigaBytes(file.size?.toDouble() ?: return@apmap null))
val quality = getIndexQuality(file.name)
@ -2287,48 +2043,6 @@ object SoraExtractor : SoraStream() {
}
suspend fun invokeTgarMovies(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val query = getIndexQuery(title, year, season, episode)
val files = app.get(
"https://api.tgarchive.superfastsearch.zindex.eu.org/search?name=${encode(query)}&page=1",
referer = tgarMovieAPI,
timeout = 600L
).parsedSafe<TgarData>()?.documents?.filter { media ->
matchingIndex(
media.name,
media.mime_type,
title,
year,
season,
episode,
true
) && media.name?.contains("XXX") == false
}
files?.map { file ->
val size = "%.2f GB".format(bytesToGigaBytes(file.size ?: return@map null))
val quality = getIndexQuality(file.name)
val tags = getIndexQualityTags(file.name)
callback.invoke(
ExtractorLink(
"TgarMovies",
"TgarMovies $tags [$size]",
"https://api.southkoreacdn.workers.dev/telegram/${file._id}",
"$tgarMovieAPI/",
quality,
)
)
}
}
suspend fun invokeGdbotMovies(
title: String? = null,
year: Int? = null,
@ -2769,73 +2483,6 @@ object SoraExtractor : SoraStream() {
}
suspend fun invokeShivamhw(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
val url = if (season == null) {
"$shivamhwAPI/search?search_box=$title&release_year=$year"
} else {
"$shivamhwAPI/api/series_search?search_box=$title&sess_nm=$seasonSlug&epi_nm=$episodeSlug"
}
val res = app.get(url)
val media = if (season == null) {
res.document.select("table.rwd-table tr").map {
Triple(
it.select("td[data-th=File Name]").text(),
it.select("td[data-th=Size]").text(),
it.selectFirst("div.download_button.pls_wait > a")?.attr("href")
)
}
} else {
tryParseJson<ArrayList<ShivamhwSources>>(res.text)?.map {
Triple(
it.name,
it.size,
it.stream_link,
)
}
}
media?.filter {
matchingIndex(
it.first,
null,
title,
year,
season,
episode,
false
)
}?.sortedByDescending {
it.second.getFileSize()
}?.apmap { source ->
val quality = getIndexQuality(source.first)
val tags = getIndexQualityTags(source.first)
val video = source.third
if (!app.get(
video ?: return@apmap,
referer = "$shivamhwAPI/"
).isSuccessful
) return@apmap
callback.invoke(
ExtractorLink(
"Shivamhw",
"Shivamhw $tags [${source.second}]",
video,
"$shivamhwAPI/",
quality,
)
)
}
}
suspend fun invokeCryMovies(
imdbId: String? = null,
title: String? = null,
@ -2887,9 +2534,8 @@ object SoraExtractor : SoraStream() {
callback: (ExtractorLink) -> Unit
) {
val referer = "https://2now.tv/"
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
val url =
if (season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${episodeSlug}.mp4"
val slug = getEpisodeSlug(season, episode)
val url = if (season == null) "$nowTvAPI/$tmdbId.mp4" else "$nowTvAPI/tv/$tmdbId/s${season}e${slug.second}.mp4"
if (!app.get(url, referer = referer).isSuccessful) return
callback.invoke(
ExtractorLink(

View file

@ -202,18 +202,6 @@ data class IndexSearch(
@JsonProperty("data") val data: IndexData? = null,
)
data class TgarMedia(
@JsonProperty("_id") val _id: Int? = null,
@JsonProperty("name") val name: String? = null,
@JsonProperty("size") val size: Double? = null,
@JsonProperty("file_unique_id") val file_unique_id: String? = null,
@JsonProperty("mime_type") val mime_type: String? = null,
)
data class TgarData(
@JsonProperty("documents") val documents: ArrayList<TgarMedia>? = arrayListOf(),
)
data class SorastreamResponse(
@JsonProperty("data") val data: SorastreamVideos? = null,
)
@ -285,14 +273,6 @@ data class PutlockerResponses(
@JsonProperty("backupLink") val backupLink: String? = null,
)
data class ShivamhwSources(
@JsonProperty("id") val id: String? = null,
@JsonProperty("stream_link") val stream_link: String? = null,
@JsonProperty("process_link") val process_link: String? = null,
@JsonProperty("name") val name: String,
@JsonProperty("size") val size: String,
)
data class CryMoviesProxyHeaders(
@JsonProperty("request") val request: Map<String, String>?,
)

View file

@ -3,9 +3,7 @@ package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty
import com.hexated.SoraExtractor.invokeAnimes
import com.hexated.SoraExtractor.invokeAsk4Movies
import com.hexated.SoraExtractor.invokeBlackmovies
import com.hexated.SoraExtractor.invokeBollyMaza
import com.hexated.SoraExtractor.invokeCodexmovies
import com.hexated.SoraExtractor.invokeCryMovies
import com.hexated.SoraExtractor.invokeDbgo
import com.hexated.SoraExtractor.invokeFilmxy
@ -22,7 +20,6 @@ import com.lagradost.cloudstream3.metaproviders.TmdbProvider
import com.hexated.SoraExtractor.invokeDahmerMovies
import com.hexated.SoraExtractor.invokeDoomovies
import com.hexated.SoraExtractor.invokeDreamfilm
import com.hexated.SoraExtractor.invokeEdithxmovies
import com.hexated.SoraExtractor.invokeFDMovies
import com.hexated.SoraExtractor.invokeFlixon
import com.hexated.SoraExtractor.invokeFmovies
@ -31,7 +28,6 @@ import com.hexated.SoraExtractor.invokeGMovies
import com.hexated.SoraExtractor.invokeGdbotMovies
import com.hexated.SoraExtractor.invokeGoku
import com.hexated.SoraExtractor.invokeGomovies
import com.hexated.SoraExtractor.invokeJmdkhMovies
import com.hexated.SoraExtractor.invokeKisskh
import com.hexated.SoraExtractor.invokeLing
import com.hexated.SoraExtractor.invokeM4uhd
@ -43,9 +39,7 @@ import com.hexated.SoraExtractor.invokeNowTv
import com.hexated.SoraExtractor.invokePutlocker
import com.hexated.SoraExtractor.invokeRStream
import com.hexated.SoraExtractor.invokeRidomovies
import com.hexated.SoraExtractor.invokeRubyMovies
import com.hexated.SoraExtractor.invokeShinobiMovies
import com.hexated.SoraExtractor.invokeShivamhw
import com.hexated.SoraExtractor.invokeSmashyStream
import com.hexated.SoraExtractor.invokeDumpStream
import com.hexated.SoraExtractor.invokeEmovies
@ -56,7 +50,6 @@ import com.hexated.SoraExtractor.invokeNetmovies
import com.hexated.SoraExtractor.invokePobmovies
import com.hexated.SoraExtractor.invokeTvMovies
import com.hexated.SoraExtractor.invokeUhdmovies
import com.hexated.SoraExtractor.invokeVitoenMovies
import com.hexated.SoraExtractor.invokeWatchOnline
import com.hexated.SoraExtractor.invokeWatchsomuch
import com.lagradost.cloudstream3.extractors.VidSrcExtractor
@ -98,7 +91,6 @@ open class SoraStream : TmdbProvider() {
const val series9API = "https://series9.cx"
const val idlixAPI = "https://tv.idlixprime.com"
const val noverseAPI = "https://www.nollyverse.com"
const val uniqueStreamAPI = "https://uniquestream.net"
const val filmxyAPI = "https://www.filmxy.vip"
const val kimcartoonAPI = "https://kimcartoon.li"
const val aniwatchAPI = "https://aniwatch.to"
@ -118,8 +110,7 @@ open class SoraStream : TmdbProvider() {
const val flixonAPI = "https://flixon.lol"
const val smashyStreamAPI = "https://embed.smashystream.com"
const val watchSomuchAPI = "https://watchsomuch.tv" // sub only
val gomoviesAPI =
base64DecodeAPI("bQ==Y28=ZS4=aW4=bmw=LW8=ZXM=dmk=bW8=Z28=Ly8=czo=dHA=aHQ=")
val gomoviesAPI = base64DecodeAPI("bQ==Y28=ZS4=aW4=bmw=LW8=ZXM=dmk=bW8=Z28=Ly8=czo=dHA=aHQ=")
const val ask4MoviesAPI = "https://ask4movie.nl"
const val biliBiliAPI = "https://api-vn.otakuz.live/server"
const val watchOnlineAPI = "https://watchonline.ag"
@ -139,29 +130,9 @@ open class SoraStream : TmdbProvider() {
const val doomoviesAPI = "https://doomovies.net"
// INDEX SITE
const val blackMoviesAPI = "https://dl.blacklistedbois.workers.dev/0:"
const val codexMoviesAPI = "https://packs.codexcloudx.tech/0:"
const val edithxMoviesAPI = "https://index.edithx.ga/0:"
const val dahmerMoviesAPI = "https://edytjedhgmdhm.abfhaqrhbnf.workers.dev"
const val jmdkhMovieAPI = "https://tg.jmdkh.eu.org/0:"
const val rubyMovieAPI = "https://upload.rubyshare111.workers.dev/0:"
const val shinobiMovieAPI = "https://home.shinobicloud.cf/0:"
const val vitoenMovieAPI = "https://openmatte.vitoencodes.workers.dev/0:"
const val shivamhwAPI = "https://foogle.shivamhw.me"
val cryMoviesAPI =
base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=")
// DEAD SITE
const val rinzryMoviesAPI = "https://rinzry.stream/0:"
const val chillmovies0API = "https://chill.aicirou.workers.dev/0:"
const val chillmovies1API = "https://chill.aicirou.workers.dev/1:"
const val gamMoviesAPI = "https://drive.gamick.workers.dev/0:"
const val jsMoviesAPI = "https://jsupload.jnsbot.workers.dev/0:"
const val xtremeMoviesAPI = "https://kartik19.xtrememirror0.workers.dev/0:"
const val tgarMovieAPI = "https://tgarchive.eu.org"
const val papaonMovies1API = "https://m.papaonwork.workers.dev/0:"
const val papaonMovies2API = "https://m.papaonwork.workers.dev/1:"
const val xMovieAPI = "https://xemovies.to"
val cryMoviesAPI = base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=")
fun getType(t: String?): TvType {
return when (t) {
@ -419,15 +390,6 @@ open class SoraStream : TmdbProvider() {
{
invokeMovieHab(res.imdbId, res.season, res.episode, subtitleCallback, callback)
},
// {
// invokeDatabaseGdrive(
// res.imdbId,
// res.season,
// res.episode,
// subtitleCallback,
// callback
// )
// },
{
if (res.isAnime) invokeAnimes(
res.title,
@ -440,16 +402,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
// {
// if (res.season != null && res.isAnime) invokeCrunchyroll(
// res.title,
// res.epsTitle,
// res.season,
// res.episode,
// subtitleCallback,
// callback
// )
// },
{
if (!res.isAnime) invokeHDMovieBox(
res.title,
@ -488,18 +440,8 @@ open class SoraStream : TmdbProvider() {
callback
)
},
{
invokeNoverse(res.title, res.season, res.episode, callback)
},
// {
// invokeUniqueStream(
// res.title,
// res.year,
// res.season,
// res.episode,
// subtitleCallback,
// callback
// )
// invokeNoverse(res.title, res.season, res.episode, callback)
// },
{
if (!res.isAnime) invokeFilmxy(
@ -519,16 +461,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
// {
// invokeXmovies(
// res.title,
// res.year,
// res.season,
// res.episode,
// subtitleCallback,
// callback
// )
// },
{
if (!res.isAnime) invokeFmovies(
res.title,
@ -668,52 +600,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
{
if (!res.isAnime) invokeBlackmovies(
blackMoviesAPI,
"BlackMovies",
res.title,
res.year,
res.season,
res.episode,
callback
)
},
// {
// invokeRinzrymovies(
// rinzryMoviesAPI,
// "RinzryMovies",
// res.title,
// res.year,
// res.season,
// res.episode,
// callback,
// )
// },
{
if (!res.isAnime) invokeCodexmovies(
codexMoviesAPI,
"CodexMovies",
res.title,
res.year,
res.season,
res.episode,
callback,
"Basic Y29kZXg6Y29kZXhjbG91ZA=="
)
},
{
if (!res.isAnime) invokeEdithxmovies(
edithxMoviesAPI,
"EdithxMovies",
res.title,
res.year,
res.season,
res.episode,
callback,
"Basic ZWRpdGg6amFydmlz"
)
},
{
invokeDahmerMovies(
res.title,
@ -727,28 +613,14 @@ open class SoraStream : TmdbProvider() {
invokeGomovies(res.title, res.year, res.season, res.episode, callback)
},
// {
// if (!res.isAnime) invokeTgarMovies(res.title, res.year, res.season, res.episode, callback)
// if (!res.isAnime) invokeGdbotMovies(
// res.title,
// res.year,
// res.season,
// res.episode,
// callback
// )
// },
{
if (!res.isAnime) invokeGdbotMovies(
res.title,
res.year,
res.season,
res.episode,
callback
)
},
{
if (!res.isAnime) invokeJmdkhMovies(
jmdkhMovieAPI,
"JmdkhMovies",
res.title,
res.year,
res.season,
res.episode,
callback
)
},
{
if (!res.isAnime) invokeShinobiMovies(
shinobiMovieAPI,
@ -760,28 +632,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
{
if (!res.isAnime) invokeRubyMovies(
rubyMovieAPI,
"RubyMovies",
res.title,
res.year,
res.season,
res.episode,
callback
)
},
{
if (!res.isAnime) invokeVitoenMovies(
vitoenMovieAPI,
"VitoenMovies",
res.title,
res.year,
res.season,
res.episode,
callback
)
},
{
if (!res.isAnime) invokeAsk4Movies(
res.title,
@ -803,15 +653,6 @@ open class SoraStream : TmdbProvider() {
callback
)
},
{
if (!res.isAnime) invokeShivamhw(
res.title,
res.year,
res.season,
res.episode,
callback
)
},
{
if (!res.isAnime && res.season == null) invokeCryMovies(
res.imdbId,