This commit is contained in:
hexated 2023-09-30 23:31:50 +07:00
parent c2e751805a
commit c034103e81
7 changed files with 70 additions and 33 deletions

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 = 18 version = 19
android { android {
defaultConfig { defaultConfig {

View file

@ -9,6 +9,9 @@ import com.lagradost.cloudstream3.extractors.helper.AesHelper
import com.lagradost.cloudstream3.utils.AppUtils import com.lagradost.cloudstream3.utils.AppUtils
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 org.jsoup.nodes.Document
import org.mozilla.javascript.Context
import org.mozilla.javascript.Scriptable
class Doods : DoodLaExtractor() { class Doods : DoodLaExtractor() {
override var name = "Doods" override var name = "Doods"
@ -49,10 +52,8 @@ class DbGdriveplayer : Gdriveplayer() {
override var mainUrl = "https://database.gdriveplayer.us" override var mainUrl = "https://database.gdriveplayer.us"
} }
class NineTv { object NineTv {
companion object {
private const val key = "B#8G4o2\$WWFz"
suspend fun getUrl( suspend fun getUrl(
url: String, url: String,
referer: String?, referer: String?,
@ -60,22 +61,20 @@ class NineTv {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val mainUrl = getBaseUrl(url) val mainUrl = getBaseUrl(url)
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find( val res = app.get(url, referer = referer)
app.get( val master = Regex("MasterJS\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
url, val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")
referer = referer
).text
)?.groupValues?.get(1)
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false) 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 source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1) val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
val name = source?.getHost()
M3u8Helper.generateM3u8( M3u8Helper.generateM3u8(
name, name ?: return,
source ?: return, source,
"$mainUrl/", "$mainUrl/",
headers = mapOf( headers = mapOf(
"Accept" to "*/*", "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( data class Tracks(

View file

@ -9,7 +9,7 @@ import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor import com.lagradost.cloudstream3.utils.loadExtractor
class Ngefilm : Gomov() { class Ngefilm : Gomov() {
override var mainUrl = "https://ngef-film21.online" override var mainUrl = "https://nge-film21.store"
override var name = "Ngefilm" override var name = "Ngefilm"
override val mainPage = mainPageOf( override val mainPage = mainPageOf(

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 = 176 version = 177
android { android {
defaultConfig { defaultConfig {

View file

@ -14,6 +14,9 @@ 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.helper.AesHelper
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
@ -235,10 +238,8 @@ open class VCloud : ExtractorApi() {
} }
class NineTv { object NineTv {
companion object {
private const val key = "B#8G4o2\$WWFz"
suspend fun getUrl( suspend fun getUrl(
url: String, url: String,
referer: String?, referer: String?,
@ -246,22 +247,20 @@ class NineTv {
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val mainUrl = getBaseUrl(url) val mainUrl = getBaseUrl(url)
val master = Regex("MasterJS\\s*=\\s*'([^']+)").find( val res = app.get(url, referer = referer)
app.get( val master = Regex("MasterJS\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
url, val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")
referer = referer
).text
)?.groupValues?.get(1)
val decrypt = AesHelper.cryptoAESHandler(master ?: return, key.toByteArray(), false) 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 source = Regex(""""?file"?:\s*"([^"]+)""").find(decrypt)?.groupValues?.get(1)
val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1) val tracks = Regex("""tracks:\s*\[(.+)]""").find(decrypt)?.groupValues?.get(1)
val name = source?.getHost()
M3u8Helper.generateM3u8( M3u8Helper.generateM3u8(
name, name ?: return,
source ?: return, source,
"$mainUrl/", "$mainUrl/",
headers = mapOf( headers = mapOf(
"Accept" to "*/*", "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( data class Tracks(
@ -329,5 +348,4 @@ class MultimoviesSB : StreamSB() {
class Yipsu : Voe() { class Yipsu : Voe() {
override val name = "Yipsu" override val name = "Yipsu"
override var mainUrl = "https://yip.su" override var mainUrl = "https://yip.su"
} }

View file

@ -303,7 +303,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") 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) sources.any { source.startsWith(it) } -> NineTv.getUrl(source, "$referer/", subtitleCallback, callback)
!source.contains("youtube") -> { !source.contains("youtube") -> {

View file

@ -78,7 +78,7 @@ subprojects {
// but you dont need to include any of them if you dont need them // but you dont need to include any of them if you dont need them
// https://github.com/recloudstream/cloudstream/blob/master/app/build.gradle // https://github.com/recloudstream/cloudstream/blob/master/app/build.gradle
implementation(kotlin("stdlib")) // adds standard kotlin features, like listOf, mapOf etc 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("org.jsoup:jsoup:1.15.3") // html parser
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1") implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
implementation("io.karn:khttp-android:0.1.2") implementation("io.karn:khttp-android:0.1.2")