HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/tldextract/__pycache__/remote.cpython-37.pyc
B

��f�	�@s�UdZddlmZddlZddlmZddlmZmZddl	m
Z
ded<ydd	lm
Z
mZmZWnek
rzdZYnXe�d
�Zee
�Zddd�d
d�Zddd�dd�Zefdddd�dd�Zefdddd�dd�ZdS)z=tldextract helpers for testing and fetching remote resources.�)�annotationsN)�Callable)�AddressValueError�IPv6Address)�scheme_charsz"Callable[[int, str], bytes] | None�	inet_pton)�AF_INET�AF_INET6rzi^(([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])$�str)�url�returncCs�t|��d�d�d�d�d�d�d�d}|rd|ddkrd|�d�}|d	dkrd|d�d�S|�d
�d��}|�d�}|S)z�Extract 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)rZafter_userinfoZ
maybe_ipv6�hostnameZwithout_root_label�r�B/opt/alt/python37/lib/python3.7/site-packages/tldextract/remote.py�lenient_netlocs





rcCsb|�d�}|dkr|dd�S|dksN||ddkrNt|d|d��trR|S||dd�S)Nz//r�rr)�find�set�scheme_chars_set)rZdouble_slashes_startrrrr1s
r�bool)�maybe_ip�ptonrcCsJ|d��sdS|dk	r<y|t|�dStk
r:dSXt�|�dk	S)z5Check whether the given str looks like an IP address.rFNT)�isdigitr�OSError�IP_RE�	fullmatch)r$r%rrr�
looks_like_ip>s
r*cCsR|dk	r,y|t|�dStk
r*dSXyt|�Wntk
rLdSXdS)z7Check whether the given str looks like an IPv6 address.NTF)r	r'rr)r$r%rrr�looks_like_ipv6Ns
r+)�__doc__�
__future__r�re�collections.abcr�	ipaddressrr�urllib.parser�__annotations__�socketrr	r�ImportError�compiler(r!r"rrr*r+rrrr�<module>s"