+
    Ri              
         a  R t%0 t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIHt ^ RIHtHt R R ltR]! 4       /t] ^ k R]P,                  9   d   ]! ]P,                  R,          P1                  4       4      ^ 8  d   ]P,                  R,          P1                  4       t]P4                  ! R]4      t]eu   ]P8                  ! ]P:                  ]P=                  R	4      ]! ]P=                  R
4      4      R]P=                  R4      ]P=                  R4      4       ]P@                  ]n        ]PB                  t"/ RRR3R R llt#RR R llt$R# )    N)Mapping)AnyOptionalc                $    V ^8  d   QhR\         /# )   return)str)formats   "$/config/qBittorrent/nova3/helpers.py__annotate__r   /   s     q qS q    c                     \         P                  ! R^^4      p ^}p\         P                  P                  4       pWV ,
          P                  ^,          ,           pRV RV R2# )z3Disguise as browser to circumvent website blocking i  z-Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:z.0) Gecko/20100101 Firefox/z.0)datetimedatetodaydays)baseDatebaseVersionnowDate
nowVersions       r   getBrowserUserAgentr   /   s^     }}T1b)HKmm!!#G8!3 9 9R ?@J::,Fablammoppr   z
User-Agent
sock_proxyzL^(?:(?P<username>[^:]+):(?P<password>[^@]+)@)?(?P<host>[^:]+):(?P<port>\w+)$hostportTusernamepasswordc                    V ^8  d   QhR\         R\        \         \        3,          R\        \        ,          R\        \        P
                  ,          R\        R\         /# )r   urlcustom_headersrequest_datassl_contextunescape_html_entitiesr   )r	   r   r   r   ssl
SSLContextbool)r
   s   "r   r   r   P   sm      c 738+< QYZ]Q^ t|  ~A  ~L  ~L  uM   nr   ~A r   c           	     b   \         P                  P                  W/ \        CVC4      p \         P                  P	                  WSR7      pTP                  4       pTR,          R8X  d`   \        P                  ! T4      ;_uu_ 4       p	\        P                  ! T	R7      ;_uu_ 4       p
T
P                  4       pRRR4       RRR4       R	p TP!                  R
R4      P#                  R^4      ^,          pTP'                  TR4      pT'       d   \(        P*                  ! T4      pT#   \         P
                  P                   d4   p\        RTP                   2\        P                  R7        Rp?R# Rp?ii ; i  + '       g   i     L; i  + '       g   i     L; i  \$         d     Li ; i)z/Return the content of the url page as a string contextzConnection error: )fileN Nr   N   fileobjzutf-8zContent-Typezcharset=replace)urllibrequestRequestheadersurlopenerrorURLErrorprintreasonsysstderrreadioBytesIOgzipGzipFile	getheadersplit
IndexErrordecodehtmlunescape)r   r   r    r!   r"   r1   responseerrnodatacompressedStreamgzippercharsetdataStrs   &&&&&        r   retrieve_urlrM   P   sI    nn$$S8U78Un8UVG>>))')G --/D Bx;ZZ!14==IY3Z3Z^e<<>D 4[ G$$^R8>>z1MaP kk'9-G--(N- <<   "5<<.1

C 4[3Z  sM    D%  F&E:	7F
)F  %E7(E22E7:F
FF	 F.-F.c                    V ^8  d   QhR\         R\        \         ,          R\        \        P                  ,          R\         /# )r   r   refererr!   r   )r	   r   r#   r$   )r
   s   "r   r   r   o   s9      s Xc] QTQ_Q_H` lo r   c           	        \         P                  P                  V \        R7      pVe   VP	                  RV4       \         P                  P                  W2R7      pVP                  4       pVR,          R8X  d`   \        P                  ! V4      ;_uu_ 4       p\        P                  ! VR7      ;_uu_ 4       pVP                  4       pRRR4       RRR4       \        P                  ! 4       w  r\        P                  ! VR4      ;_uu_ 4       p
V
P                  V4       RRR4       V	 R	V  2#   + '       g   i     Lo; i  + '       g   i     Lz; i  + '       g   i     L=; i)
zUDownload file at url and write it to a file, return the path to the file and the url )r3   NrO   r'   r+   r,   r-   wb )r0   r1   r2   r3   
add_headerr4   r;   r<   r=   r>   r?   tempfilemkstemposfdopenwrite)r   rO   r!   r1   rF   rH   rI   rJ   
fileHandlepathr)   s   &&&        r   download_filer[   o   s     nn$$S'$:G9g.~~%%g%CH==?D Bx;ZZ!14==IY3Z3Z^e<<>D 4[  '')J	:t	$	$

4 
% V1SE? 4[3Z
 
%	$s0    E8D0		EE0E ;EE	E&	c                b    V ^8  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   # )r   r3   )__conditional_annotations__dictr	   r   )r
   s   "r   r   r      s#    B @ ?c3h ?C r   )NN)&r]   r   r>   rD   r<   rV   resocketsocksr#   r9   rT   urllib.errorr0   urllib.requestcollections.abcr   typingr   r   r   r3   environlenstrip	proxy_strmatchmsetdefaultproxyPROXY_TYPE_SOCKS5groupint
socksocketrE   htmlentitydecoderM   r[   r   )r]   s   @r   <module>rr      s6  <    	 	 	   
 
    #  q  ()<)>? ? 2::#bjj&>&D&D&F"G!"K

<(..0I
`	A}e55qwwv!!''&/2D!''*:MqwwWaOb	d(( ==  @Bae  PT  uy > r   