
    }i                     .   d dl Z d dlZd dlZd dlZej
                  Zej                  j                  Z	de
fdZ e       Ze j                  j                  e j                  j                  e j                  j!                  e            d      Zde
de
fdZy)    Nreturnc                      t         j                  dk(  rdnd} t         j                  dk(  rt        n#t         j                  j	                  t        d      }t         j                  j	                  |d| z         S )Nntz.exe binnode)osnameNODE_DIRpathjoin)suffixbin_dirs     G/usr/local/lib/python3.12/dist-packages/pytubefix/botGuard/bot_guard.py
_node_pathr   
   sL    ww$VBF''T/hrww||He/LG77<<&11    zvm/botGuard.jsvideo_idc                 D   	 t        j                  t        t        | gt         j                        j                         }|j                  dd      S # t         j                  $ r:}t        d|j                  j                         j                                |d}~ww xY w)z;
    Run nodejs to generate poToken through botGuard.

    )stderr
r   zFailed to execute botGuard.js: N)
subprocesscheck_output	NODE_PATHVM_PATHPIPEdecodereplaceCalledProcessErrorRuntimeErrorr   strip)r   resultes      r   generate_po_tokenr#      s    
	((*??
 &( 	 ~~dB''(( -ahhoo.?.E.E.G-HI
	s   AA B%5BB)r	   r   sysnodejs_wheel.executablenodejs_wheelplatformPLATFORM
executableROOT_DIRr   strr   r   r   r   dirnamerealpath__file__r   r#    r   r   <module>r0      s    	  
 <<""++2C 2
 L	
'',,rwwrww'7'7'ABDT
U  r   