
    i$                     X    S SK r S SKrS SKrSSKJr  SSKJr   " S S\5      r\" 5         g)    N   )JavaScriptInterpreter)templatec                   .   ^  \ rS rSrU 4S jrS rSrU =r$ )ChallengeInterpreter   c                 ,   > [         [        U ]  S5        g )Nnodejs)superr   __init__)self	__class__s    M/app/mltbenv/lib/python3.13/site-packages/cloudscraper/interpreters/nodejs.pyr   ChallengeInterpreter.__init__   s    "D28<    c                 P    S[         R                  " [        X5      R                  S5      5      R	                  S5      -  n[
        R                  " SSU/5      $ ! [         a!  nUR                  S:X  a  [        S5      ee S nAf[         a    S[        l        [        S	5      ef = f)
Na1  var atob = function(str) {return Buffer.from(str, "base64").toString("binary");};var challenge = atob("%s");var context = {atob: atob};var options = {filename: "iuam-challenge.js", timeout: 4000};var answer = require("vm").runInNewContext(challenge, context, options);process.stdout.write(String(answer));zUTF-8asciinodez-e   al  Missing Node.js runtime. Node is required and must be in the PATH (check with `node -v`).

Your Node binary may be called `nodejs` rather than `node`, in which case you may need to run `apt-get install nodejs-legacy` on some Debian-based systems.

(Please read the cloudscraper README's Dependencies section: https://github.com/VeNoMouS/cloudscraper#dependencies.)r   z4Error executing Cloudflare IUAM Javascript in nodejs)base64	b64encoder   encodedecode
subprocesscheck_outputOSErrorerrnoEnvironmentError	ExceptionsystracebacklimitRuntimeError)r   bodydomainjses        r   evalChallengeInterpreter.eval   s    	W9 ##HT$:$A$A'$JKRRSZ[\B **FD"+=>> 		ww!|&N   	W!"CUVV	Ws   AA 
B%%B$B% )__name__
__module____qualname____firstlineno__r   r'   __static_attributes____classcell__)r   s   @r   r   r      s    =
W Wr   r   )r   r   r     r   encapsulatedr   r   r)   r   r   <module>r2      s,      
 # "
!W0 !WL  r   