
    vKg              	       
   S SK r S SKrS SKJrJr  S SKJrJr  S SKJr  S SK	J
r
  \
R                  r\
R                  r " S S\R                  5      r  SS\S	\S
\\
R&                     S\4S jjrS\\\4   S\4S jrS rS rg)    N)OptionalTuple)connectionsversionflow)httpc                   r  ^  \ rS rSr% Sr\\S'   Sr\\	   \S'   Sr
\\R                     \S'    \R                  \S'   \R                  \S'   S	r\\S
'    \\S'    SU 4S jjr\R(                  R*                  R-                  5       r\R/                  \" \\	\S95        S r\S\4S j5       rU 4S jrSrU =r$ )HTTPFlow   zP
An HTTPFlow is a collection of objects representing a single HTTP
transaction.
requestNresponseerrorserver_connclient_connFinterceptedmodec                 4   > [         TU ]  SXU5        X@l        g )Nr	   )super__init__r   )selfr   r   liver   	__class__s        f/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/seleniumwire/thirdparty/mitmproxy/http.pyr   HTTPFlow.__init__!   s    4@	    )r   r   r   c                     SnS H$  n[        XS5      (       d  M  USU< SU< S3-  nM&     US-  nUR                  U S9$ )	Nz	<HTTPFlow)r   r   r   r   r   Fz
  z	 = {flow.}>r   )getattrformat)r   sas      r   __repr__HTTPFlow.__repr__-   sJ    OAt&&q!44 P 	
SxxTx""r   returnc                 .    U R                   R                  $ N)r   timestamp_start)r   s    r   r)   HTTPFlow.timestamp_start5   s    ||+++r   c                    > [         TU ]  5       nU R                  (       a  U R                  R                  5       Ul        U R                  (       a  U R                  R                  5       Ul        U$ r(   )r   copyr   r   )r   fr   s     r   r,   HTTPFlow.copy9   sI    GLN<<))+AI==++-AJr   )r   )Nregular)__name__
__module____qualname____firstlineno____doc__HTTPRequest__annotations__r   r   HTTPResponser   r   Errorr   ServerConnectionClientConnectionr   boolstrr   Flow_stateobject_attributesr,   updatedictr$   propertyfloatr)   __static_attributes____classcell__)r   s   @r   r   r      s     '+Hh|$+"&E8DJJ&
 ------K5
IM #ii??DDF""4$ # , , , r   r   status_codemessageheadersr&   c           	         SR                  5       R                  U [        R                  R                  R                  U S5      [        R                  " U5      S9R                  SS5      nU(       d7  [        R                  " [        R                  S[        [        U5      5      SS9n[        R                  XU5      $ )	Nz
        <html>
            <head>
                <title>{status_code} {reason}</title>
            </head>
            <body>
            <h1>{status_code} {reason}</h1>
            <p>{message}</p>
            </body>
        </html>
    Unknown)rE   reasonrF   utf8replaceclosez	text/html)Server
ConnectionContent_LengthContent_Type)stripr!   r	   status_codes	RESPONSESgethtmlescapeencodeHeadersr   	MITMPROXYr<   lenr7   make)rE   rF   rG   bodys       r   make_error_responser^   B   s    

 	  **..{IFG$   fVY 	  ,,$$s4y>$	
 [88r   addressc                     [        U S   U S   SSU S    SU S    3R                  5       SS[        R                  " 5       SS [        R                  " 5       [        R                  " 5       S9$ )Nr      s   CONNECTr   :s   HTTP/1.1)hostportmethodscheme	authoritypathhttp_versionrG   contenttrailersr)   timestamp_end)r5   rX   r	   rY   time)r_   s    r   make_connect_requestrn   b   si    QZQZQZL'!*.557 		iik r   c                     [        U SS[        R                  " 5       SS [        R                  " 5       [        R                  " 5       5      $ )N   s   Connection establishedr   )r7   r	   rY   rm   )ri   s    r   make_connect_responserq   s   s;     !					 	r   c                  ,    [         R                  S5      $ )Nd   )r7   r\    r   r   make_expect_continue_responseru      s    S!!r   ) N)rV   rm   typingr   r   !seleniumwire.thirdparty.mitmproxyr   r   r   %seleniumwire.thirdparty.mitmproxy.netr	   Requestr5   Responser7   r=   r   intr<   rY   r^   rn   rq   ru   rt   r   r   <module>r}      s      " B 2 6ll}}2tyy 2n *.999 $,,'9 	9@%S/ k ""r   