
    Chn                         d dl Z d dlZd dlZej                  j	                   ej
                               Zedz   Zd ZddZ	d Z
d Zedk(  r e
        yy)	    Nz/config/secret.txtc                  T   t        t        d      5 } t        d       | j                  t	        t
        j                  j                         j                               dz          t        d       | j                  t        j                         dz          d d d        y # 1 sw Y   y xY w)NazEnter your login: :zgEnter your password: (it will not be shown due to security reasons - just start typing and press Enter)
)
openSECRET_FILEprintwritestrsysstdinreadlinestripgetpass)fs    _/var/www/html/Telegram-Engagement-Pod-/env/lib/python3.12/site-packages/instabot/api/prepare.pyadd_credentialsr      sv    	k3	1"#	CII&&(..01C78=	
 	
!D() 
 		s   BBB'c                 d   t               s	 t               s	 	 t        t        d      5 }|j                         D cg c]"  }|j	                         j                  dd      $ }}ddd       | #D ]  \  }}|| j	                         k(  s||fc S  t        d       t              D ]  \  }\  }}t        d|dz   |fz          t        dd	z         t        dd
z         	 t        t        j                  j                               }|dk(  rt                |dk(  rt!                t                d|dz
  cxk  rt#        |      k  rn n||dz
     S Bc c}w # 1 sw Y   xY w# t        $ r! d}t        |j                  t                    w xY w# t        $ r t        d       Y Vw xY w)z2Returns login and password stored in `secret.txt`.rr      Nz0Problem with opening `{}`, will remove the file.z/Which account do you want to use? (Type number)z%d: %s   )r   zadd another account.)zdelete all accounts.r   r   z4Wrong input, enter the number of the account to use.)check_secretr   r   	readlinesr   split
ValueError	Exceptionformatr	   	enumerateintr   r   r   r   delete_credentialslen)usernamer   linelinesmsgloginpasswordinds           r   get_credentialsr*      s   n n
	5k3'1@AN++C3N (
 #(xHNN,, (?* $) 	?@&/&6"C"%(cAgu--. '7h445h556	Jcii((*+Cax!"$cAg*E
*S1W~%5  O (' 	5DCCJJ{344	5.  	JHI	JsQ   E+ E'E#E%E+ #6F F 6!F EE($E+ +*FF/.F/c                     	 t         j                  j                  t              rt	        t        d      5 } 	 | j                         j                         j                  d      \  }}t        |      dk  st        |      dk  r%t        d       t        j                  t               n
	 d d d        y	 d d d        nUt        dt        z         t        d	       	 t                t        d
       dt        j                  j                         vrn7# t        $ r' t        d       t        j                  t               Y w xY w# 1 sw Y   >xY w)NTr   r         zFData in `secret.txt` file is invalid. We will delete it and try again.z5Your file is broken. We will delete it and try again.z^We need to create a text file '%s' where we will store your login and password from Instagram.z'Don't worry. It will be stored locally.z)Do you want to add another account? (y/n)y)ospathexistsr   r   r   r   r   r"   r	   remover   r   r   r   )r   r'   r(   s      r   r   r   9   s   
77>>+&k3'1+&'jjl&8&8&:&@&@&EOE85zA~X):?
 		+.# (' / ('" HJUV ;<!ABcii0022	 1  ! +VWIIk*+ ('s/   EA1D2E-E EEEEc                  ~    t         j                  j                  t              rt        j                  t               y y N)r/   r0   r1   r   r2        r   r!   r!   Y   s#    	ww~~k"
		+ #r6   __main__r4   )r   r/   r   r0   abspathgetcwdcurrent_pathr   r   r*   r   r!   __name__r5   r6   r   <module>r<      s`     	 
wwyryy{+11* JF@
 zN r6   