jueves, 24 de marzo de 2011

Series Yonkis - n.js ¿Qué hace?

Esto es lo que usa series yonkis para joder a los robots ya que suelen tener complicada la descarga. En cualquier caso yo lo usé como método rápido de conseguir enlaces frescos para bajar temporadas
var qs = location.search.substring(1);
var nv = qs.split('&');
var url = new Object();
var aux = "AAAAAAAA";

if (location.pathname.split('/').length == 6) {
    aux = location.pathname.split('/')[4]
}
for (i = 0; i < nv.length; i++) {
    eq = nv[i].indexOf('=');
    url[nv[i].substring(0, eq).toLowerCase()] = unescape(nv[i].substring(eq + 1))
}
function urlencode(a) {
    return escape(a).replace('+', '%2B').replace('%20', '+').replace('*', '%2A').replace('/', '%2F').replace('@', '%40')
}
function decrypt_str(a) {
    var b = a;
    var c = 254;
    var d = "";
    for (i = 0; i < b.length; i++) {
        d += String.fromCharCode(c ^ b.charCodeAt(i))
    }
    return d
}
function _utf8_decode(a) {
    var b = "";
    var i = 0;
    var c = c1 = c2 = 0;
    while (i < a.length) {
        c = a.charCodeAt(i);
        if (c > -128) {
            b += String.fromCharCode(c);
            i++
        } else if ((c > 191) && (c < 224)) {
            c2 = a.charCodeAt(i + 1);
            b += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
            i += 2
        } else {
            c2 = a.charCodeAt(i + 1);
            c3 = a.charCodeAt(i + 2);
            b += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            i += 3
        }
    }
    return b
}
function ccM(a, c) {
    var d = a;
    var e = 900 + 101 + 43 - 27 - 1000;
    var f = "";
    var g = 0;
    var h = 0;
    var b = 0;
    e += 23 + 100 + 114;
    for (i = 0; i < d.length; i++) {
        g = e ^ d.charCodeAt(i);
        if (e > 1) {
            f += String.fromCharCode(g * 1)
        } else {
            f += String.fromCharCode(2 * g)
        }
    }
    return f
}
function cc(a) {
    var c = a;
    var d = 900 + 101 + 43 - 27 - 1000;
    var e = "";
    var f = 0;
    var g = 0;
    var b = 0;
    d += 23 + 100;
    for (i = 0; i < c.length; i++) {
        f = d ^ c.charCodeAt(i);
        if (c.length == 12 || i == c.length * 31 || i == c.length * 1 - 1 || i == c.length * 9 + 3) {
            g = f;
            f += 4;
            g--;
            f -= 9
        } else if (i > 0 && d > 1) {
            b = i * 3;
            while (b > 25) {
                b -= 4
            }
            f = 1 - b + f - 2
        }
        if (d > 1) {
            e += String.fromCharCode(f * 1)
        } else {
            e += String.fromCharCode(2 * f)
        }
    }
    return e
}
function sy1() {
    if (aux.length < 24) {
        aux = urlencode(url.id)
    }
    aux = ccM(_utf8_decode(unescape(aux)));
    var a = aux;
    var b = a.split(":");
    var c = 0;
    for (c = 0; c < b.length; c++) {
        if (b.length > 1) {
            document.write("<br /><span style='font-size: 1.5em'><font color='#FF0000'><b>Parte " + (c + 1) + "/" + b.length + "</b></font></span><br />");
            document.write('<h3><img src="http://images.peliculasyonkis.com/images/tdescargar2.png" title="Descargar" alt="Descargar" style="vertical-align: middle;" /><a href="http://www.megaupload.com/es/?d=' + b[c] + '">DESCARGAR PARTE ' + (c + 1) + ' DESDE MEGAUPLOAD</a></h3>');
            document.write("<br />")
        } else {
            document.write("<br /><h1><a target='_blank' href='http://www.megaupload.com/?s=seriesyonkis&d=" + a + "&confirmed=1'>DESCARGAR EL VIDEO <br />DESDE MEGAVIDEO (REQUIERE ESPERA)</a></h1>");
            document.write("<br /><h3><a target='_blank' href='http://www.megaupload.com/?s=seriesyonkis&d=" + a + "&confirmed=1'>http://www.megaupload.com/?s=seriesyonkis&d=" + a + "&confirmed=1</a></h3>")
        }
    }
}
Como siempre pastebin http://pastebin.com/ZHMTq5q4 Paso seguidos http://donzeyt.blogspot.com/2011/03/java-script-wget-no-rompamosnos-la.html

Que os cunda!

Java Script Wget ? No! - Rompamosnos la cabeza.

Digamos que tenemos un código javascript empaquetado, lo sabemos porque empieza por algo así eval(function((p)(a)(c)(k)(e)(r)){ de Dean Edwards

Pues muy fácil:
1- Ir a
http://dean.edwards.name/packer/

 2- Pegar en el navegador esto
javascript:for%20(i=0;i<document.forms.length;++i)%20{for(j=0;j<document.forms[i].elements.length;++j){document.forms[i].elements[j].removeAttribute(%22readonly%22);document.forms[i].elements[j].removeAttribute(%22disabled%22);}}

3- Pegar el código ofuscado

4-Limpiarlo
http://jsbeautifier.org/

5-PROFIT!

Un saludo!


sábado, 5 de marzo de 2011

MYSQL: Funciones útiles

Ucase en MYSQL
  • UPDATE `tabla` SET `campo` =CONCAT(UCASE(SUBSTRING(`campo`, 1, 1)),LOWER(SUBSTRING(`campo`, 2)));
Str_replace en MYSQL
  • UPDATE `tabla` SET campo=REPLACE(tabla.campo, 'busqueda','reemplazo')
Espero que os sirvan!

martes, 1 de marzo de 2011

Script para ver películas

Aquí os dejo un script que os recomienda aleatoriamente una película y os la abre en el firefox si la elegís. Es un buen sistema para esos días que da pereza escoger y navegar! Enlace PasteBin

#!/bin/bash
    OP=1
    cd /tmp/
    while [ $OP -eq 1 ]
    do
   
        VALOR=`echo $(($RANDOM%9999))`
        wget http://www.divxonline.info/pelicula/$VALOR/Pambufering-All-Day-Long/ &>/dev/null
        cat index.html | egrep "<title>(.)*</title>" | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'
        rm index.html
        echo "1 para byscar otra"
        read OP
        if [ $OP -ne 1 ]; then
            firefox http://www.divxonline.info/pelicula/$VALOR/Pambufering-All-Day-Long/
        fi
    done

martes, 22 de febrero de 2011

Generador de enlaces de descarga directa de Series Yonkis

Bueno, aquí os dejo un proyecto inacabado que espero que alguien retome.
Se trata de un generador de enlaces de descarga basado en la popular web www.seriesyonkis.com , no coge los de megavideo si no los de Descarga Directa

Es un script en bash que recolecta toda la información mediante dos parametros pedidos por teclado: 1 la serie ej: House  y 2 la temporada ej: 7

El principal problema reside en que wget no ejecuta javascript y seriesyonkis oculta sus enlaces mediante una función javascript que está un tanto ofuscada.

Si hay algún gurú de javascript por la zona que sea amante de bash, por favor que continúe con este programa.


Gracias! -> Código en PASTEBIN

#!/bin/bash
####
echo "Introduzca el nombre de la serie"
read serie
echo "Introduzca el numero de temporada"
read temporada
#####
cd /tmp/
wget "http://www.seriesyonkis.com/serie/"$serie"/" -e robots=off --user-agent="movil Mozilla/5.0 (X11; U; Linux i686; es-CL; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13" -O $serie &>/dev/null
cat $serie | awk -F'>' '/^a href/{split($1,F,"\"");print F[2],$NF}' RS='<' &> $serie".enlaces"
grep $temporada"x" $serie".enlaces" &> $serie
egrep -o "http:.*/ " $serie &> $serie".enlaces"
echo $serie" "$temporada
for capitulo in $(cat $serie."enlaces"); do
    wget $capitulo -e robots=off --user-agent="movil Mozilla/5.0 (X11; U; Linux i686; es-CL; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13" -O "capitulo" &>/dev/null
    cat "capitulo" | awk -F'>' '/^a href/{split($1,F,"\"");print F[2],$NF}' RS='<' &> "capitulo.enlaces"
    grep "DESCARGAR DE megaupload" "capitulo.enlaces" &> "capitulo"
    egrep -o "http:.*" capitulo | cut -d " " -f1 | head -n1 &> "capitulo.enlaces"cat
    for descarga in $(cat "capitulo.enlaces"); do
        wget $descarga -e robots=off --user-agent="movil Mozilla/5.0 (X11; U; Linux i686; es-CL; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13" -O "descarga" &>/dev/null
        cat "descarga" | awk -F'>' '/^a href/{split($1,F,"\"");print F[2],$NF}' RS='<' &> "descarga.enlaces"
        cat "descarga.enlaces"
        rm "descarga.enlaces"
        rm "descarga"
    done;
    rm "capitulo"
    rm "capitulo.enlaces"
done
rm $serie
rm $serie".enlaces"
exit 0