mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
solved #299
This commit is contained in:
parent
c2e751805a
commit
c034103e81
7 changed files with 70 additions and 33 deletions
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 18
|
||||
version = 19
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -9,6 +9,9 @@ import com.lagradost.cloudstream3.extractors.helper.AesHelper
|
|||
import com.lagradost.cloudstream3.utils.AppUtils
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||
import org.jsoup.nodes.Document
|
||||
import org.mozilla.javascript.Context
|
||||
import org.mozilla.javascript.Scriptable
|
||||
|
||||
class Doods : DoodLaExtractor() {
|
||||
override var name = "Doods"
|
||||
|
@ -49,10 +52,8 @@ class DbGdriveplayer : Gdriveplayer() {
|
|||
override var mainUrl = "https://database.gdriveplayer.us"
|
||||
}
|
||||
|
||||
class NineTv {
|
||||
object NineTv {
|
||||
|
||||
companion object {
|
||||
private const val key = "B#8G4o2\$WWFz"
|
||||
suspend fun getUrl(
|
||||
url: String,
|
||||
referer: String?,
|
||||
|
@ -60,22 +61,20 @@ class NineTv {
|
|||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val mainUrl = getBaseUrl(url)
|
||||
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find(
|
||||
app.get(
|
||||
url,
|
||||
referer = referer
|
||||
).text
|
||||
)?.groupValues?.get(1)
|
||||
val res = app.get(url, referer = referer)
|
||||
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
|
||||
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")
|
||||
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
|
||||
?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")
|
||||
?.replace("\\", "")
|
||||
?: throw ErrorLoadingException("failed to decrypt")
|
||||
|
||||
val name = url.getHost()
|
||||
val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
|
||||
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
|
||||
val name = source?.getHost()
|
||||
|
||||
M3u8Helper.generateM3u8(
|
||||
name,
|
||||
source ?: return,
|
||||
name ?: return,
|
||||
source,
|
||||
"$mainUrl/",
|
||||
headers = mapOf(
|
||||
"Accept" to "*/*",
|
||||
|
@ -97,6 +96,26 @@ class NineTv {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
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(
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
|
|||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
|
||||
class Ngefilm : Gomov() {
|
||||
override var mainUrl = "https://ngef-film21.online"
|
||||
override var mainUrl = "https://nge-film21.store"
|
||||
override var name = "Ngefilm"
|
||||
|
||||
override val mainPage = mainPageOf(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 176
|
||||
version = 177
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -14,6 +14,9 @@ import com.lagradost.cloudstream3.base64Decode
|
|||
import com.lagradost.cloudstream3.extractors.Pixeldrain
|
||||
import com.lagradost.cloudstream3.extractors.helper.AesHelper
|
||||
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
|
||||
|
||||
|
@ -235,10 +238,8 @@ open class VCloud : ExtractorApi() {
|
|||
|
||||
}
|
||||
|
||||
class NineTv {
|
||||
object NineTv {
|
||||
|
||||
companion object {
|
||||
private const val key = "B#8G4o2\$WWFz"
|
||||
suspend fun getUrl(
|
||||
url: String,
|
||||
referer: String?,
|
||||
|
@ -246,22 +247,20 @@ class NineTv {
|
|||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val mainUrl = getBaseUrl(url)
|
||||
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find(
|
||||
app.get(
|
||||
url,
|
||||
referer = referer
|
||||
).text
|
||||
)?.groupValues?.get(1)
|
||||
val res = app.get(url, referer = referer)
|
||||
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
|
||||
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")
|
||||
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false)
|
||||
?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")
|
||||
?.replace("\\", "")
|
||||
?: throw ErrorLoadingException("failed to decrypt")
|
||||
|
||||
val name = url.getHost()
|
||||
val source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
|
||||
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
|
||||
val name = source?.getHost()
|
||||
|
||||
M3u8Helper.generateM3u8(
|
||||
name,
|
||||
source ?: return,
|
||||
name ?: return,
|
||||
source,
|
||||
"$mainUrl/",
|
||||
headers = mapOf(
|
||||
"Accept" to "*/*",
|
||||
|
@ -283,6 +282,26 @@ class NineTv {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
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(
|
||||
|
@ -330,4 +349,3 @@ class Yipsu : Voe() {
|
|||
override val name = "Yipsu"
|
||||
override var mainUrl = "https://yip.su"
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ object SoraExtractor : SoraStream() {
|
|||
else -> it.embed_url
|
||||
}
|
||||
} ?: return@apmap
|
||||
val sources = arrayOf("https://chillx.top", "https://watchx.top", "https://bestx.stream")
|
||||
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") -> {
|
||||
|
|
|
@ -78,7 +78,7 @@ subprojects {
|
|||
// but you dont need to include any of them if you dont need them
|
||||
// https://github.com/recloudstream/cloudstream/blob/master/app/build.gradle
|
||||
implementation(kotlin("stdlib")) // adds standard kotlin features, like listOf, mapOf etc
|
||||
implementation("com.github.Blatzar:NiceHttp:0.4.2") // http library
|
||||
implementation("com.github.Blatzar:NiceHttp:0.4.3") // http library
|
||||
implementation("org.jsoup:jsoup:1.15.3") // html parser
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
|
||||
implementation("io.karn:khttp-android:0.1.2")
|
||||
|
|
Loading…
Reference in a new issue