How to use the cloudscraper.interpreters.js2py.ChallengeInterpreter function in cloudscraper

To help you get started, we’ve selected a few cloudscraper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github VeNoMouS / cloudscraper / cloudscraper / interpreters / js2py.py View on Github external
def __init__(self):
        super(ChallengeInterpreter, self).__init__('js2py')
github VeNoMouS / cloudscraper / cloudscraper / interpreters / js2py.py View on Github external
logging.warning('WARNING - Please upgrade your js2py https://github.com/PiotrDabkowski/Js2Py, applying work around for the meantime.')
            jsPayload = jsunfuck(jsPayload)

        def atob(s):
            return base64.b64decode('{}'.format(s)).decode('utf-8')

        js2py.disable_pyimport()
        context = js2py.EvalJs({'atob': atob})
        result = context.eval(jsPayload)

        return result


# ------------------------------------------------------------------------------- #

ChallengeInterpreter()