Fix Cloudscraper

ritornati alla vecchia versione di js2py
modificata versione 1.1.24 di cloudscrape
This commit is contained in:
Alhaziel
2019-12-02 11:35:50 +01:00
parent 89764d0a7d
commit 6abff904d4
19 changed files with 11392 additions and 13822 deletions
+3
View File
@@ -15,6 +15,9 @@ class ChallengeInterpreter(JavaScriptInterpreter):
super(ChallengeInterpreter, self).__init__('js2py')
def eval(self, jsEnv, js):
### blocca lo script
# from core.support import dbg; dbg()
if js2py.eval_js('(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]') == '1':
logging.warning('WARNING - Please upgrade your js2py https://github.com/PiotrDabkowski/Js2Py, applying work around for the meantime.')
js = jsunfuck(js)
+9 -5
View File
@@ -1,10 +1,14 @@
import base64
import logging
import subprocess
import sys
from . import JavaScriptInterpreter
# ------------------------------------------------------------------------------- #
##########################################################################################################################################################
BUG_REPORT = 'Cloudflare may have changed their technique, or there may be a bug in the script.'
##########################################################################################################################################################
class ChallengeInterpreter(JavaScriptInterpreter):
@@ -33,10 +37,10 @@ class ChallengeInterpreter(JavaScriptInterpreter):
)
raise
except Exception:
sys.tracebacklimit = 0
raise RuntimeError('Error executing Cloudflare IUAM Javascript in nodejs')
logging.error('Error executing Cloudflare IUAM Javascript. %s' % BUG_REPORT)
raise
pass
# ------------------------------------------------------------------------------- #
ChallengeInterpreter()
+1 -7
View File
@@ -10,23 +10,17 @@ except ImportError:
from . import JavaScriptInterpreter
# ------------------------------------------------------------------------------- #
class ChallengeInterpreter(JavaScriptInterpreter):
def __init__(self):
super(ChallengeInterpreter, self).__init__('v8')
# ------------------------------------------------------------------------------- #
def eval(self, jsEnv, js):
try:
return v8eval.V8().eval('{}{}'.format(jsEnv, js))
except (TypeError, v8eval.V8Error):
except: # noqa
RuntimeError('We encountered an error running the V8 Engine.')
# ------------------------------------------------------------------------------- #
ChallengeInterpreter()