
    !h                        S r SSKJr  SSKrSSKJrJr  SSKJr  \R                  " S\R                  5      r\" \5      rSS jrSS jrSS	 jrSS
 jrg)z=tldextract helpers for testing and fetching remote resources.    )annotationsN)AddressValueErrorIPv6Address)scheme_charszo^(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$c                v   [        U 5      R                  S5      S   R                  S5      S   R                  S5      S   R                  S5      S   nU(       a+  US   S:X  a"  UR                  S5      nUS	   S:X  a  US    S3$ UR                  S
5      S   R                  5       nUR	                  S5      nU$ )zExtract the netloc of a URL-like string.

Similar to the netloc attribute returned by
urllib.parse.{urlparse,urlsplit}, but extract more leniently, without
raising errors.
/r   ?#@[]   :u
   .。．｡)_schemeless_url	partition
rpartitionstriprstrip)urlafter_userinfo
maybe_ipv6hostnamewithout_root_labels        X/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/tldextract/remote.pylenient_netlocr      s     		3		3	 
3	 
C		  .+s2#--c2
a=C m_A&&'',Q/557H!)>?    c                    U R                  S5      nUS:X  a  U SS  $ US:  d(  XS-
     S:w  d  [        U S US-
   5      [        -
  (       a  U $ XS-   S  $ )Nz//r      r   r   )findsetscheme_chars_set)r   double_slashes_starts     r   r   r   +   sm    88D>q 12wq a'(C/s-)A-./2BB
a')**r   c                b    U S   R                  5       (       d  g[        R                  U 5      SL$ )z7Check whether the given str looks like an IPv4 address.r   FN)isdigitIP_RE	fullmatchmaybe_ips    r   looks_like_ipr*   8   s,    A;  ??8$D00r   c                <     [        U 5        g! [         a     gf = f)z7Check whether the given str looks like an IPv6 address.FT)r   r   r(   s    r   looks_like_ipv6r,   @   s(    H   s    
)r   strreturnr-   )r)   r-   r.   bool)__doc__
__future__r   re	ipaddressr   r   urllib.parser   compileASCIIr&   r!   r"   r   r   r*   r,    r   r   <module>r8      sO    C " 	 4 %


>HH	 |$ 2
+1r   