This commit is contained in:
jack 2023-12-06 11:15:42 +07:00
parent fb73c9eabb
commit a496f79f05
13 changed files with 31 additions and 208 deletions

View file

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

View file

@ -138,7 +138,7 @@ class Animasu : MainAPI() {
document.select(".mobius > .mirror > option").mapNotNull { document.select(".mobius > .mirror > option").mapNotNull {
fixUrl(Jsoup.parse(base64Decode(it.attr("value"))).select("iframe").attr("src")) to it.text() fixUrl(Jsoup.parse(base64Decode(it.attr("value"))).select("iframe").attr("src")) to it.text()
}.apmap { (iframe, quality) -> }.apmap { (iframe, quality) ->
loadFixedExtractor(iframe, quality, "$mainUrl/", subtitleCallback, callback) loadFixedExtractor(iframe.fixIframe(), quality, "$mainUrl/", subtitleCallback, callback)
} }
return true return true
} }
@ -166,6 +166,14 @@ class Animasu : MainAPI() {
} }
} }
private fun String.fixIframe() : String {
return if(this.startsWith("https://dl.berkasdrive.com")) {
base64Decode(this.substringAfter("id="))
} else {
this
}
}
private fun getIndexQuality(str: String?): Int { private fun getIndexQuality(str: String?): Int {
return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull() return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull()
?: Qualities.Unknown.value ?: Qualities.Unknown.value

View file

@ -1,21 +1,14 @@
package com.hexated package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.ErrorLoadingException
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.apmap
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.base64Decode import com.lagradost.cloudstream3.base64Decode
import com.lagradost.cloudstream3.extractors.* import com.lagradost.cloudstream3.extractors.*
import com.lagradost.cloudstream3.extractors.helper.AesHelper
import com.lagradost.cloudstream3.utils.AppUtils
import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.utils.M3u8Helper
import com.lagradost.cloudstream3.utils.loadExtractor import com.lagradost.cloudstream3.utils.loadExtractor
import org.jsoup.nodes.Document
import org.mozilla.javascript.Context
import org.mozilla.javascript.Scriptable
open class Uplayer : ExtractorApi() { open class Uplayer : ExtractorApi() {
override val name = "Uplayer" override val name = "Uplayer"
@ -95,80 +88,3 @@ class Likessb : StreamSB() {
class DbGdriveplayer : Gdriveplayer() { class DbGdriveplayer : Gdriveplayer() {
override var mainUrl = "https://database.gdriveplayer.us" override var mainUrl = "https://database.gdriveplayer.us"
} }
object NineTv {
suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val mainUrl = getBaseUrl(url)
val res = app.get(url, headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language" to "en-US,en;q=0.5",
"Referer" to (referer ?: ""),
))
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
val key = "tSIsE8FgpRkv3QQQ"
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
?.replace("\\", "")
?: throw ErrorLoadingException("failed to decrypt")
val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
val name = url.getHost()
M3u8Helper.generateM3u8(
name,
source ?: return,
"$mainUrl/",
headers = mapOf(
"Accept" to "*/*",
"Connection" to "keep-alive",
"Sec-Fetch-Dest" to "empty",
"Sec-Fetch-Mode" to "cors",
"Sec-Fetch-Site" to "cross-site",
"Origin" to mainUrl,
)
).forEach(callback)
AppUtils.tryParseJson<List<Tracks>>("[$tracks]")
?.filter { it.kind == "captions" }?.map { track ->
subtitleCallback.invoke(
SubtitleFile(
track.label ?: "",
track.file ?: return@map null
)
)
}
}
private fun Document.getKeys(): String? {
val script = (this.selectFirst("script:containsData(eval\\()")?.data()
?.replace("eval(", "var result=")?.removeSuffix(");") + ";").trimIndent()
val run = script.runJS("result")
return """,\s*'([^']+)""".toRegex().find(run)?.groupValues?.getOrNull(1)
}
private fun String.runJS(variable: String): String {
val rhino = Context.enter()
rhino.optimizationLevel = -1
val scope: Scriptable = rhino.initSafeStandardObjects()
val result: String
try {
rhino.evaluateString(scope, this, "JavaScript", 1, null)
result = Context.toString(scope.get(variable, scope))
} finally {
Context.exit()
}
return result
}
data class Tracks(
@JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String? = null,
@JsonProperty("kind") val kind: String? = null,
)
}

View file

@ -20,7 +20,6 @@ open class Gomov : MainAPI() {
TvType.TvSeries, TvType.TvSeries,
TvType.AsianDrama TvType.AsianDrama
) )
private val sources = arrayOf("https://chillx.top", "https://watchx.top", "https://bestx.stream")
override val mainPage = mainPageOf( override val mainPage = mainPageOf(
"page/%d/?s&search=advanced&post_type=movie" to "Movies", "page/%d/?s&search=advanced&post_type=movie" to "Movies",
@ -159,13 +158,8 @@ open class Gomov : MainAPI() {
val iframe = app.get(fixUrl(ele.attr("href"))).document.selectFirst("div.gmr-embed-responsive iframe") val iframe = app.get(fixUrl(ele.attr("href"))).document.selectFirst("div.gmr-embed-responsive iframe")
.getIframeAttr()?.let { httpsify(it) } ?: return@apmap .getIframeAttr()?.let { httpsify(it) } ?: return@apmap
when {
sources.any { iframe.startsWith(it) } -> NineTv.getUrl(iframe, "$directUrl/", subtitleCallback, callback)
else -> {
loadExtractor(iframe, "$directUrl/", subtitleCallback, callback) loadExtractor(iframe, "$directUrl/", subtitleCallback, callback)
} }
}
}
} else { } else {
document.select("div.tab-content-ajax").apmap { ele -> document.select("div.tab-content-ajax").apmap { ele ->
val server = app.post( val server = app.post(
@ -173,12 +167,7 @@ open class Gomov : MainAPI() {
data = mapOf("action" to "muvipro_player_content", "tab" to ele.attr("id"), "post_id" to "$id") data = mapOf("action" to "muvipro_player_content", "tab" to ele.attr("id"), "post_id" to "$id")
).document.select("iframe").attr("src").let { httpsify(it) } ).document.select("iframe").attr("src").let { httpsify(it) }
when {
sources.any { server.startsWith(it) } -> NineTv.getUrl(server, "$directUrl/", subtitleCallback, callback)
else -> {
loadExtractor(server, "$directUrl/", subtitleCallback, callback) loadExtractor(server, "$directUrl/", subtitleCallback, callback)
}
}
} }
} }
@ -208,7 +197,3 @@ fun getBaseUrl(url: String): String {
"${it.scheme}://${it.host}" "${it.scheme}://${it.host}"
} }
} }
fun String.getHost(): String {
return fixTitle(URI(this).host.substringBeforeLast(".").substringAfterLast("."))
}

View file

@ -86,7 +86,7 @@ open class Kuramadrive : ExtractorApi() {
val token = doc.select("meta[name=csrf-token]").attr("content") val token = doc.select("meta[name=csrf-token]").attr("content")
val routeCheckAvl = doc.select("input#routeCheckAvl").attr("value") val routeCheckAvl = doc.select("input#routeCheckAvl").attr("value")
val json = app.post( val json = app.get(
routeCheckAvl, headers = mapOf( routeCheckAvl, headers = mapOf(
"X-Requested-With" to "XMLHttpRequest", "X-Requested-With" to "XMLHttpRequest",
"X-CSRF-TOKEN" to token "X-CSRF-TOKEN" to token

View file

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

View file

@ -44,10 +44,12 @@ open class Streampai : ExtractorApi() {
this.name, this.name,
this.name, this.name,
fixUrl(it.file), fixUrl(it.file),
"$mainUrl/", url,
getQualityFromName(it.label), getQualityFromName(it.label),
headers = mapOf( headers = mapOf(
"Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5", "Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
"Accept-Language" to "en-US,en;q=0.5",
"DNT" to "1",
"Range" to "bytes=0-", "Range" to "bytes=0-",
"Sec-Fetch-Dest" to "video", "Sec-Fetch-Dest" to "video",
"Sec-Fetch-Mode" to "no-cors", "Sec-Fetch-Mode" to "no-cors",

View file

@ -127,7 +127,7 @@ class Minioppai : MainAPI() {
val name = it.selectFirst("div.epl-num")?.text() val name = it.selectFirst("div.epl-num")?.text()
val link = fixUrlNull(it.selectFirst("a")?.attr("href")) ?: return@mapNotNull null val link = fixUrlNull(it.selectFirst("a")?.attr("href")) ?: return@mapNotNull null
Episode(link, name = name) Episode(link, name = name)
}.reversed() }
return newAnimeLoadResponse(title, url, TvType.NSFW) { return newAnimeLoadResponse(title, url, TvType.NSFW) {
engName = title engName = title

View file

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

View file

@ -6,17 +6,13 @@ import com.lagradost.cloudstream3.extractors.StreamSB
import com.lagradost.cloudstream3.extractors.Voe import com.lagradost.cloudstream3.extractors.Voe
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.APIHolder.getCaptchaToken import com.lagradost.cloudstream3.APIHolder.getCaptchaToken
import com.lagradost.cloudstream3.ErrorLoadingException
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.apmap
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.base64Decode import com.lagradost.cloudstream3.base64Decode
import com.lagradost.cloudstream3.extractors.Pixeldrain import com.lagradost.cloudstream3.extractors.Pixeldrain
import com.lagradost.cloudstream3.extractors.helper.AesHelper import com.lagradost.cloudstream3.extractors.ZplayerV2
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
import org.jsoup.nodes.Document
import org.mozilla.javascript.Context
import org.mozilla.javascript.Scriptable
import java.math.BigInteger import java.math.BigInteger
import java.security.MessageDigest import java.security.MessageDigest
@ -238,83 +234,6 @@ open class VCloud : ExtractorApi() {
} }
object NineTv {
suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val mainUrl = getBaseUrl(url)
val res = app.get(url, headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language" to "en-US,en;q=0.5",
"Referer" to (referer ?: ""),
))
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
val key = "tSIsE8FgpRkv3QQQ"
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
?.replace("\\", "")
?: throw ErrorLoadingException("failed to decrypt")
val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
val name = url.getHost()
M3u8Helper.generateM3u8(
name,
source ?: return,
"$mainUrl/",
headers = mapOf(
"Accept" to "*/*",
"Connection" to "keep-alive",
"Sec-Fetch-Dest" to "empty",
"Sec-Fetch-Mode" to "cors",
"Sec-Fetch-Site" to "cross-site",
"Origin" to mainUrl,
)
).forEach(callback)
AppUtils.tryParseJson<List<Tracks>>("[$tracks]")
?.filter { it.kind == "captions" }?.map { track ->
subtitleCallback.invoke(
SubtitleFile(
track.label ?: "",
track.file ?: return@map null
)
)
}
}
private fun Document.getKeys(): String? {
val script = (this.selectFirst("script:containsData(eval\\()")?.data()
?.replace("eval(", "var result=")?.removeSuffix(");") + ";").trimIndent()
val run = script.runJS("result")
return """,\s*'([^']+)""".toRegex().find(run)?.groupValues?.getOrNull(1)
}
private fun String.runJS(variable: String): String {
val rhino = Context.enter()
rhino.optimizationLevel = -1
val scope: Scriptable = rhino.initSafeStandardObjects()
val result: String
try {
rhino.evaluateString(scope, this, "JavaScript", 1, null)
result = Context.toString(scope.get(variable, scope))
} finally {
Context.exit()
}
return result
}
data class Tracks(
@JsonProperty("file") val file: String? = null,
@JsonProperty("label") val label: String? = null,
@JsonProperty("kind") val kind: String? = null,
)
}
open class Streamruby : ExtractorApi() { open class Streamruby : ExtractorApi() {
override val name = "Streamruby" override val name = "Streamruby"
override val mainUrl = "https://streamruby.com" override val mainUrl = "https://streamruby.com"
@ -448,3 +367,8 @@ class Embedwish : Filesim() {
override val name = "Embedwish" override val name = "Embedwish"
override var mainUrl = "https://embedwish.com" override var mainUrl = "https://embedwish.com"
} }
class Netembed: ZplayerV2() {
override var name: String = "Netembed"
override var mainUrl: String = "https://play.netembed.xyz"
}

View file

@ -246,6 +246,7 @@ object SoraExtractor : SoraStream() {
} else { } else {
"$multimoviesAPI/episodes/$fixTitle-${season}x${episode}" "$multimoviesAPI/episodes/$fixTitle-${season}x${episode}"
} }
invokeWpmovies(null, url, subtitleCallback, callback)
} }
suspend fun invokeNetmovies( suspend fun invokeNetmovies(
@ -326,20 +327,7 @@ object SoraExtractor : SoraStream() {
else -> it.embed_url else -> it.embed_url
} }
} ?: return@apmap } ?: return@apmap
val sources = arrayOf(
"https://chillx.top",
"https://watchx.top",
"https://bestx.stream",
"https://w1.moviesapi.club"
)
when { when {
sources.any { source.startsWith(it) } -> NineTv.getUrl(
source,
"$referer/",
subtitleCallback,
callback
)
!source.contains("youtube") -> { !source.contains("youtube") -> {
loadCustomExtractor(name, source, "$referer/", subtitleCallback, callback) loadCustomExtractor(name, source, "$referer/", subtitleCallback, callback)
} }
@ -2078,7 +2066,7 @@ object SoraExtractor : SoraStream() {
"$blackvidAPI/v3/tv/sources/$tmdbId/$season/$episode?key=$key" "$blackvidAPI/v3/tv/sources/$tmdbId/$season/$episode?key=$key"
} }
val data = app.get(url, timeout = 120L, referer = ref).okhttpResponse.peekBody(1024 * 1024).bytes().decrypt("2378f8e4e844f2dc839ab48f66e00acc2305a401") val data = app.get(url, timeout = 120L, referer = ref).okhttpResponse.peekBody(1024 * 128).bytes().decrypt("2378f8e4e844f2dc839ab48f66e00acc2305a401")
val json = tryParseJson<BlackvidResponses>(data) val json = tryParseJson<BlackvidResponses>(data)
json?.sources?.map { source -> json?.sources?.map { source ->
@ -2254,7 +2242,7 @@ object SoraExtractor : SoraStream() {
val iframe = app.get(url, referer = "https://pressplay.top/").document.selectFirst("iframe") val iframe = app.get(url, referer = "https://pressplay.top/").document.selectFirst("iframe")
?.attr("src") ?.attr("src")
NineTv.getUrl(iframe ?: return, "$nineTvAPI/", subtitleCallback, callback) loadExtractor(iframe ?: return, "$nineTvAPI/", subtitleCallback, callback)
} }

View file

@ -28,5 +28,6 @@ class SoraStreamPlugin: Plugin() {
registerExtractorAPI(Embedwish()) registerExtractorAPI(Embedwish())
registerExtractorAPI(Wishfast()) registerExtractorAPI(Wishfast())
registerExtractorAPI(Uploadever()) registerExtractorAPI(Uploadever())
registerExtractorAPI(Netembed())
} }
} }

View file

@ -766,9 +766,8 @@ suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair<St
suspend fun getSfServer() = sfServer ?: fetchSfServer().also { sfServer = it } suspend fun getSfServer() = sfServer ?: fetchSfServer().also { sfServer = it }
suspend fun fetchSfServer(): String? { suspend fun fetchSfServer(): String {
return app.get(base64DecodeAPI("ZQ==dXI=YXo=eC8=bGk=bWY=ZWE=dHI=L3M=aW4=bWE=aS0=YXA=aS8=YXA=YW0=cmU=c3Q=dC8=bmU=cy4=b3c=bmQ=d2k=ZS4=b3I=LmM=b2I=Ymw=aS4=YXA=YW0=cmU=c3Q=Ly8=czo=dHA=aHQ=")) return app.get("https://raw.githubusercontent.com/hexated/cloudstream-resources/main/sfmovies_server").text
.parsedSafe<List<Map<String, String>>>()?.first()?.get("link")
} }
suspend fun getFilmxyCookies(url: String) = filmxyCookies ?: fetchFilmxyCookies(url).also { filmxyCookies = it } suspend fun getFilmxyCookies(url: String) = filmxyCookies ?: fetchFilmxyCookies(url).also { filmxyCookies = it }