Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,11 @@ fun fixTitle(str: String): String {
*
* Use like the following: rhino.evaluateString(scope, js, "JavaScript", 1, null)
**/
// Deprecate after next stable
/* @Deprecated(
message = "Use JsContext or evalJs instead.",
level = DeprecationLevel.WARNING,
) */
suspend fun getRhinoContext(): org.mozilla.javascript.Context {
return Coroutines.mainWork {
val rhino = org.mozilla.javascript.Context.enter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.evalJs
import com.lagradost.cloudstream3.utils.newExtractorLink
import org.mozilla.javascript.Context

class Watchadsontape : StreamTape() {
override var mainUrl = "https://watchadsontape.com"
Expand All @@ -30,24 +30,14 @@ open class StreamTape : ExtractorApi() {

override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
with(app.get(url)) {
var result =
val result =
this.document.select("script").firstOrNull { it.html().contains("botlink').innerHTML") }
?.html()?.lines()?.firstOrNull{ it.contains("botlink').innerHTML") }?.let {
val scriptContent =
it.substringAfter(").innerHTML").replaceFirst("=", "var url =")
val rhino = Context.enter()
rhino.setInterpretedMode(true)
val scope = rhino.initStandardObjects()
var result = ""
try {
rhino.evaluateString(scope, scriptContent, "url", 1, null)
result = scope.get("url", scope).toString()
}finally {
rhino.close()
}
result
?.html()?.lines()?.firstOrNull { it.contains("botlink').innerHTML") }?.let {
val scriptContent = it.substringAfter(").innerHTML").replaceFirst("=", "var url =")
evalJs(scriptContent, "url")?.toString()
}
if(!result.isNullOrEmpty()){

if (!result.isNullOrEmpty()) {
val extractedUrl = "https:${result}&stream=1"
return listOf(
newExtractorLink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ package com.lagradost.cloudstream3.extractors
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import org.mozilla.javascript.Context
import org.mozilla.javascript.EvaluatorException
import org.mozilla.javascript.Scriptable

open class Userload : ExtractorApi() {
override var name = "Userload"
Expand All @@ -32,17 +29,8 @@ open class Userload : ExtractorApi() {
return array
}

private fun evaluateMath(mathExpression : String): String {
val rhino = Context.enter()
rhino.initStandardObjects()
rhino.setInterpretedMode(true)
val scope: Scriptable = rhino.initStandardObjects()
return try {
rhino.evaluateString(scope, "eval($mathExpression)", "JavaScript", 1, null).toString()
}
catch (e: EvaluatorException){
""
}
private fun evaluateMath(mathExpression: String): String {
return jsValueToString(evalJs("eval($mathExpression)"))
}

private fun decodeVideoJs(text: String): List<String> {
Expand All @@ -68,22 +56,16 @@ open class Userload : ExtractorApi() {
subchar.add(splitInput(v).map { evaluateMath(it).substringBefore(".") }.toString().filter { it.isDigit() })
}
var txtresult = ""
subchar.forEach{
subchar.forEach {
txtresult = txtresult.plus(it.toInt(8).toChar())
}
val val1 = Regex(""""morocco="((.|\\n)*?)"&mycountry="""").find(txtresult)?.groups?.get(1)?.value.toString().drop(1).dropLast(1)
val val2 = txtresult.substringAfter("""&mycountry="+""").substringBefore(")")

return listOf(
val1,
val2
)


return listOf(val1, val2)
}

override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {

val extractedLinksList: MutableList<ExtractorLink> = mutableListOf()

val response = app.get(url).text
Expand Down Expand Up @@ -113,4 +95,4 @@ open class Userload : ExtractorApi() {

return extractedLinksList
}
}
}
Loading