Código: Seleccionar todo
# -*- coding: utf-8 -*-
from core.scrapertools import *
def jjdecode(t):
x = '0123456789abcdef'
j = get_match(t, '^([^=]+)=')
t = t.replace(j + '.','j.')
t = re.sub(r'^.*?"\\""\+(.*?)\+"\\"".*?$', r'\1', t.replace('\\\\','\\')) + '+""'
t = re.sub('(\(!\[\]\+""\)\[j\._\$_\])', '"l"', t)
t = re.sub(r'j\._\$\+', '"o"+', t)
t = re.sub(r'j\.__\+', '"t"+', t)
t = re.sub(r'j\._\+', '"u"+', t)
p = t.split('+')
for e, c in enumerate(p):
if not c.startswith('"'):
try:
d = p[e].split('.')
n = d[1].replace('_','0').replace('$', '1')
if len(n) == 4: p[e] = '"' + x[int(n,2)] + '"'
else: p[e] = d[0] + '.' + n
except: continue
t = "+".join(p)
p = find_multiple_matches(t, '(\\\\"\+[^"]+")')
for e, c in enumerate(p):
a = re.sub(r'j\.', '', c).split('+')[1:-1]
n = int("".join(str(int(o, 2)) for o in a ), 8)
if n >= 128:
n1 = int("".join(str(int(o, 2)) for o in a[0:2]) ,8)
n2 = int("".join(str(int(o, 2)) for o in a[2:]) ,8)
s = chr(n1) + str(n2)
else: s = chr(n)
if c in t: t = t.replace(c, s)
p = find_multiple_matches(t, '("\+j\.[^"]+")')
for e, c in enumerate(p):
n = re.sub(r'j\.', '', c).split('+')[1:-1]
s = "".join(str(int(o, 2)) for o in n)
if c in t: t = t.replace(c, s)
r = t[1:-1].replace('"+"', '')
return r



