mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed #432
This commit is contained in:
parent
fb73c9eabb
commit
a496f79f05
13 changed files with 31 additions and 208 deletions
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 199
|
||||
version = 200
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -6,17 +6,13 @@ import com.lagradost.cloudstream3.extractors.StreamSB
|
|||
import com.lagradost.cloudstream3.extractors.Voe
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.APIHolder.getCaptchaToken
|
||||
import com.lagradost.cloudstream3.ErrorLoadingException
|
||||
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.extractors.helper.AesHelper
|
||||
import com.lagradost.cloudstream3.extractors.ZplayerV2
|
||||
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.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() {
|
||||
override val name = "Streamruby"
|
||||
override val mainUrl = "https://streamruby.com"
|
||||
|
@ -447,4 +366,9 @@ class Yipsu : Voe() {
|
|||
class Embedwish : Filesim() {
|
||||
override val name = "Embedwish"
|
||||
override var mainUrl = "https://embedwish.com"
|
||||
}
|
||||
|
||||
class Netembed: ZplayerV2() {
|
||||
override var name: String = "Netembed"
|
||||
override var mainUrl: String = "https://play.netembed.xyz"
|
||||
}
|
|
@ -246,6 +246,7 @@ object SoraExtractor : SoraStream() {
|
|||
} else {
|
||||
"$multimoviesAPI/episodes/$fixTitle-${season}x${episode}"
|
||||
}
|
||||
invokeWpmovies(null, url, subtitleCallback, callback)
|
||||
}
|
||||
|
||||
suspend fun invokeNetmovies(
|
||||
|
@ -326,20 +327,7 @@ object SoraExtractor : SoraStream() {
|
|||
else -> it.embed_url
|
||||
}
|
||||
} ?: return@apmap
|
||||
val sources = arrayOf(
|
||||
"https://chillx.top",
|
||||
"https://watchx.top",
|
||||
"https://bestx.stream",
|
||||
"https://w1.moviesapi.club"
|
||||
)
|
||||
when {
|
||||
sources.any { source.startsWith(it) } -> NineTv.getUrl(
|
||||
source,
|
||||
"$referer/",
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
|
||||
!source.contains("youtube") -> {
|
||||
loadCustomExtractor(name, source, "$referer/", subtitleCallback, callback)
|
||||
}
|
||||
|
@ -2078,7 +2066,7 @@ object SoraExtractor : SoraStream() {
|
|||
"$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)
|
||||
|
||||
json?.sources?.map { source ->
|
||||
|
@ -2254,7 +2242,7 @@ object SoraExtractor : SoraStream() {
|
|||
val iframe = app.get(url, referer = "https://pressplay.top/").document.selectFirst("iframe")
|
||||
?.attr("src")
|
||||
|
||||
NineTv.getUrl(iframe ?: return, "$nineTvAPI/", subtitleCallback, callback)
|
||||
loadExtractor(iframe ?: return, "$nineTvAPI/", subtitleCallback, callback)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -28,5 +28,6 @@ class SoraStreamPlugin: Plugin() {
|
|||
registerExtractorAPI(Embedwish())
|
||||
registerExtractorAPI(Wishfast())
|
||||
registerExtractorAPI(Uploadever())
|
||||
registerExtractorAPI(Netembed())
|
||||
}
|
||||
}
|
|
@ -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 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="))
|
||||
.parsedSafe<List<Map<String, String>>>()?.first()?.get("link")
|
||||
suspend fun fetchSfServer(): String {
|
||||
return app.get("https://raw.githubusercontent.com/hexated/cloudstream-resources/main/sfmovies_server").text
|
||||
}
|
||||
|
||||
suspend fun getFilmxyCookies(url: String) = filmxyCookies ?: fetchFilmxyCookies(url).also { filmxyCookies = it }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue