
    ^i                         S r SSKrSSKJr  SSKJrJrJrJr  SSK	r	SSK
JrJr  \R                  " \5      r " S S5      r " S	 S
5      rg)HTTP client.    N)choice)AnyFinalLiteralget_args   )DDGSExceptionTimeoutExceptionc                   6    \ rS rSrSrSrS\S\S\SS4S	 jr	Sr
g)
Response   zHTTP response.)contentstatus_codetextr   r   r   returnNc                 (    Xl         X l        X0l        g )Nr   r   r   )selfr   r   r   s       J/home/james-whalen/.local/lib/python3.13/site-packages/ddgs/http_client.py__init__Response.__init__   s    &	    )__name__
__module____qualname____firstlineno____doc__	__slots__intbytesstrr   __static_attributes__ r   r   r   r      s+    2IC % s t r   r   c            
           \ rS rSr% Sr\" \S   5      r\\	S'   \" \S   5      r
\\	S'   SSS	.S
\S-  S\S-  S\\-  SS4S jjjrS\S\S\4S jrS\S\S\4S jrS\S\S\4S jrSrg)
HttpClient   r   )+
chrome_100
chrome_101
chrome_104
chrome_105
chrome_106
chrome_107
chrome_108
chrome_109
chrome_114
chrome_116
chrome_117
chrome_118
chrome_119
chrome_120
chrome_123
chrome_124
chrome_126
chrome_127
chrome_128
chrome_129
chrome_130
chrome_131
chrome_133zsafari_15.3zsafari_15.5zsafari_15.6.1	safari_16zsafari_16.5zsafari_17.0zsafari_17.2.1zsafari_17.4.1zsafari_17.5	safari_18zsafari_18.2edge_101edge_122edge_127edge_131firefox_109firefox_117firefox_128firefox_133firefox_135_impersonates)macoslinuxwindows_impersonates_osNT)verifyproxytimeoutrO   r   c                    [         R                  " UU[        U R                  5      [        U R                  5      [        U[        5      (       a  UOS[        U[        5      (       a  UOSS9U l        g)a  Initialize the HttpClient object.

Args:
    proxy (str, optional): proxy for the HTTP client, supports http/https/socks5 protocols.
        example: "http://user:pass@example.com:3128". Defaults to None.
    timeout (int, optional): Timeout value for the HTTP client. Defaults to 10.
    verify: (bool | str):  True to verify, False to skip, or a str path to a PEM file. Defaults to True.

TN)rP   rQ   impersonateimpersonate_osrO   ca_cert_file)	primpClientr   rJ   rN   
isinstanceboolr"   client)r   rP   rQ   rO   s       r   r   HttpClient.__init__)   sX     llt112!$"7"78'5564#-fc#:#:
r   argskwargsc                 2    U R                   R                  " U0 UD6n[        UR                  UR                  UR
                  S9$ ! [         aE  nSU ;   a  SU< 3n[        U5      Ue[        U5      R                   SU< 3n[        U5      UeSnAff = f)z"Make a request to the HTTP client.r   z	timed outzRequest timed out: z: N)rZ   requestr   r   r   r   	Exceptionr   typer   r
   )r   r\   r]   respexmsgs         r   r_   HttpClient.request<   s    	-;;&&77D(8(8$,,UYU^U^__ 	-%+B62&s+3"X&&'r"0C$",	-s   AA 
BA BBc                 *    U R                   " USS0UD6$ )z&Make a GET request to the HTTP client.methodGETr_   r   r\   r]   s      r   getHttpClient.getH   s    ||T:%:6::r   c                 *    U R                   " USS0UD6$ )z'Make a POST request to the HTTP client.rg   POSTri   rj   s      r   postHttpClient.postL   s    ||T;&;F;;r   )rZ   )N
   )r   r   r   r   r   r   r   rJ   r   __annotations__rN   r"   r    rY   r   r   r   r_   rk   ro   r#   r$   r   r   r&   r&      s    #G	S
% 
M5 
 'w/J'KLeL
cg 
cDj 
#* 
VZ]`V` 
lp 
&
-S 
-C 
-H 
-; ; ; ;<# < < <r   r&   )r   loggingsecretsr   typingr   r   r   r   rV   
exceptionsr
   r   	getLoggerr   loggerr   r&   r$   r   r   <module>ry      s>       0 0  7			8	$ 5< 5<r   