From fb882b609b39b73d65a72c525d5a6148ba927e0f Mon Sep 17 00:00:00 2001 From: helo Date: Wed, 13 Sep 2023 14:58:52 +0700 Subject: [PATCH] sora: added vegamovies & close #264 --- SoraStream/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Extractors.kt | 57 +++++++++ .../main/kotlin/com/hexated/SoraExtractor.kt | 110 +++++++----------- .../src/main/kotlin/com/hexated/SoraParser.kt | 14 --- .../src/main/kotlin/com/hexated/SoraStream.kt | 31 ++--- .../main/kotlin/com/hexated/SoraStreamLite.kt | 17 --- .../kotlin/com/hexated/SoraStreamPlugin.kt | 2 + 7 files changed, 111 insertions(+), 122 deletions(-) diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index 82fa01b5..26983187 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 167 +version = 168 android { defaultConfig { diff --git a/SoraStream/src/main/kotlin/com/hexated/Extractors.kt b/SoraStream/src/main/kotlin/com/hexated/Extractors.kt index b91348b1..ef393288 100644 --- a/SoraStream/src/main/kotlin/com/hexated/Extractors.kt +++ b/SoraStream/src/main/kotlin/com/hexated/Extractors.kt @@ -7,7 +7,10 @@ import com.lagradost.cloudstream3.extractors.Voe import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.APIHolder.getCaptchaToken import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.base64Decode +import com.lagradost.cloudstream3.extractors.Pixeldrain import com.lagradost.cloudstream3.utils.* import java.math.BigInteger import java.security.MessageDigest @@ -131,6 +134,60 @@ open class Playm4u : ExtractorApi() { } +open class VCloud : ExtractorApi() { + override val name: String = "V-Cloud" + override val mainUrl: String = "https://v-cloud.bio" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val res = app.get(url) + val doc = res.document + val changedLink = doc.selectFirst("script:containsData(url =)")?.data()?.let { + """url\s*=\s*['"](.*)['"];""".toRegex().find(it)?.groupValues?.get(1) + ?.substringAfter("r=") + } + val header = doc.selectFirst("div.card-header")?.text() + app.get( + base64Decode(changedLink ?: return), cookies = res.cookies, headers = mapOf( + "Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" + ) + ).document.select("p.text-success ~ a").apmap { + val link = it.attr("href") + if (it.text().contains(Regex("Server : 1|2"))) { + callback.invoke( + ExtractorLink( + this.name, + this.name, + link, + "", + getIndexQuality(header), + INFER_TYPE + ) + ) + } else { + val direct = if(link.contains("gofile.io")) app.get(link).url else link + loadExtractor(direct, referer, subtitleCallback, callback) + } + } + + } + + private fun getIndexQuality(str: String?): Int { + return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull() + ?: Qualities.Unknown.value + } + +} + +class Pixeldra : Pixeldrain() { + override val mainUrl = "https://pixeldra.in" +} + class TravelR : GMPlayer() { override val name = "TravelR" override val mainUrl = "https://travel-russia.xyz" diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 5f6e72f0..a2928700 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -1132,6 +1132,45 @@ object SoraExtractor : SoraStream() { } + suspend fun invokeVegamovies( + title: String? = null, + year: Int? = null, + season: Int? = null, + episode: Int? = null, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + var res = app.get("$vegaMoviesAPI/search/$title").document + val match = if (season == null) "$year" else "Season $season" + val media = res.selectFirst("div.blog-items article:has(h3.entry-title:matches((?i)$title.*$match)) a") + ?.attr("href") + + res = app.get(media ?: return).document + val hTag = if (season == null) "h5" else "h3" + val aTag = if (season == null) "Download Now" else "V-Cloud" + res.select("div.entry-content > $hTag:matches(1080p|2160p)").apmap { + val tags = """(?:1080p|2160p)(.*)""".toRegex().find(it.text())?.groupValues?.get(1)?.trim() + val href = it.nextElementSibling()?.select("a:contains($aTag)")?.attr("href") + val selector = if (season == null) "p a:contains(V-Cloud)" else "h4:matches(0?$episode) + p a:contains(V-Cloud)" + val server = app.get(href ?: return@apmap).document.selectFirst("div.entry-content > $selector") + ?.attr("href") + loadExtractor(server ?: return@apmap, "$vegaMoviesAPI/", subtitleCallback) { link -> + callback.invoke( + ExtractorLink( + link.name, + "${link.name} $tags", + link.url, + link.referer, + getIndexQuality(it.text()), + link.type, + link.headers, + ) + ) + } + } + + } + suspend fun invokePobmovies( title: String? = null, year: Int? = null, @@ -2242,77 +2281,6 @@ object SoraExtractor : SoraStream() { } - suspend fun invokeOmega( - tmdbId: Int? = null, - callback: (ExtractorLink) -> Unit, - ) { - app.get("$omegaAPI/v3/movie/sources/$tmdbId") - .parsedSafe()?.sources?.filter { it.label != "2" }?.map { sources -> - sources.sources?.map source@{ source -> - callback.invoke( - ExtractorLink( - "Omega ${sources.label}", - "Omega ${sources.label}", - source.url ?: return@source, - "", - getQualityFromName(source.quality), - INFER_TYPE - ) - ) - } - } - } - - suspend fun invokeAsk4Movies( - title: String? = null, - year: Int? = null, - season: Int? = null, - episode: Int? = null, - callback: (ExtractorLink) -> Unit, - ) { - val query = if (season == null) { - title - } else { - "$title season $season" - } - val mediaData = - app.get("$ask4MoviesAPI/?s=$query").document.select("div#search-content div.item").map { - it.selectFirst("div.main-item a") - } - - val media = if (mediaData.size == 1) { - mediaData.firstOrNull() - } else { - mediaData.find { - if (season == null) { - it?.text().equals("$title ($year)", true) - } else { - it?.text().equals("$title (Season $season)", true) - } - } - } - - val epsDoc = app.get(media?.attr("href") ?: return).document - - val iframe = if (season == null) { - epsDoc.select("div#player-embed iframe").attr("data-src") - } else { - epsDoc.select("ul.group-links-list li:nth-child($episode) a").attr("data-embed-src") - } - - val iframeDoc = app.get(iframe, referer = "$ask4MoviesAPI/").text - val script = - Regex("""eval\(function\(p,a,c,k,e,.*\)\)""").findAll(iframeDoc).lastOrNull()?.value - val unpacked = getAndUnpack(script ?: return) - val m3u8 = Regex("file:\\s*\"(.*?m3u8.*?)\"").find(unpacked)?.groupValues?.getOrNull(1) - M3u8Helper.generateM3u8( - "Ask4movie", - m3u8 ?: return, - mainUrl - ).forEach(callback) - - } - suspend fun invokeWatchOnline( imdbId: String? = null, tmdbId: Int? = null, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt index fe32debf..483be230 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraParser.kt @@ -58,20 +58,6 @@ data class KisskhSources( @JsonProperty("ThirdParty") val thirdParty: String?, ) -data class OmegaSource( - @JsonProperty("quality") val quality: String? = null, - @JsonProperty("url") val url: String? = null, -) - -data class OmegaSources( - @JsonProperty("label") val label: String? = null, - @JsonProperty("sources") val sources: ArrayList? = arrayListOf(), -) - -data class OmegaResponse( - @JsonProperty("sources") val sources: ArrayList? = arrayListOf(), -) - data class KisskhSubtitle( @JsonProperty("src") val src: String?, @JsonProperty("label") val label: String?, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt index 617ecb57..d8c31be6 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStream.kt @@ -3,7 +3,6 @@ package com.hexated import com.fasterxml.jackson.annotation.JsonProperty import com.hexated.SoraExtractor.invoke2embed import com.hexated.SoraExtractor.invokeAnimes -import com.hexated.SoraExtractor.invokeAsk4Movies import com.hexated.SoraExtractor.invokeBollyMaza import com.hexated.SoraExtractor.invokeCryMovies import com.hexated.SoraExtractor.invokeDbgo @@ -43,11 +42,11 @@ import com.hexated.SoraExtractor.invokeJump1 import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeNetmovies -import com.hexated.SoraExtractor.invokeOmega import com.hexated.SoraExtractor.invokePobmovies import com.hexated.SoraExtractor.invokePrimewire import com.hexated.SoraExtractor.invokeTvMovies import com.hexated.SoraExtractor.invokeUhdmovies +import com.hexated.SoraExtractor.invokeVegamovies import com.hexated.SoraExtractor.invokeVidsrcto import com.hexated.SoraExtractor.invokeWatchOnline import com.hexated.SoraExtractor.invokeWatchsomuch @@ -111,7 +110,6 @@ 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 - const val ask4MoviesAPI = "https://ask4movie.nl" const val watchOnlineAPI = "https://watchonline.ag" const val nineTvAPI = "https://moviesapi.club" const val fmoviesAPI = "https://fmovies.to" @@ -132,7 +130,7 @@ open class SoraStream : TmdbProvider() { const val animetoshoAPI = "https://animetosho.org" const val susflixAPI = "https://susflix.tv" const val jump1API = "https://ca.jump1.net" - const val omegaAPI = "https://prod.omega.themoviearchive.site" + const val vegaMoviesAPI = "https://vegamovies.im" // INDEX SITE const val dahmerMoviesAPI = "https://edytjedhgmdhm.abfhaqrhbnf.workers.dev" @@ -624,15 +622,6 @@ open class SoraStream : TmdbProvider() { callback ) }, - { - if (!res.isAnime) invokeAsk4Movies( - res.title, - res.year, - res.season, - res.episode, - callback - ) - }, { invokeWatchOnline( res.imdbId, @@ -676,6 +665,16 @@ open class SoraStream : TmdbProvider() { callback ) }, + { + if (!res.isAnime) invokeVegamovies( + res.title, + res.year, + res.season, + res.episode, + subtitleCallback, + callback + ) + }, { if (!res.isAnime && res.season == null) invokePobmovies( res.title, @@ -739,12 +738,6 @@ open class SoraStream : TmdbProvider() { callback ) }, - { - if (!res.isAnime && res.season == null) invokeOmega( - res.id, - callback - ) - }, ) return true diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt index d0f9146e..88c15f3e 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamLite.kt @@ -2,7 +2,6 @@ package com.hexated import com.hexated.SoraExtractor.invoke2embed import com.hexated.SoraExtractor.invokeAnimes -import com.hexated.SoraExtractor.invokeAsk4Movies import com.hexated.SoraExtractor.invokeDbgo import com.hexated.SoraExtractor.invokeDoomovies import com.hexated.SoraExtractor.invokeDramaday @@ -30,7 +29,6 @@ import com.hexated.SoraExtractor.invokeJump1 import com.hexated.SoraExtractor.invokeMoment import com.hexated.SoraExtractor.invokeMultimovies import com.hexated.SoraExtractor.invokeNetmovies -import com.hexated.SoraExtractor.invokeOmega import com.hexated.SoraExtractor.invokePrimewire import com.hexated.SoraExtractor.invokeVidSrc import com.hexated.SoraExtractor.invokeVidsrcto @@ -235,12 +233,6 @@ class SoraStreamLite : SoraStream() { callback ) }, - { - if (!res.isAnime && res.season == null) invokeOmega( - res.id, - callback - ) - }, { invokeRStream(res.id, res.season, res.episode, callback) }, @@ -250,15 +242,6 @@ class SoraStreamLite : SoraStream() { { invokePrimewire(res.title, res.year, res.season, res.episode, callback) }, - { - if (!res.isAnime) invokeAsk4Movies( - res.title, - res.year, - res.season, - res.episode, - callback - ) - }, { invokeWatchOnline( res.imdbId, diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraStreamPlugin.kt b/SoraStream/src/main/kotlin/com/hexated/SoraStreamPlugin.kt index 3e0cda41..7e2e5914 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraStreamPlugin.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraStreamPlugin.kt @@ -18,5 +18,7 @@ class SoraStreamPlugin: Plugin() { registerExtractorAPI(Mwish()) registerExtractorAPI(TravelR()) registerExtractorAPI(Playm4u()) + registerExtractorAPI(VCloud()) + registerExtractorAPI(Pixeldra()) } } \ No newline at end of file