Gracias de nuevo.
Saludos.
Mensaje por tormund » 30 May 2016, 18:30
Mensaje por robalo » 30 May 2016, 22:46
Sí, con ese código desempaqueta el el "eval(function(p,a,c,k,e,d)....". Te pego los scripts con los que he hecho la prueba.tormund escribió:Con ese simple código de java puedo obtener el código javascript que contiene la URL????![]()
No he entendido a que te refieres con que te falta probarlo AADecode.
Código: Seleccionar todo
public class testUnpack {
public static void main(String[] args) {
String pageUrl = "http://powvideo.net/ccj7r5u58u7v";
String[] videourls = new powvideo(pageUrl).videoUrls;
System.out.println("");
System.out.println("Urls:");
System.out.println("---------------------------------------------------------------------");
Integer c = 0;
for (String url : videourls){
System.out.println("url " + c + ": " + url.replace("/.mp4", "/v.mp4"));
c++;
}
System.out.println("---------------------------------------------------------------------");
}
}
Código: Seleccionar todo
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class powvideo {
String[] videoUrls;
powvideo(String pageUrl) {
String host = "http://powvideo.net";
String id = "";
String data = "";
String videoUrl = "";
String packed = "";
String patron = "";
Matcher matches;
patron = "powvideo.net/(?:embed-|iframe-|preview-|)([a-z0-9]+)";
matches = Pattern.compile(patron).matcher(pageUrl);
while (matches.find())
id = matches.group(1);
String[] headers = {
"User-Agent",
"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0",
"Referer", host + "/embed-" + id + "-640x360.html" };
pageUrl = host + "/iframe-" + id + "-640x360.html";
String getdata = new getDataFromUrl(pageUrl, headers).data;
patron = "<script type='text/javascript'>eval\\((.*?)\\)</script>";
matches = Pattern.compile(patron).matcher(getdata.replaceAll("\\n", ""));
while (matches.find())
packed = matches.group(1);
String unpacked = new unPack(packed).unPacked;
patron = ";sources=\\[(.*?)\\];";
matches = Pattern.compile(patron).matcher(unpacked);
while (matches.find())
data = matches.group(1);
patron = "src:[^']*'([^']+)'";
matches = Pattern.compile(patron).matcher(data);
while (matches.find())
videoUrl+= matches.group(1).replace("\\", "") + "|";
videoUrls = videoUrl.replaceAll("\\|$", "").split("\\|");
}
}
Código: Seleccionar todo
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.Charset;
public class getDataFromUrl {
String data;
getDataFromUrl(String pageUrl, String[] headers) {
StringBuilder sb = new StringBuilder();
URLConnection urlConn = null;
InputStreamReader in = null;
int c = 0;
String key = "";
String value = "";
try {
URL getUrl = new URL(pageUrl);
urlConn = getUrl.openConnection();
for (String header : headers) {
if (c % 2 == 0)
key = header;
else {
value = header;
urlConn.addRequestProperty(key, value);
}
c++;
}
if (urlConn != null)
urlConn.setReadTimeout(60 * 1000);
if (urlConn != null && urlConn.getInputStream() != null) {
in = new InputStreamReader(urlConn.getInputStream(),
Charset.defaultCharset());
BufferedReader bufferedReader = new BufferedReader(in);
if (bufferedReader != null) {
int cp;
while ((cp = bufferedReader.read()) != -1) {
sb.append((char) cp);
}
bufferedReader.close();
}
}
in.close();
} catch (Exception e) {
throw new RuntimeException("Exception gatDataFromUrl:" + pageUrl, e);
}
data = sb.toString();
}
}
Código: Seleccionar todo
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class unPack {
String unPacked;
unPack(String packed) {
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
try {
engine.eval("var res = " + packed + ";");
} catch (ScriptException e) {
e.printStackTrace();
}
unPacked = (String) engine.get("res");
}
}
Código: Seleccionar todo
Urls:
---------------------------------------------------------------------
url 0: rtmp://149.202.80.233:19350/vod/mp4:01/00269/ccj7r5u58u7v_n?h=haohpdb4pyikkfn2mal72ny4hy2ooszuw7ntjsjlcffvmncsc6qgyw4eva
url 1: http://powvideo.net/haohpdb4pyikkfn2mal72ny4hy2ooszuw7ntjsjlcffvmncsc6qgyw4eva.m3u8
url 2: http://149.202.80.233:8777/haohpdb4pyikkfn2mal72ny4hy2ooszuw7ntjsjlcffvmncsc6qgyw4eva/v.mp4
---------------------------------------------------------------------
Código: Seleccionar todo
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class aaDecode {
String decode;
aaDecode(String encode) {
String patron = "";
Matcher matches;
String res = "";
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
encode = encode.replaceAll("\\s+", "");
encode = encode.replaceAll("';.゚Д゚..'_'.", "'; res = ");
encode = encode.replaceAll(".'_'.;$", ";");
try {
engine.eval(encode);
res = (String) engine.get("res");
if (new String(res).contains("toString")){
patron = "=\\((.*)\\);";
matches = Pattern.compile(patron).matcher(res);
while (matches.find())
res = (String) matches.group(1);
engine.eval("res =" + res + ";");
res = (String) engine.get("res");
}
} catch (ScriptException e) {
e.printStackTrace();
}
decode = res;
}
}
Código: Seleccionar todo
Mensaje por tormund » 01 Jun 2016, 22:03
Mensaje por robalo » 02 Jun 2016, 01:12
Código: Seleccionar todo
package pez.robalo.jsunpack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class unPack {
public String unPacked;
public unPack(String packed) {
String p = "";
Integer a = 0;
Integer c = 0;
String[] k = {};
String[] toString = {};
String patron = "";
Matcher matches;
patron = "\\}\\('(.*)', *(\\d+), *(\\d+), *'(.*)'\\.split\\('\\|'\\)";
matches = Pattern.compile(patron).matcher(packed);
while (matches.find()) {
p = matches.group(1);
a = Integer.parseInt(matches.group(2));
c = Integer.parseInt(matches.group(3));
k = matches.group(4).split("\\|");
}
if (a <= 62) toString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
else toString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~".split("");
while (c > 0) {
c--;
p = p.replaceAll("\\b" + e(c, a, toString) + "\\b", k[c]);
}
unPacked = p;
}
private static String e(Integer c, Integer a, String[] toString) {
if (c < a) return toString[c + 1];
else return toString[(c / a) + 1] + toString[(c % a) + 1];
}
}
Mensaje por tormund » 02 Jun 2016, 08:17
Código: Seleccionar todo
packedFormateado = "javascript: (function() { var p = '" + p + "';\n";
packedFormateado += "var a = " + a + ";\n";
packedFormateado += "var c = " + c + ";\n";
packedFormateado += "var k = '" + k + ";\n";
packedFormateado += "var e = " + e + ";\n";
packedFormateado += d + ")()"; //He llamado variable "d" al while
Código: Seleccionar todo
webView.evaluateJavascript(packedFormateado, new ValueCallback<String>() {
@Override
public void onReceiveValue(String html) {
Log.d("HTML", html);
unpacked = html;
TextView txtTexto = (TextView) findViewById(R.id.txtTexto);
txtTexto.setText(unpacked);
}
}
);
Mensaje por robalo » 02 Jun 2016, 21:22
Mensaje por tormund » 02 Jun 2016, 22:53
Mensaje por robalo » 03 Jun 2016, 01:29
Mensaje por robalo » 04 Jun 2016, 00:02
Código: Seleccionar todo
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
Código: Seleccionar todo
webView.evaluateJavascript("(fuction(){return \"algo\";})()", new ValueCallback<String>() {
@Override
public void onReceiveValue(String html) {
Log.d("HTML", html);
}
});
Código: Seleccionar todo
webView.evaluateJavascript("javascript: (fuction(){return \"algo\";})()", new ValueCallback<String>() {
@Override
public void onReceiveValue(String html) {
Log.d("HTML", html);
}
});
Este es el foro oficial de soporte para pelisalacarta, tvalacarta y mywebtv.
También es un lugar para compartir tus experiencias con dispositivos multimedia y software media center, puede que encuentres algo interesante que ni siquiera sabías que se podía hacer.
Si estás empezando con Kodi, o si estás interesado en sacarle más partido, puedes echar un vistazo a esta colección de video-tutoriales.
Aprenderás a crear y optimizar tu biblioteca, a instalar add-ons, a buscar subtítulos...
Si tienes un problema en alguno de los plugins y quieres reportarlo, no olvides incluir el log.
Para que resulte útil tienes que activar la opción de "log completo" en el plugin, luego reiniciar Kodi y dar los pasos necesarios hasta que se produzca el problema.
Luego copia tu fichero de log, siguiendo las instrucciones que se describen en este enlace, e inclúyelo al final de la descripción de tu problema.
Si sabes programar, esta serie de tutoriales que describen paso a paso cómo desarrollar tu propio add-on para Kodi.
Y si quieres añadir tus propios canales a pelisalacarta también te contamos paso a paso cómo hacerlo en este enlace.
Usuarios navegando por este Foro: Ahrefs [Bot] y 15 invitados