ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/aiohttp/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/aiohttp/__pycache__/cookiejar.cpython-311.pyc

�

�܋f�6��:�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZddlmZddlmZmZmZmZmZmZmZmZmZmZmZddlmZddlm Z m!Z!dd	l"m#Z#dd
l$m%Z%m&Z&m'Z'dZ(ee)dfZ*Gd
�de ��Z+Gd�de ��Z,dS)�N)�defaultdict)�
BaseCookie�Morsel�SimpleCookie)�ceil)�DefaultDict�Dict�Iterable�Iterator�List�Mapping�Optional�Set�Tuple�Union�cast)�URL�)�AbstractCookieJar�ClearCookiePredicate)�
is_ip_address)�LooseCookies�PathLike�StrOrURL)�	CookieJar�DummyCookieJar�Morsel[str]c���eZdZdZejd��Zejd��Zejd��Zejdej	��Z
ejd��Zee
j
j�e
jj��������dz
Z	ejeje����n%#eef$rejd	��ZYne$rd
ZYnwxYwedz
Zddd
d
d�dededeeeed
fde e!j"dd
f
�fd�Z#de$dd
fd�Z%de$dd
fd�Z&d1de e'dd
fd�Z(de)dd
fd�Z*d2d�Z+defd�Z,d3d�Z-d e.de)d!e)d"e)dd
f
d#�Z/e0��fd$e1d%e0dd
fd&�Z2e0��fd'e0dd(fd)�Z3e4de)d*e)defd+���Z5e4d,e)d-e)defd.���Z6e7d/e)de efd0���Z8�xZ9S)4rz/Implements cookie storage adhering to RFC 6265.z][\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]*(?P<token>[\x00-\x08\x0A-\x1F\d:a-zA-Z\x7F-\xFF]+)z(\d{1,2}):(\d{1,2}):(\d{1,2})z	(\d{1,2})zG(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec)z	(\d{2,4}))�tzinfor)	i�����;r#���r$r$i���FTN)�unsafe�quote_cookie�treat_as_secure_origin�loopr%r&r'r(�returnc���t���|���tt��|_t��|_||_||_|�g}not|t��r|���g}nDt|t��r#t|�����g}nd�|D��}||_
ttj����|_i|_dS)N�r(c��g|]L}t|t��r!t|�����n|�����MS�)�
isinstance�strr�origin)�.0�urls  �H/opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/cookiejar.py�
<listcomp>z&CookieJar.__init__.<locals>.<listcomp>bsT��&�&�&��&0��S�%9�%9�K��C�����!�!�!�s�z�z�|�|�&�&�&�)�super�__init__rr�_cookies�set�_host_only_cookies�_unsafe�
_quote_cookier.rr0r/�_treat_as_secure_originr�time�_next_expiration�_expirations)�selfr%r&r'r(�	__class__s     �r3r7zCookieJar.__init__Ls���	�����d��#�#�#�DO��E
�E
��
�9<��������)���!�)�%'�"�"�
�.��
4�
4�	�&<�&C�&C�&E�&E�%F�"�"�
�.��
4�
4�	�&)�*@�&A�&A�&H�&H�&J�&J�%K�"�"�&�&�1�&�&�&�"�(>��$�'+�D�I�K�K�'8�'8���?A����r5�	file_pathc���tj|��}|�d���5}tj|j|tj��ddd��dS#1swxYwYdS)N�wb��mode)�pathlib�Path�open�pickle�dumpr8�HIGHEST_PROTOCOL�rArC�fs   r3�savezCookieJar.savejs����L��+�+�	�
�^�^��^�
&�
&�	C�!��K��
�q�&�*A�B�B�B�	C�	C�	C�	C�	C�	C�	C�	C�	C�	C�	C�	C����	C�	C�	C�	C�	C�	Cs�&A�A"�%A"c��tj|��}|�d���5}tj|��|_ddd��dS#1swxYwYdS)N�rbrF)rHrIrJrK�loadr8rNs   r3rSzCookieJar.loados����L��+�+�	�
�^�^��^�
&�
&�	+�!�"�K��N�N�D�M�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+�	+�	+s�A�A�A�	predicatec�P�|�rttj����|_|j���|j���|j���dSg}tj��}|j���D]a\\}}}|���D]D\}}|||f}	|	|jvr|j|	|ks||��r|�|	���E�b|D]^\}}}|j�	||f��|||f}	|	|jvr|j|||f=|j||f�
|d���_|jr-tg|j����|j
�R�dzn|j|_dS)Nr)rr>r?r8�clearr:r@�items�append�discard�pop�min�values�SUB_MAX_TIME�MAX_TIME)
rArT�to_del�now�domain�path�cookie�name�morsel�keys
          r3rVzCookieJar.clearts�����$(�����$5�$5�D�!��M���!�!�!��#�)�)�+�+�+���#�#�%�%�%��F����i�k�k��&*�m�&9�&9�&;�&;�	'�	'�"�N�V�T�F� &�����
'�
'���f��t�T�*���4�,�,�,��1B�3�1G�3�1N�1N��Y�v�&�&�2O��M�M�#�&�&�&��
'�#)�	:�	:��F�D�$��#�+�+�V�T�N�;�;�;��4��&�C��d�'�'�'��%�v�t�T�&:�;��M�6�4�.�)�-�-�d�D�9�9�9�9�� �
�C�?��"�)�)�+�+�?�T�->�?�?�?�!�C�C���	
���r5rac�<�������fd���dS)Nc�<�����|d��S)Nra)�_is_domain_match)�xrarAs ��r3�<lambda>z(CookieJar.clear_domain.<locals>.<lambda>�s���T�2�2�6�1�X�;�G�G�r5�rV�rAras``r3�clear_domainzCookieJar.clear_domain�s)�����
�
�G�G�G�G�G�H�H�H�H�Hr5�Iterator[Morsel[str]]c#�K�|���|j���D]}|���Ed{V���dS�N)�_do_expirationr8r\)rA�vals  r3�__iter__zCookieJar.__iter__�sb�����������=�'�'�)�)�	$�	$�C��z�z�|�|�#�#�#�#�#�#�#�#�	$�	$r5c�4�td�|D����S)Nc3�K�|]}dV��dS)rNr-)r1�is  r3�	<genexpr>z$CookieJar.__len__.<locals>.<genexpr>�s"����#�#��1�#�#�#�#�#�#r5)�sum�rAs r3�__len__zCookieJar.__len__�s���#�#�d�#�#�#�#�#�#r5c�2�|�d���dS)Nc��dS)NFr-)rjs r3rkz*CookieJar._do_expiration.<locals>.<lambda>�s��U�r5rlrzs r3rrzCookieJar._do_expiration�s���
�
�?�?�#�#�#�#�#r5�whenrbrdc�T�t|j|��|_||j|||f<dSrq)r[r?r@)rAr~rarbrds     r3�_expire_cookiezCookieJar._expire_cookie�s1�� #�D�$9�4� @� @���26���6�4��.�/�/�/r5�cookies�response_urlc��|j}|jst|��rdSt|t��r|���}|D�]�\}}t|t��st��}|||<||}|d}|�d��rd}|d=|s%|�#|j	�
||f��|x}|d<|�d��r|dd�}||d<|r|�||��s��|d}|r|�d��sD|j
}|�d��sd}n d|d|�d���z}||d<|d}	|	rg	t|	��}
t!t#j��|
z|j��}|�||||��nT#t($rd|d<YnCwxYw|d	}|r5|�|��}
|
r|�|
|||��nd|d	<||j||f|<���|���dS)
zUpdate cookies.Nra�.�rrb�/zmax-age�expires)�raw_hostr;rr.r
rWrr�endswithr:�add�
startswithrirb�rfind�intr[r>r^r��
ValueError�_parse_dater8rr)rAr�r��hostnamerdrc�tmprarb�max_age�
delta_seconds�max_age_expirationr��expire_times              r3�update_cookieszCookieJar.update_cookies�s����(���|�	�
�h� 7� 7�	��F��g�w�'�'�	&��m�m�o�o�G�#�9	9�9	9�L�D�&��f�f�-�-�
#�"�n�n��"��D�	��T����H�%�F����s�#�#�
%����8�$��
5�h�2��'�+�+�X�t�,<�=�=�=�,4�4����)�� � ��%�%�
*�������#)��x� ��
�� 5� 5�f�h� G� G�
���&�>�D��
&�t���s�3�3�
&�#�(�����s�+�+�;��D�D���a�$�*�*�S�/�/�&9�!:�:�D�!%��v���Y�'�G��
/�+�$'��L�L�M�),�T�Y�[�[�=�-H�$�-�)X�)X�&��'�'�(:�F�D�$�O�O�O�O��!�+�+�+�(*�F�9�%�%�%�+����!��+���/�"&�"2�"2�7�";�";�K�"�/��+�+�K���t�L�L�L�L�,.��y�)�28�D�M�6�4�.�)�$�/�/��������s�5AG�G�G�request_url�BaseCookie[str]c	��|jrt��n
t��}|js|S|���|js|St|��}|jpd}|jdv}|rc|jr\t��}tj
t��5|���}ddd��n#1swxYwY||jv}t|d����D]�}|j}|d}|s|j||<�|jst#|��r�5||f|jvr||kr�Gn|�||��s�_|�|j|d��s��|r	|dr��t-d	|�|jt1������}	|	�|j|j|j��|	||<��|S)
z8Returns this jar's cookies filtered by their attributes.r�)�https�wssNc�,�t|d��S)Nrb)�len)�cs r3rkz*CookieJar.filter_cookies.<locals>.<lambda>s���Q�v�Y���r5)rfrarb�securer)r<rrr8rrrr��schemer=�
contextlib�suppressr�r0�sortedrf�valuer;rr:ri�_is_path_matchrbr�getrr9�coded_value)
rAr��filteredr��
is_not_secure�request_originrcrdra�mrsl_vals
          r3�filter_cookieszCookieJar.filter_cookies�sM��#�0�B�L�N�N�N�j�l�l�	��}�	��O��������}�	��O��+�&�&���'�-�2��#�*�2B�B�
��	O�T�9�	O� �U�U�N��$�Z�0�0�
6�
6�!,�!3�!3�!5�!5��
6�
6�
6�
6�
6�
6�
6�
6�
6�
6�
6����
6�
6�
6�
6�*�$�2N�N�M��T�'?�'?�@�@�@�	&�	&�F��:�D��H�%�F��
�!'�������<�
�M�(�$;�$;�
����~��!8�8�8��X�%�%��&��*�*�6�8�<�<�
���&�&�{�'7����H�H�
���
���!1�
���M�6�:�:�f�j�&�(�(�+K�+K�L�L�H��L�L���V�\�6�3E�F�F�F�%�H�T�N�N��s�B<�<C�Cr�c��||krdS|�|��sdS|dt|���}|�d��sdSt|��S)z0Implements domain matching adhering to RFC 6265.TFNr�)r�r�r)rar��non_matchings   r3rizCookieJar._is_domain_match$sq���v����4�� � ��(�(�	��5���3�v�;�;�,��/���$�$�S�)�)�	��5� ��*�*�*�*r5�req_path�cookie_pathc���|�d��sd}||krdS|�|��sdS|�d��rdS|t|��d�}|�d��S)z.Implements path matching adhering to RFC 6265.r�TFN)r�r�r�)r�r�r�s   r3r�zCookieJar._is_path_match4s����"�"�3�'�'�	��H��{�"�"��4��"�"�;�/�/�	��5�����$�$�	��4���K� 0� 0� 2� 2�3���&�&�s�+�+�+r5�date_strc��|sdSd}d}d}d}dx}x}}d}	d}
d}|j�|��D�]}|�d��}
|sA|j�|
��}|r%d}d�|���D��\}}}�[|s@|j�|
��}|r$d}t|�����}	��|s/|j�|
��}|rd}|j	�J�|j	}
��|s?|j
�|
��}|r#d}t|�����}��d|cxkrdkr	nn|d	z
}nd|cxkrd
krnn|dz
}d||||fvrdSd|	cxkrd
ksndS|dks|dks|dks|dkrdStj||
|	|||dddf	��S)z4Implements date string parsing adhering to RFC 6265.NFr�tokenTc3�4K�|]}t|��V��dSrq)r�)r1�ss  r3rxz(CookieJar._parse_date.<locals>.<genexpr>_s(����+P�+P�q�C��F�F�+P�+P�+P�+P�+P�+Pr5�F�cil�Ei�rr!iAr"r#r$)
�DATE_TOKENS_RE�finditer�group�DATE_HMS_TIME_RE�match�groups�DATE_DAY_OF_MONTH_REr��
DATE_MONTH_RE�	lastindex�DATE_YEAR_RE�calendar�timegm)�clsr��
found_time�	found_day�found_month�
found_year�hour�minute�second�day�month�year�token_matchr��
time_match�	day_match�month_match�
year_matchs                  r3r�zCookieJar._parse_dateGsg���	��4��
��	����
�!"�"��"�v���������-�6�6�x�@�@�	3�	3�K��%�%�g�.�.�E��
� �1�7�7��>�>�
���!%�J�+P�+P�J�<M�<M�<O�<O�+P�+P�+P�(�D�&�&���
��4�:�:�5�A�A�	��� $�I��i�o�o�/�/�0�0�C���
�!�/�5�5�e�<�<����"&�K�&�0�<�<�<�'�1�E���
3� �-�3�3�E�:�:�
��3�!%�J��z�/�/�1�1�2�2�D��
�������������D�L�D�D�
�$�_�_�_�_�"�_�_�_�_�_��D�L�D��Y��Z��D�D�D��4��C�~�~�~�~�2�~�~�~�~��4��$�;�;�$��)�)�v��{�{�f�r�k�k��4����e�S�$����B�PR�S�T�T�Tr5rq�r)ro)r)N):�__name__�
__module__�__qualname__�__doc__�re�compiler�r�r��Ir�r�r��datetime�max�replace�timezone�utc�	timestampr^r�r�r>�gmtime�OSErrorr��
OverflowErrorr]�boolrrrr�asyncio�AbstractEventLoopr7rrPrSrrVr/rnrtr{rr�floatr�rrr�r��staticmethodrir��classmethodr��
__classcell__�rBs@r3rr's"�������9�9��R�Z�	>���N�
"�r�z�"B�C�C��%�2�:�l�3�3���B�J�T�
����M�
�2�:�l�+�+�L�
	��H��!�)�)��1B�1F�)�G�G�Q�Q�S�S�T�T�WX�X�
�	�������H�-�-�.�.�.�.���Z� �K�K�K�#�8�?�#I�J�J�����������������a�<�L�
�!�HL�48�
B�B�B��B��	B�
!&�h��X���&D� E�B��w�0�1�
B�
�B�B�B�B�B�B�<C�h�C�4�C�C�C�C�
+�h�+�4�+�+�+�+�

�
�x�(<�=�
��
�
�
�
�>I�3�I�4�I�I�I�I�$�$�$�$�
$��$�$�$�$�$�$�$�$�7�5�7�#�7�S�7��7�PT�7�7�7�7�IL����F�F�l�F�#�F�RV�F�F�F�F�P14����5�5�#�5�:K�5�5�5�5�n�
+��
+��
+��
+�
+�
+��\�
+��,��,�3�,�4�,�,�,��\�,�$�=U�3�=U�8�C�=�=U�=U�=U��[�=U�=U�=U�=U�=Us�'C�C(�C(�'C(rc����eZdZdZdd�deejddf�fd�Zdd�Zde	fd	�Z
dd
eeddfd�Zde
ddfd
�Ze��fdededdfd�Zdeddfd�Z�xZS)rzxImplements a dummy cookie storage.

    It can be used with the ClientSession when no cookie processing is needed.

    Nr+r(r)c�L��t���|���dS)Nr+)r6r7)rAr(rBs  �r3r7zDummyCookieJar.__init__�s$���
�����d��#�#�#�#�#r5roc#�
K�dSrqr-rzs r3rtzDummyCookieJar.__iter__�s����	�	r5c��dS)Nrr-rzs r3r{zDummyCookieJar.__len__�s���qr5rTc��dSrqr-)rArTs  r3rVzDummyCookieJar.clear�����r5rac��dSrqr-rms  r3rnzDummyCookieJar.clear_domain�r�r5r�r�c��dSrqr-)rAr�r�s   r3r�zDummyCookieJar.update_cookies�r�r5r�r�c��t��Srq)r)rAr�s  r3r�zDummyCookieJar.filter_cookies�s���~�~�r5r�rq)r�r�r�r�rr�r�r7rtr�r{rrVr/rnrrr�r�r�r�s@r3rr�sK���������GK�$�$�$���)B� C�$�t�$�$�$�$�$�$�����������
�
�x�(<�=�
��
�
�
�
�
�3�
�4�
�
�
�
�IL����
�
�l�
�#�
�RV�
�
�
�
��#��2C��������r5r)-r�r�r�r��osrHrKr�r>�collectionsr�http.cookiesrrr�mathr�typingrr	r
rrr
rrrrr�yarlr�abcrr�helpersr�typedefsrrr�__all__r/�
CookieItemrrr-r5r3�<module>rs������������������	�	�	�	�����
�
�
�
�	�	�	�	�����#�#�#�#�#�#�9�9�9�9�9�9�9�9�9�9���������������������������������������8�8�8�8�8�8�8�8�"�"�"�"�"�"�6�6�6�6�6�6�6�6�6�6�
)���3�
�%�
&�
�^U�^U�^U�^U�^U�!�^U�^U�^U�B�����&�����r5

Zerion Mini Shell 1.0