Skip to content

Commit

Permalink
Update seemh, fix #35
Browse files Browse the repository at this point in the history
  • Loading branch information
eight04 committed Mar 6, 2017
1 parent a8906d9 commit cceed3f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions comiccrawler/mods/seemh.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,21 @@ def get_images(html, url):
html
).group(1)
configjs = grabhtml(configjs_url, referer=url)
crypto = re.search(r"(var CryptoJS.+?)var pVars", configjs, re.S).group(1)
crypto = re.search(
r'^(var CryptoJS|window\["\\x65\\x76\\x61\\x6c"\]).+',
configjs,
re.MULTILINE
).group()

info_eval = re.search(
r'<script type="text/javascript">(eval[^<]+)',
r'<script type="text/javascript">((eval|window\["\\x65\\x76\\x61\\x6c"\]).+?)</script',
html
).group(1)

ctx = execjs.compile(crypto + info_eval)
js = "var window = global;" + crypto + info_eval
# with open("seemh.js", "w", encoding="utf-8") as f:
# f.write(js)
ctx = execjs.compile(js)
files, path = ctx.eval("[cInfo.files, cInfo.path]")

# find server
Expand Down

0 comments on commit cceed3f

Please sign in to comment.