2
1
Fork 1
mirror of https://github.com/yoyzo/arab synced 2024-08-15 03:15:00 +00:00

whoops fix gateanime, and fix last build

This commit is contained in:
Zaw 2022-10-13 13:01:12 +03:00
parent 1ec8892184
commit 7ece960847
4 changed files with 24 additions and 3 deletions

View file

@ -15,6 +15,26 @@ import java.util.Base64
import org.mozilla.javascript.Context
import org.mozilla.javascript.Scriptable
fun String.runJS(variableName: String): String {
val rhino = Context.enter()
rhino.initSafeStandardObjects()
rhino.optimizationLevel = -1
val scope: Scriptable = rhino.initSafeStandardObjects()
val script = this
val result: String
try {
var js = ""
for (i in script.indices) {
js += script[i]
}
rhino.evaluateString(scope, js, "JavaScript", 1, null)
result = Context.toString(scope.get(variableName, scope))
} finally {
Context.exit()
}
return result
}
class EgyBest : MainAPI() {
override var lang = "ar"
override var mainUrl = "https://www.egy.best"