raw_data_regex = re.search(r'(?:var _0x3320=)(?P<array>[\d\D]+?)(?:;[\d\D]+?_0x3320,)(?P<shuffle>[\d\D]+)(?:\)\);)(?:[\d\D]+\]\(\([\d\D]+?\?)(?P<iftrue>[\d\D]+?)(?:\:)(?P<iffalse>[\d\D]+?)(?:\)[\d\D]+?\+)(?P<addition>[\d\D]+?)(?:\)[\d\D]+?-)(?P<subtraction>[\d\D]+?)(?:\))', resp.text)
raw_data = raw_data_regex.group("array")
shuffle = int(raw_data_regex.group("shuffle"), 16)
if_true = int(raw_data_regex.group("iftrue"), 16)
if_false = int(raw_data_regex.group("iffalse"), 16)
add_unconditionally = int(raw_data_regex.group("addition"), 16)
sub_unconditionally = int(raw_data_regex.group("subtraction"), 16)
b64 = json.loads(raw_data.replace("\'", "\""))
b64 = b64[1] if b64[0] == "fromCharCode" else b64[0]
tmp = []
for c in b64:
# Only run the deobfuscator if it's a character
if c.isalpha():
n = if_true if c <= "Z" else if_false
c = ord(c) + add_unconditionally
tmp.append(chr(c) if n >= c else chr(c - sub_unconditionally))
else:
tmp.append(c)
decoded = json.loads(base64.b64decode("".join(tmp)))
I see through your bullshit, JB.
Anyway, they have an API that's very bare but works for getting chapter pages, so that monstrosity is now 2 lines.
Also, meta tag changes and cache timing changes for the pages.
Gonna just leave this one in for posterity.
I see through your bullshit, JB.
Anyway, they have an API that's very bare but works for getting chapter pages, so that monstrosity is now 2 lines.
Also, meta tag changes and cache timing changes for the pages.