https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/S3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/S3/__pycache__/S3.cpython-310.pyc
o

�Qa<j�@s^ddlmZmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
ZddlmZmZmZmZddlmZzddlmZWneyYddlmZYnwzddlmZWneyqdd	lmZYnwddlZzdd
lmZWney�dd
lmZYnwddlm Z m!Z!m"Z"m#Z#m$Z$m%Z%dd
l&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.ddl/m/Z/ddl0m0Z0ddl1m1Z1m2Z2ddl3m3Z3ddl4m4Z4ddl5Tddl6m7Z7ddl8m8Z8ddl9m9Z9ddl:m;Z;m<Z<m=Z=m>Z>m?Z?z`ddl@mAZAddlBZBzeBjCdd�ZDdd�ZEWnGeF�y=zeB�GeBjH�ZDeD�I�dd�ZEWneJ�y:eBjCeBjHd�ZDdd�ZEYnwYneJ�yTeB�GeBjH�ZDeD�I�d d�ZEYnwWn/eeKf�y�ZLz eMeL�ZNd!eNv�rmd"ZOnd#eNZOeOd$7ZOd%aPd&d�ZEWYdZL[LndZL[Lwwd'd(�ZQd)ZRd*ZSgZTGd+d,�d,eU�ZVGd-d.�d.eU�ZWeT�Xd.�d/d0�ZYd1d2�ZZdS)3�)�absolute_import�divisionN)�saxutils)�timeout)�debug�info�warning�error)�ST_SIZE)�urlparse)�encodestring)�encodebytes)�md5�)�getListFromXml�getTextFromXml�getRootTagName�decode_from_s3�encode_to_s3�s3_quote)�convertHeaderTupleListToDict�
hash_file_md5�	unicodise�deunicodise�check_bucket_name�check_bucket_name_dns_support�getHostnameFromBucket�calculateChecksum)�
SortedDict)�	AccessLog)�ACL�GranteeLogDelivery)�BidirMap)�Config)�*)�MultiPartUpload)�S3Uri)�ConnMan)�sign_request_v2�sign_request_v4�checksum_sha256_file�checksum_sha256_buffer�format_param_str)�
ArgumentErrorT)�mimecC�
t�|�S�N)�magic_�	from_file��file�r5�'/usr/lib/python3/dist-packages/S3/S3.py�mime_magic_fileC�
r7c
Cs4zt�|�WStttfyt�t|��YSwr0)r1r4�UnicodeDecodeError�UnicodeEncodeErrorr-rr3r5r5r6r7Ps
�)�flagscCr/r0)r1�id_filenamer3r5r5r6r7Zr8cCst�t|��Sr0)r1r4rr3r5r5r6r7cs�magicz%Module python-magic is not available.z'Module python-magic can't be used (%s).z. Guessing MIME types based on file extensions.FcCststt�dat�|�dS)NTr)�magic_warnedr�
magic_message�	mimetypes�
guess_typer3r5r5r6r7nscCsjdd�}||�}|dur-t|t�r-d|vr)|�d�\}}|td�d�}||f}n|df}|dur3d}|S)NcSst|�}|Sr0)r7)r4�	magictyper5r5r6�_mime_magicwszmime_magic.<locals>._mime_magic�;�charset�NN)�
isinstance�str�split�len)r4rC�result�mimetyperEr5r5r6�
mime_magicus

rM�ic@sFeZdZiZiZddd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�	S3RequestNcCsn||_t|pidd�|_t|jjj�dkr#|jj��|jjj|jd<||_||_|p,i|_	||_
|��dS)NT��ignore_caserzx-amz-security-token)�s3r�headersrJ�config�access_token�role_refresh�resource�
method_string�params�body�requester_pays)�selfrRrXrWrSrZrYr5r5r6�__init__�s
zS3Request.__init__cCs*|jjjr|jdvrd|jd<dSdSdS)N)�GET�POST�PUT�HEAD�	requesterzx-amz-request-payer)rRrTr[rXrS�r\r5r5r6r[�s�zS3Request.requester_payscCs,d|jvr	|jd=t�dt���|jd<dS)N�datez%a, %d %b %Y %H:%M:%S +0000z
x-amz-date)rS�time�strftime�gmtimercr5r5r6�update_timestamp�s
zS3Request.update_timestampcCs&|jjrdS|jjjs|jjrdSdS)NFT)rR�endpoint_requires_signature_v4rT�signature_v2�fallback_to_signature_v2rcr5r5r6�use_signature_v2�s
zS3Request.use_signature_v2cCs|j�d�}|��r,td�|rd||jdf}n|jd}t|j||j|j�|_dStd�|j�	|jd�}|rb|t
jvrLt
j�|d��d|�rX|t
jvrbt
t�j|�sbd||jdf}n|jd}t
j�|jdt�j�}t|j|||j||j|j�|_dS)N�bucketzUsing signature v2�/%s%s�urizUsing signature v4��%s.)rW�getrlrr(rXrYrSrR�get_hostnamerO�	redir_map�
startswithrr#�host_bucket�
region_map�bucket_locationr)rZ)r\�bucket_name�resource_uri�hostname�
bucket_regionr5r5r6�sign�s,

�
�


�zS3Request.signcCsT|��|��t|j�}t|dddd�|d<|dt|j�7<|j||jfS)NroFT��quote_backslashes�unicode_output)	rhr}�dictrWrr,rYrXrS)r\rWr5r5r6�get_triplet�s
zS3Request.get_tripletr0)�__name__�
__module__�__qualname__rwrtr]r[rhrlr}r�r5r5r5r6rO�s
	!rOc@s\eZdZeddddddd�Zedd	d
ddd
�ZedededBededBededBededBededBededBededBededBededBededBd�Zdddd�ZdZdd�Z	d d!�Z
d"d#�Zd$d%�Zd�d'd(�Z
d)d*�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d2d3�Zd4d5�Zd�d7d8�Zd9d:�Zd;d<�Zd�d=d>�Zd�d?d@�Zd�dAdB�Zd�dCdD�Zd�dEdF�ZdGdH�ZdIdJ�ZdKdL�Zd�dMdN�ZdOdP�Z d�dRdS�Z!d�dTdU�Z"dVdW�Z#dXdY�Z$dZd[�Z%d\d]�Z&d^d_�Z'	&	6d�d`da�Z(	&	Qd�dbdc�Z)	&	Qd�ddde�Z*dfdg�Z+dhdi�Z,djdk�Z-dldm�Z.dndo�Z/dpdq�Z0drds�Z1dtdu�Z2dvdw�Z3dxdy�Z4dzd{�Z5d|d}�Z6d~d�Z7d�d�d��Z8d�d�d��Z9d�d�d��Z:	&	+d�d�d��Z;	&	+d�d�d��Z<d�d��Z=d�d��Z>d�d��Z?d�d�d��Z@d�d�d��ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFefd�d��ZGd�d�d��ZHdQdedd+d&fd�d��ZId�d�d��ZJ	Qd�d�d��ZKdefd�d��ZLd&S)��S3rrN����)r^r`ra�DELETEr_�MASK�iiii)�SERVICE�BUCKET�OBJECT�BATCHr�rr�r^r�r`r�r�rar_r�)�UNDFINED�LIST_ALL_BUCKETS�
BUCKET_CREATE�BUCKET_LIST�
BUCKET_DELETE�
OBJECT_PUT�
OBJECT_GET�OBJECT_HEAD�
OBJECT_DELETE�OBJECT_POST�BATCH_DELETEzBucket '%s' does not existz Access to bucket '%s' was deniedzBucket '%s' already exists)�NoSuchBucket�AccessDenied�BucketAlreadyExists�cCs||_d|_d|_d|_dS�NF)rTrkri�expect_continue_not_supported)r\rTr5r5r6r]s
zS3.__init__cCs(d}|jjdkr|jjS|jjrd}|S)N�STANDARDrp�REDUCED_REDUNDANCY)rT�
storage_class�reduced_redundancy)r\�clsr5r5r6r�
szS3.storage_classcCs�|r
|tjvr
tj|}n|rt|jj|�rt|�}n|jj��}|jjr1|�	d�r0|dd�}n|�	d�r<|dd�}t
d||f�|S)Nz:443���z:80���zget_hostname(%s): %s)rOrtrrTrvr�	host_base�lower�	use_https�endswithr)r\rm�hostr5r5r6rss

�
zS3.get_hostnamecCs|��tj|<dSr0)r�rOrt)r\rm�redir_hostnamer5r5r6�set_hostname,szS3.set_hostnameNcCs�|�d�}|r2|tjvrtj�|d��d|�r$|tjvr2t|jj|�s2dt|ddd�|df}n|d}|r>d	||f}|jjdkrQ|jj	sQd
|�
|�|f}td|�|S)NrmrprqrnFTr~roz%s%szhttp://%s%szformat_uri(): )rrrOrtrurrTrvr�
proxy_hostr�rsr)r\rW�	base_pathryror5r5r6�
format_uri/s(

�
���z
S3.format_uricCs*|�d�}|�|�}t|dd�|d<|S)Nr��data�Bucket�list)�create_request�send_requestr)r\�request�responser5r5r6�list_all_bucketsDs

zS3.list_all_buckets���cCsZg}g}|�|||||�D]\}}	}
|�|
�|�|	�q
i}||d<||d<||d<|S)Nr��common_prefixes�	truncated)�bucket_list_streaming�extend)r\rm�prefix�	recursive�
uri_params�limit�	item_list�prefixesr��dirs�objectsr�r5r5r6�bucket_listJs
zS3.bucket_listc#sD�dd�}dd�}dd�}�fdd�}	|r|��pi}d	}
g}d
}d
}
|}|
r�|�|||||��|�d�}|�d�}|t|�7}|
t|�7}
|||
krT|||
}|�d�}
|
r�|dksf||
|kr�|rr|	�d|�|d
<n|r}|dd|d
<nd||fVdStd|d
�n|
||fVdS|
||fV|
s'dSdS)ze Generator that produces <dir_list>, <object_list> pairs of groups of content of a specified bucket. cSst|d�pd}|��dkS)N�.//IsTruncated�false)rr�)r��is_truncatedr5r5r6�_list_truncatedYsz1S3.bucket_list_streaming.<locals>._list_truncatedcS�
t|d�S)N�Contents�r�r�r5r5r6�
_get_contents^r8z/S3.bucket_list_streaming.<locals>._get_contentscSr�)N�CommonPrefixesr�r�r5r5r6�_get_common_prefixesar8z6S3.bucket_list_streaming.<locals>._get_common_prefixescst�dd�p|ddS)Nr��
NextMarkerr��Key)r)r��current_list�r�r5r6�_get_next_markerdsz2S3.bucket_list_streaming.<locals>._get_next_markerTrr�r��marker�PrefixF�Listing continues after '%s'N)�copy�bucket_list_noparserJr)r\rmr�r�r�r�r�r�r�r�r�r��num_objects�num_prefixes�max_keysr��current_prefixesr5r�r6r�WsH�
���zS3.bucket_list_streamingcCs^|duri}|r||d<|jjs|sd|d<|dkr t|�|d<|jd||d�}|�|�}|S)Nr��/�	delimiterr�zmax-keysr��rmr�)rTr�rHr�r�)r\rmr�r�r�r�r�r�r5r5r6r��s
zS3.bucket_list_noparsecCs�tdd�}|r|�|�d}|rE|����dkrE|����dkrE|��}|��dkr.|��}d}||7}|d7}td	|�t|dd
�nt|dd
�|jjrSd|d
<|j	d|||d�}|�
|�}|S)NTrPrp�US�	us-east-1�EUz/<CreateBucketConfiguration><LocationConstraint>z1</LocationConstraint></CreateBucketConfiguration>zbucket_location: )�
dns_strictF�public-read�	x-amz-aclr�)rmrSrZ)r�update�strip�upperr�rrrT�
acl_publicr�r�)r\rmrx�
extra_headersrSrZr�r�r5r5r6�
bucket_create�s&

$
zS3.bucket_createcC�|jd|d�}|�|�}|S)Nr�)rm�r�r�)r\rmr�r�r5r5r6�
bucket_delete��
zS3.bucket_deleteFc		Cs<|��}|jd|��ddid�}tj�|d�}tj�|d�}z?|r1|r%|s1|jjtj|<dtj|<|�|�}W||vrA|tj|<n	|tjvrJtj|=||vrT|tj|<n1|tjvr]tj|=n'||vrh|tj|<n	|tjvrqtj|=||vr{|tj|<w|tjvr�tj|=wt	|dd�}|r�|dvr�d}|S|d	kr�d
}|S)Nr��locationr�rpr�r��LocationConstraint)rpr�r�z	eu-west-1)
rmr�rOrtrrrwrTr�r�r)	r\ro�force_us_defaultrmr��saved_redir_map�saved_region_mapr�r�r5r5r6�get_bucket_location�sH�


��


�
�zS3.get_bucket_locationcCsL|jd|��ddid�}|�|�}|�dd�}|r"t|dd�}|Sd}|S)Nr��requestPaymentr�r�rp�Payer)r�rmr�rrr)r\ror�r��	resp_data�payerr5r5r6�get_bucket_requester_pays�s�
�zS3.get_bucket_requester_paysc
CsVi}|�|�|d<z
|�|�|d<W|Sty*}zd|d<WYd}~|Sd}~ww)Nzbucket-locationzrequester-pays)r�r�S3Error)r\ror��er5r5r6�bucket_info�s���zS3.bucket_infoc
Cs�|��}|jd|ddid�}z*|�|�}t|dd�|d<t|dd�|d<|jj|��|�|�d	�|d
<|WStyU}z|jdkrPt	d�WYd}~dS�d}~ww)
Nr��websiter�r�z.//IndexDocument//Suffix�index_documentz.//ErrorDocument//Key�error_document)rmr��website_endpoint�zICould not get /?website - website probably not configured for this bucket)
rmr�r�rrTrr�r�statusr)r\rorxrmr�r�rr5r5r6�website_info�s(�
�
��zS3.website_infocCs�|��}d}|d7}|d|jj7}|d7}|jjr*|d7}|d|jj7}|d7}|d7}|jd	||d
did�}|�|�}td|�|S)
NzF<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">z  <IndexDocument>z    <Suffix>%s</Suffix>z  </IndexDocument>z  <ErrorDocument>z    <Key>%s</Key>z  </ErrorDocument>z</WebsiteConfiguration>r�r�rmrZr��Received response '%s')rmrT�
website_index�
website_errorr�r�r)r\rorxrmrZr�r�r5r5r6�website_create�s 
�
zS3.website_createcCsN|��}|jd|ddid�}|�|�}td|�|ddkr%td|��|S)Nr�rr�rr	��zExpected status 204: %s)rmr�r�r�S3ResponseError�r\rorxrmr�r�r5r5r6�website_deletes�
zS3.website_deletec
Cs�|��}|jd|ddid�}z|�|�}Wn-tyB}z!|jdkr-td�WYd}~dS|jdkr=td�WYd}~dS�d}~wwt|d�}|d	krTtd
|�dSt|dd�|d<t|dd
�|d<t|dd�|d<|S)Nr��	lifecycler�rzMCould not get /?lifecycle - lifecycle probably not configured for this bucket�zKCould not get /?lifecycle - lifecycle support not implemented by the serverr��LifecycleConfigurationz7Could not get /?lifecycle - unexpected xml response: %sz.//Rule//Prefixr�z.//Rule//Expiration//Daterdz.//Rule//Expiration//Days�days)rmr�r�rr	rrr)r\rorxrmr�r�r�
root_tag_namer5r5r6�expiration_infos@�

������zS3.expiration_infocCs�|jjr|jjrtd��|jjs/|jjs/|jjrtd��td�|��}|jd|ddid�}n|�|�}|�	|�}td|�|S)Nz+Expect either --expiry-day or --expiry-datezdel bucket lifecycler�rr�r)
rT�expiry_date�expiry_days�ParameterError�
expiry_prefixrrmr��_expiration_setr�rr5r5r6�expiration_set=s�

zS3.expiration_setcCs�td�d}|d7}|d|jj7}|d7}|d7}|jjr'|d|jj7}n|jjr3|d|jj7}|d	7}|d
7}|d7}tdd
�}t|�|d<|��}|jd|||ddid�}|S)Nzput bucket lifecyclez<LifecycleConfiguration>z  <Rule>z    <Prefix>%s</Prefix>z    <Status>Enabled</Status>z    <Expiration>z    <Date>%s</Date>z    <Days>%s</Days>z    </Expiration>z	  </Rule>z</LifecycleConfiguration>TrP�content-md5r�r�rmrSrZr�)	rrTrrrr�compute_content_md5rmr�)r\rorZrSrmr�r5r5r6rMs*
�zS3._expiration_setcCs�|jj}d}|dkr|jjstd��|jjr6|jjr$ttj�t	|���}|jj
r/t|�\}}nt�
|�\}}|s<|jj}||fS)N�-zRYou must specify --mime-type or --default-mime-type for files uploaded from stdin.)rT�default_mime_typer�guess_mime_type�follow_symlinksr�os�path�realpathr�use_mime_magicrMr@rA�r\�filename�content_type�content_charsetr5r5r6�_guess_content_typedszS3._guess_content_typecCs,|jj}|s
|jj}|d|jj��7}|S)N�
; charset=)rT�	mime_typer$�encodingr�)r\r-r5r5r6�stdin_content_typevs
zS3.stdin_content_typecCsb|jj}d}|dkr|��S|s|�|�\}}|s|jj��}|�||�r/|dur/|d|}|S)Nr#r0)rTr1r3r/r2r��add_encodingr+r5r5r6r-~szS3.content_typecCs^d|vrdS|jj�d�}|ddkrdS|�dd�}t|�dkr#dS|d}||vr-d	SdS)
Nzcharset=F�,rrp�.rNrT)rT�add_encoding_extsrI�rsplitrJ)r\r,r-�exts�parts�extr5r5r6r4�szS3.add_encodingrpc
Cs�|jdkrtd|j��|dkrtj�t|��std��z,|dkr2tjt	j
��ddd�}d|_d	}ntjt|�dd
�}||_t�
t|��t}Wnttfy]}ztd|j��d}~wwtdd
�}|rj|�|�|jjrrd|d<|jjr�d|d<|jj|d<|j|d�|d<|jjr�d|d<|��|d<d}	|jjs�|dkr�td��|jjr�||jjtks�|dkr�d}	||jj|jjtkr�td|jj|jjf��|	r�|�|||||�S|jj �r6z|�!|�}
Wnt"y�d}
Ynw|
du�r6t#|
dd�}|
dd�$d�}||k�r-t%d|d	||jj&�}
||
k�r#t'd|�dSt'd||
|f�n	t'd |||f�t(|�|d<|j)d!||d"�}||�*�|d#�}|�+|||�}|S)$NrR� Expected URI type 's3', got '%s'r#zNot a regular file�rbF)�mode�closefdz<stdin>r)r>�%sTrP�AES256�x-amz-server-side-encryption�aws:kms�+x-amz-server-side-encryption-aws-kms-key-id)r,�content-typer�r��x-amz-storage-classz2Multi-part upload is required to upload from stdinzZChunk size %d MB results in more than %d chunks. Please increase --multipart-chunk-size-mbrS�content-length�etag�"'rpz,Put: size and md5sum match for %s, skipping.zBMultiPart: checksum (%s vs %s) does not match for %s, reuploading.z>MultiPart: size (%d vs %d) does not match for %s, reuploading.r��rorS��source�destination�extra),�type�
ValueErrorr'r(�isfiler�InvalidFileError�io�open�sys�stdin�fileno�stream_name�statr
�IOError�OSError�strerrorrr�rT�server_side_encryption�kms_keyr-r�r��enable_multipartr�multipart_chunk_size_mb�SIZE_1MB�multipart_max_chunks�send_file_multipart�put_continue�object_info�	Exception�intr�r�
send_chunkrrHr�ro�	send_file)r\r,ror��extra_label�
src_stream�sizerrS�	multipartr�remote_size�remote_checksum�checksumr��labelsr�r5r5r6�
object_put�s�
���

�
�


��z
S3.object_putc	CsJ|jdkrtd|j��|jd|d�}|��||d�}|�||||�}|S)NrRr<r��rorK)rOrPr�ro�	recv_file)	r\ro�stream�	dest_name�start_positionrjr�rqr�r5r5r6�
object_get�s
z
S3.object_getcs �fdd��D�}|�|�dS)z" Batch delete given a remote_list csg|]}�|d�qS)�object_uri_strr5)�.0�item��remote_listr5r6�
<listcomp>sz*S3.object_batch_delete.<locals>.<listcomp>N)�object_batch_delete_uri_strs)r\r}�urisr5r|r6�object_batch_delete�szS3.object_batch_deletec	Csvdd�}|}t|�dkrtd��t|d���}|||�}tt|�dd�dd�}|jd	|||d
did�}|�|�}|S)
z* Batch delete given a list of object uris cSs�d}|D]3}t|�}|jdkrtd|j��|��s td|��|��|kr*td��t�|���}|d|7}q|d7}t|�}|S)Nz.<?xml version="1.0" encoding="UTF-8"?><Delete>rRr<zURI '%s' has no objectz2The batch should contain keys from the same bucketz<Object><Key>%s</Key></Object>z	</Delete>)	r&rOrP�
has_objectrmr�escape�objectr)rm�key_listrZ�keyror�r5r5r6�compose_batch_del_xmls
z>S3.object_batch_delete_uri_strs.<locals>.compose_batch_del_xmlrzKey list is empty�application/xml)r rETrPr��deleteNr!)rJrPr&rmrr"r�r�)	r\r�r��batchrm�request_bodyrSr�r�r5r5r6rs"
���
zS3.object_batch_delete_uri_strscCs4|jdkrtd|j��|jd|d�}|�|�}|S)NrRr<r�rs)rOrPr�r��r\ror�r�r5r5r6�
object_delete"s


zS3.object_deletecCs�|jdkrtd|j��|jjdkrtd��|jjdvr td��d}|d|jj7}|d	7}|d
|jj7}|d7}|d7}|jd
||ddid�}|�|�}td|�|S)NrRr<rz*You must restore a file for 1 or more days)�Standard�	Expedited�Bulkz7Valid restoration priorities: bulk, standard, expeditedz@<RestoreRequest xmlns="http://s3.amazonaws.com/doc/2006-03-01/">z  <Days>%s</Days>z  <GlacierJobParameters>z    <Tier>%s</Tier>z  </GlacierJobParameters>z</RestoreRequest>r��restore�rorZr�r)	rOrPrT�restore_daysr�restore_priorityr�r�r)r\rorZr�r�r5r5r6�object_restore)s$

�
zS3.object_restorecCs4gd�}||jjD]
}|��|vr||��=q
|S)N)
rdrGz
last-modifiedr zx-amz-version-idzx-amz-delete-markerz
accept-ranges�
connectionrH�serverz
x-amz-id-2zx-amz-request-idrF)rT�remove_headersr�)r\rS�	to_remove�hr5r5r6�_sanitize_headers<s
�zS3._sanitize_headersc
Cs�|jdkrtd|j��|jdkrtd|j��|jjdurAz|�|�}Wnty@}z|jdkr4|�d}WYd}~nd}~wwd}	d}
|sK|jjrMd}|r^|�|�}|d}
t	|
d�}|jj
r�|
}|durw|�|�}|d}t	|d�}||ur�tjt
}
n|jjt
}
||
kr�|dur�|�|�}|d}t	|d�}|}
d}	|
r�|�|
�t|
dd	�}
ntdd	�}
|jjr�d
|
d<|��|
d<|jjr�d
|
d<|jjr�d|
d<|jj|
d<|r�|
�|�|jjr�|jj|
d<|s�d|
d<nd|
d<|	�r|�||||
|�}ntd|��|��fddd�|
d<|jd||
d�}|�|�}|d�r:t|d�dk�r:d|d<td�t|��|jjdu�rj|�rjz	|�||�W|St�yi}z|jdk�r^|�WYd}~|Sd}~ww|S)a Remote copy an object and eventually set metadata

        Note: A little memo description of the nightmare for performance here:
        ** FOR AWS, 2 cases:
        - COPY will copy the metadata of the source to dest, but you can't
        modify them. Any additional header will be ignored anyway.
        - REPLACE will set the additional metadata headers that are provided
        but will not copy any of the source headers.
        So, to add to existing meta during copy, you have to do an object_info
        to get original source headers, then modify, then use REPLACE for the
        copy operation.

        ** For Minio and maybe other implementations:
        - if additional headers are sent, they will be set to the destination
        on top of source original meta in all cases COPY and REPLACE.
        It is a nice behavior except that it is different of the aws one.

        As it was still too easy, there is another catch:
        In all cases, for multipart copies, metadata data are never copied
        from the source.
        rRr<NrFTrSrGrPr�r�rFrArBrCrDrE�COPYzx-amz-metadata-directive�REPLACEz/%s/%sr~zx-amz-copy-sourcer�rJr��Error��r	zHServer error during the COPY operation. Overwrite response status to 500)rOrPrTr��get_aclrr	r1rergr_r%�MAX_CHUNK_SIZE_MBra�multipart_copy_chunk_size_mbr�rr�r]r^r��copy_file_multipartrrmr�r�r�rr	�set_acl)r\�src_uri�dst_urir��src_sizerj�replace_meta�acl�excrmrS�src_info�src_headers�	thresholdr�r�r5r5r6�object_copyVs�


��




�


�
��
�
���zS3.object_copycCs|j|||||dd�S)NT)r�)r�)r\r�r�r�r�rjr5r5r6�
object_modify�s�zS3.object_modifycCs`|�|||||�}td||f�|drt|d�dvr)|�|�td|�|Std|�|S)NzObject %s copied to %sr�)�CopyObjectResult�CompleteMultipartUploadResultzObject '%s' deletedzGObject '%s' NOT deleted because of an unexpected response data content.)r�rrr�r)r\r�r�r�r�rj�
response_copyr5r5r6�object_move�s
�
�

��zS3.object_movecCr�)Nr�rsr�r�r5r5r6rer�zS3.object_infocCsP|��r|jd|ddid�}n|jd|��ddid�}|�|�}t|d�}|S)Nr�r��ror�r�r�r�)r�r�rmr�r )r\ror�r�r�r5r5r6r�s��
z
S3.get_aclcCstd|}td||f�tddidd�}|��r%|jd|||ddid	�}n|jd
|��||ddid�}|�|�}|S)Nr@zset_acl(%s): acl-xml: %srEr�TrPr�r��rorSrZr�r�r!)rrr�r�rmr�)r\ror�rZrSr�r�r5r5r6r�s��
z
S3.set_aclcC�.|jd|��ddid�}|�|�}t|d�S)Nr��policyr�r��r�rmr�rr�r5r5r6�
get_policy$�
�
z
S3.get_policycCs8tdd�}d|d<|jd|||ddid�}|�|�}|S)NTrPzapplication/jsonrEr�r�r�)rr�r��r\ror�rSr�r�r5r5r6�
set_policy*s
�
z
S3.set_policycC�.|jd|ddid�}td|�|�|�}|S)Nr�r�r�zdelete_policy(%s)�r�rr�r�r5r5r6�
delete_policy4��
zS3.delete_policycCr�)Nr��corsr�r�r�r�r5r5r6�get_cors;r�zS3.get_corscCsDtdd�}d|d<t|�|d<|jd|||ddid�}|�|�}|S)	NTrPr�rEr r�r�r�)rr"r�r�)r\ror�rSr�r�r5r5r6�set_corsAs
�
zS3.set_corscCr�)Nr�r�r�zdelete_cors(%s)r�r�r5r5r6�delete_corsLr�zS3.delete_corscCsLtdd�}t|�|d<|jd|||ddid�}td||f�|�|�}|S)NTrPr r�rr�z(set_lifecycle_policy(%s): policy-xml: %s)rr"r�rr�r�r5r5r6�set_lifecycle_policySs
�
zS3.set_lifecycle_policycCs\tdd�}d|d<d}|jjr|d7}n|d7}|d7}|jd	||d
did�}|�|�}|S)NTrPr�rEzN<RequestPaymentConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
z<Payer>Requester</Payer>
z<Payer>BucketOwner</Payer>
z</RequestPaymentConfiguration>
r�r�r�)rrTr[r�r�)r\rorSrZr�r�r5r5r6�	set_payer]s


�
zS3.set_payercCsB|jd|��ddid�}td|�|�|�}td|d�|S)Nr�rr�zget_lifecycle_policy(%s)z%s: Got Lifecycle Policyr	)r�rmrr�r�r5r5r6�get_lifecycle_policyks�
zS3.get_lifecycle_policycCr�)Nr�rr�zdelete_lifecycle_policy(%s)r�r�r5r5r6�delete_lifecycle_policytr�zS3.delete_lifecycle_policycCs*g}|�|||�D]	\}}|�|�q	|Sr0)�get_multipart_streamingr�)r\ror�r��upload_listr��uploadsr5r5r6�
get_multipart{s�zS3.get_multipartccs6�|r|��pi}|��}d}d}|}d|d<|r�|j|d||d�}|d}	t|	d�}
|t|
�7}||kr9||}t|	d�}|rF|��dkrHd	}|r�|d
ksR||kr�|
ryt|	d�}|sa|
d
d}||d
<t|	d�}
|
rq|
|d<nd|vrx|d=nd	|
fVdStd|d
�n||
fVdS||
fV|sdSdS)NTrr�)r�r�r�r��Uploadr�r�Fr��
NextKeyMarkerr��	KeyMarker�NextUploadIdMarker�UploadIdMarkerr�)r�rmr�rrJrr�r)r\ror�r�rmr�r�r�r��xml_datar��
xml_truncated�next_key�upload_id_markerr5r5r6r��sX��


�
�
�

�zS3.get_multipart_streamingcCs,g}|�||||�D]	\}}|�|�q
|Sr0)�list_multipart_streamingr�)r\ro�	upload_idr�r��	part_listr�r:r5r5r6�list_multipart�s�zS3.list_multipartc
cs��|r|��pi}d}d}|}|r}|�||||�}|d}	t|	d�}
|t|
�7}||kr0||}t|	d�}|r=|��dkr?d}|rt|dksI||krm|
r]t|	d	�}|sX|
dd
}||d<nd|
fVdStd|d�n||
fVdS||
fV|sdSdS)
NTrr��Partr�r�Fr��NextPartNumberMarker�
PartNumberzpart-number-markerz!Listing continues after Part '%s')r��list_multipart_noparserrJrr�r)
r\ror�r�r�r�r��	max_partsr�r�r�r��next_part_numberr5r5r6r��sF��

�

�

�zS3.list_multipart_streamingcCsF|duri}|dkrt|�|d<||d<|jd||d�}|�|�}|S)Nr�z	max-parts�uploadIdr�r�)rHr�r�)r\ror�r�r�r�r�r5r5r6r��s�
zS3.list_multipart_noparsecCs"|jd|d|id�}|�|�}|S)Nr�r�r�r�)r\ro�idr�r�r5r5r6�abort_multipart�s
�
zS3.abort_multipartcCs2|jd|��ddid�}|�|�}t|d�}|S)Nr��loggingr�r�)r�rmr�r)r\ror�r��	accesslogr5r5r6�
get_accesslogs�
zS3.get_accesslogcCs^|�|�}td|��|f�|�td��|�td��td|��|f�|�||�dS)NzCurrent ACL(%s): %s�READ_ACP�WRITEzUpdated ACL(%s): %s)r�rro�
appendGranteer!r�)r\ror�r5r5r6�set_accesslog_acls
zS3.set_accesslog_aclc

Cs�t�}|r|�|�|�|�n|��d|}td||f�|jd|��|ddid�}z
|�|�}W||fStyi}	z&|	j	ddkr[t	d�|�
td	|����|�|�}n�WYd}	~	||fSd}	~	ww)
Nr@z$set_accesslog(%s): accesslog-xml: %sr�r�r�Code�InvalidTargetBucketForLoggingz.Setting up log-delivery ACL for target bucket.zs3://%s)r�
enableLogging�setAclPublic�disableLoggingrr�rmr�rrr�r&)
r\ro�enable�log_target_prefix_urir�r�rZr�r�rr5r5r6�
set_accesslogs.
��
���zS3.set_accesslogcCs�ddd�}|r|s|rtd��|r|��}|��r|��pd}|r-||d<|r-d||d<tj�tj|tjd@�}	t||	||||�}
t	d|d�|
S)Nr�)rmroz>Both 'uri' and either 'bucket' or 'object' parameters suppliedrmror�zCreateRequest: resource[uri]=%s)
rPrmr�r�r��http_methods�getkey�
operationsrOr)r\�	operationrormr�rSrZr�rWrXr�r5r5r6r�(s
zS3.create_requestcCs|j|ddS)Nr�)�_max_retries)r\�retriesr5r5r6�
_fail_wait>sz
S3._fail_waitc
Os.|d�d�}d|vr?t|d�dkr?t|dd�}t|dd�}|�||�td|�|r8|tj|<td|�||i|��S|jd	kr�|d�d
�}	|	r�|	�d�rY|	dd�}	n|	�d
�rd|	dd�}	t	d
|	�j
}	|jd}|�||	�td|	�|r�|tj|<td|�||i|��Std|�t
|��)NrSzx-amz-bucket-regionr�rz	.//Bucketz.//EndpointzRedirected to: %szRedirected to region: %srar�zhttp://�zhttps://r�rmz�Redirection error: No info provided by the server to where should be forwarded the request (HEAD request). (Hint target region: %s))rrrJrr�rrOrwrXrurr{rWrr)
r\r�r��fn�args�kwargs�redir_region�redir_bucketr��location_urlr5r5r6�_http_redirection_handlerBs6










zS3._http_redirection_handlerc	Osd|vrvt|d�dkrvt|dd�}|dkr<t|dd�}|dur6|tj|jd<td|�||i|��Std	�dS|d
kr[t|dd�}|dkrYtd
�d|_||i|��SdS|dkrt|�	�st|j
sttd�d|_
||i|��SdS|�	�s�|j
s�td�d|_
||i|��SdS)zR
        Returns None if no handler available for the specific error code
        r�rr��AuthorizationHeaderMalformed�RegionNrmzForwarding request to %szVCould not determine bucket the location. Please consider using the --region parameter.�InvalidRequest�Messagez\The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.zEndpoint requires signature v4T�InvalidArgument�Falling back to signature v2)rJrrOrwrWrrrrirlrk)	r\r�r�r�r�r��failureCode�region�messager5r5r6�_http_400_handlergs8
��	�zS3._http_400_handlercOsvd|vr7t|d�dkr7t|dd�}|dkr7t|dd�}|dkr7|��s7|js7td�d|_||i|��St|��)	Nr�rr�r�rz=AWS authentication requires a valid Date or x-amz-date headerrT)rJrrlrkrr)r\r�r�r�r�r�rr
r5r5r6�_http_403_handler�szS3._http_403_handlerc
Cs�|j�d�r]|��s_tj�|jdt�j�dkratd�z$td|jd�}|j	|dd�}|dur9|tj|jd<td|�WdSt
y\}ztd	|�td
�WYd}~dSd}~wwdSdSdS)a?Get and update region for the request if needed.

        Signature v4 needs the region of the bucket or the request will fail
        with the indication of the correct region.
        We are trying to avoid this failure by pre-emptively getting the
        correct region to use, if not provided by the user.
        rmr�z====== SEND Inner request to determine the bucket region =====zs3://T)r�NzE===== SUCCESS Inner request to determine the bucket region (%r) =====z,getlocation inner request failure reason: %sz?===== FAILED Inner request to determine the bucket region =====)rWrrrlrOrwr#rxrr&r�rf)r\r��s3_urir	r�r5r5r6�update_region_inner_request�s,��
�
���zS3.update_region_inner_requestc
Cs�|�|�t|j�|_|j}|��\}}}i}td�d}z`t�|�|d��}|�	||j
�}td|||t|jp9d�f�|j�
|||j|�|j��}	|	j|d<|	j|d<t|	���|d<|	��|d<d	|dvrwt|dd	�}
|
|d
<t�|�Wn�ttfy��ttfy�}zftdt�|��t|d�r�|jr�|jtjtjtj fvs�d
t!|�vs�dt!|�vr�t"|t#�s��t�$|�|r�t%d|d|f�t%d|�&|��t'�(|�&|��|�)||d�WYd}~St*d|d��d}~wtdt�|���tdt�|��|ddv�r |�+|||j)|�S|ddk�rg|�,|||j)|�}|�r5|St-|�}
|�re|
j.dv�ret%d|d|
f�t%d|�&|��t'�(|�&|��|�)||d�S|
�|ddk�rw|�/|||j)|�S|ddk�r�t-|��|ddk�s�|ddk�r�t-|�}|ddk�r�d}|�r�t%d|d|f�t%d|�&|��t'�(|�&|��|�)||d�S|�|ddk�s�|ddk�r�t-|��|S)Nz"Processing request, please wait...rmzESending request method_string=%r, uri=%r, headers=%r, body=(%i bytes)rpr	�reasonrSr��x-amz-meta-s3cmd-attrs�s3cmd-attrs�
Response:
�errno�[Errno 104]�
[Errno 32]� Retrying failed request: %s (%s)ro�Waiting %d sec...rzRequest failed for: %s�i-i3���	BadDigest�OperationAborted�TokenRefreshRequired�RequestTimeout��r��rr���+)0rrrZrSr�rr'rrrsr�r(rJ�cr��getresponser	rr�
getheaders�read�parse_attrs_header�put�
S3SSLError�S3SSLCertificateErrorrZrf�pprint�pformat�hasattrr�EPIPE�
ECONNRESET�	ETIMEDOUTrHrG�SocketTimeoutException�closerr�re�sleepr��S3RequestErrorrrr�coder)r\r�r�rSrXrWr��connro�
http_response�attrsr�
handler_fn�errr5r5r6r��s�



�
�zS3.send_requestc
Cs�|jjs
td�|�|�Sd|vrd|d<|j�||�}z|�|�}Wnty5}z|�d��d}~ww|j|d�|�d�|S)zrWrapper around send_request for slow requests.

        To be able to show progression for small requests
        z$Sending slow request, please wait...�actionr��failedN)�current_position�done)rT�progress_meterrr��progress_classrfr?r�)r\r�rq�operation_size�progressr�r�r5r5r6�send_request_with_progress"s 

��
zS3.send_request_with_progressc
)Cs�|�|�|	dur
|jj}	|jr|	rd}	|j}
t|
d�}}|j}
|jjr2d|d<|j�||�}nt	d|
�t
�
�}|rEt|||�}nt|
||�}||_
|	rY|sUd}	nd|
d<|��\}}}
z1t�|�|d��}|j�||�||j��|
��D]}|j�t|�t|
|��q{|j��WnZty�}z�d}~wty�}zB|jjr�|�d	�|r�td
|d|f�td|�|��t
�|�|��|� ||||||d
||�WYd}~St!d|d��d}~ww|dkr�|�"|�t#�}z�d}|	�r%t$�$|jj%gggt&�\}}}|�r|j�'�}n|�s%|�s%tdt&�d|_d}	|	�r2|�r�|j(tj)k�r�|�r>|�*�tj+|j_,|dk�r�t-|jj.|�}|dk�rU|�*|�}n|}|�s^t/d��|jj0dk�rit
�
�}|�1|�|j�2|�|jj�r�|j1t3|�d�|t3|�8}|}|jj0dk�r�t
�
�|}t4|�|jj0} t5| ||�}|�r�t
�t-||jj6��|dk�sC|�7�}!|j�'�}i}"|j(|"d<|j8|"d<t9|�:��|"d<|�*�|"d<||"d<t�;|�t<dt=�>|"��Wn�t�y�}z�d}~wt/�y}z|jj�r
|�d	��d}~wt�y�}z�|jj�r$|�d	�|�r�d}#t?|d��r?|j@�r?|j@t@jAt@jBt@jCfv�sMdtD|�v�sMdtD|�v�r�tE|tF��s�z'|j�'�}i}"|j(|"d<|j8|"d<t9|�:��|"d<|�*�|"d<||"d<d}#Wnt�y�tGd�Ynw|#�s�td|d|f�td|�|��t
�|�|��|� ||||||d
|||	�	WYd}~Snt<d |
|f�t!d|d��WYd}~nd}~wwt
�
�}$|$||"d!<|"d!�r�t4|"d�|"d!�p�t4d"�|"d#<|jj�r|�1�|�d$�|"dd%v�r|jH||"|j |||||||	d&�
S|"dd'k�rE|jI||"|j |||||||	d&�
}%|%�r9|%StJ|"�}&|&jKd(v�rE|&�|"dd)k�r\|jL||"|j |||||||	d&�
S|"dd*k�ry|�ryd|_|j ||||||d
||dd+�	Sd,|"dv�r�d|"dd,<|"dd-k�s�|"dd.k�r#d}'|"dd/k�r�d}'|"dd0k�r�|�r�|d1�p�d2}n'|"dd3k�r�d}'|�r�|d1�p�d2}n|"dd'k�r�tJ|"�}&|&jKd(v�r�d}'|'�r|�rtd|dtJ|"�f�|�r�td4|�td|�|��t
�|�|��|� ||||||d
|||	�	Std5|
�t!d5|
��tJ|"��t<d6|!|"d�d,d��Md7�f�|"d�d,d��Md7�}(d8|(v�r}|(|�7�k�r}|"d�d9�d:k�r}td;�|�rqtd<|
�|� ||||||d
|||	�	Std5|
�t!d5|
��|"S)=NFrG�uploadr<z!Sending file '%s', please wait...z100-continue�expectrmr=rrorrzUpload failed for: %srpzQHTTP Expect Continue feature disabled because of no reply of the server in %.2fs.Trz3File smaller than expected. Was the file truncated?��delta_positionr	rrSr�rlrrrrzXCannot retrieve any response status before encountering an EPIPE or ECONNRESET exceptionzUpload failed: %s (%s)zGiving up on '%s' %s�elapsedr��speedr?r)�offset�
chunk_size�use_expect_continuerrri�)rMrHr"r#r�i�r�g{�G�z�?r!z(Retrying on lower speed (throttle=%0.2f)z$Too many failures. Giving up on '%s'z"MD5 sums: computed=%s, received=%srIr#rBrCzMD5 Sums don't match!zRetrying upload of %s)NrrT�use_http_expectr�rSrgrXr@rArrer+r*rZr�r'rrrsr$�
putrequestr�r(�keys�	putheaderr�
endheadersrrfr?rr�r4ri�
S3UploadError�seekr�select�sock�EXPECT_CONTINUE_TIMEOUTr%r	�CONTINUEr'�_CS_REQ_SENT�_HTTPConnection__state�minrhrR�	limitrater��wrapper_send_bodyrJ�float�max�throttle_max�	hexdigestrrr&r)rr,r-r.rr/r0r1rHrGr2r	rrrr6rr�))r\r�rurq�buffer�throttler�rKrLrMrS�	size_left�
size_totalr,rC�timestamp_start�sha256_hashrXrWr7�headerr�md5_hashr8�readable�writable�exceptional�lr��
start_time�limitrate_throttle�
real_duration�expected_duration�md5_computedr��known_error�
timestamp_endr:r;�	try_retry�md5_from_s3r5r5r6ri:s�

�
(��







�



�

�

�


������#,

�������",��zS3.send_filec
Cs�t��}t|||||�}|�|�|��}t��}	|	||d<||d<|dr1t|d�|dp4td�|d<|drLt|d�dkrLtt|dd���|S)NrIrlr�rJr�r�r)rer%�upload_all_parts�complete_multipart_uploadr^rrSr)
r\rurSrorlrjrfrEr�rtr5r5r6rc7s
(zS3.send_file_multipartcCs|�|||||�Sr0)rc)r\r�r�rlrSrjr5r5r6r�Gs�zS3.copy_file_multipartcCs�|�|�|��\}}}|j}	|jjrd|d<|j�|d�}
ntd|	�t��}d}zxt�	|�
|d��}|j�||�
||j��|��D]}
|j�t|
�t||
��qF|dkritd|�|j�dd|�|j��i}|j��}|j|d	<|j|d
<t|���|d<d|dvr�t|dd�}||d
<tdt�|��Wn�ty�}z�d}~wttf�y(}zj|jjr�|
�d�t |d�r�|j!r�|j!t!j"t!j#t!j$fvs�dt%|�vs�dt%|�vr�t&|t'�s�t�(|�|�rt)d|d|f�t)d|�*|��t�+|�*|��|�,|||||d�WYd}~St-d|d��d}~ww|d	dv�rB|�.�|d<|�/|||j,||||�S|d	dk�rd|�.�|d<|�0|||j,||||�}|�r`|St1|��|d	dk�r}|�.�|d<|�2|||j,||||�S|d	dk�r�|�.�|d<t1|��|d	dk�s�|d	dk�r�|�.�|d<t1|��|dk�r�t3�}t4|dd�}||}|}|jj�r�||
_5||
_6||
_7z�|dk�r�|�.d�}t8|�dk�s�J�||k�rT||jj9k�r�|jj9�p�|}|jj:dk�r�t��}|�.|�}t8|�dk�rt;d ��|jj:dk�r-t��|}t<|�|jj:}||k�r-t�+||�|�=|�|dk�r<|�>|�|t8|�7}|jj�rO|
j>t8|�d!�||k�s�t�?|�Wn�t@�yc�ttf�y�}zq|jj�rw|
�d�t |d��r�|j!�r�|j!t!j"t!j#t!j$fv�s�dt%|�v�s�dt%|�v�r�t&|t'��s��t�(|�|�r�t)d|d|f�t)d|�*|��t�+|�*|��|�,|||||d�WYd}~St-d|d��d}~ww|�A�t��}|jj�r�|
�>�|
�d"�|d�	d#d$��Bd%�}d&|dv�rz|d
d'}Wn
tC�yYnwd(|v�r^|dk�r/|�D�|d'<n/ztE|	�|d'<Wn&t�y]}z|j!t!jFk�rOt)d)|	|f�t)d*�WYd}~nd}~ww|�	d'�|k|d+<|||d,<||d-<|d,�r�t<|d-�|d,�p�t<d.�|d/<|d-|t4|dd�k�r�t)d0|t4|dd�|d-f�td1|�	d'��d(|v�r�|d+�s�|d�	d2�d3k�r�t)d4|�	d'�|f�|S)5N�downloadr<rz#Receiving file '%s', please wait...rmzRequesting Range: %d .. end�Rangez	bytes=%d-r	rrSrrrr=rrrrrorrzDownload failed for: %srr�rrr r"r#rGzEOF from S3!rGr?rHrprIzx-amz-meta-s3tools-gpgencrr#zUnable to open file: %s: %sz(Unable to verify MD5. Assume it matches.�md5matchrIrlr�rJz4Reported size (%s) does not match received size (%s)zReceiveFile: Computed MD5 = %srBrCz5MD5 signatures do not match: computed=%s, received=%s)Grr�rXrTr@rArrer'rrrsr$rOr�r(rPrQrrrRr%r	rrr&r(r,r-rrZrfr?r.rr/r0r1rHrGr2r3rr�r4rt�S3DownloadErrorr'rrrrrrg�
total_size�initial_positionr>rJ�
recv_chunkr\rr^�writer�r)r[�flushr��KeyErrorrar�ENOENT)r\r�rurqrwr�rXrWrSr,rCrfr7rhr�r8r9rr:rirdrer>r��
this_chunkrnrprqrtrvr5r5r6rtLsF




�
�
"�����











�

�
"��

�

��,�(
�zS3.recv_filer0)NNNr�rF)F)Nrp)rrp)NNrpF)NNrp)Nr�r�)NNNNrpN)r)rp)Mr�r�r�r"r��targetsr��codesr�r]r�rsr�r�r�r�r�r�r�r�r�rrr
rrrrrr/r3r-r4rrrxr�rr�r�r�r�r�r�rer�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�rDrircr�rtr5r5r5r6r��s��	���




4

!
	






W
�
�
�

	

	
6

�+
�

%*
f
�
~
�r�cCs.i}|�d�D]
}|�d�\}}|||<q|S)Nr��:)rI)�attrs_headerr9�attrr��valr5r5r6r(s

r(cCs@tt|��}t|���}t|�}|ddkr|dd�}t|�S)Nr��
r)rrr�digestr)rZ�m�	base64md5r5r5r6r"sr")[�
__future__rrrUr'rerr@rSr,�xml.saxr�socketrr2r�rrrr	rYr
r�ImportError�urllib.parse�base64rr
rU�hashlibr�	BaseUtilsrrrrrr�Utilsrrrrrrrrrrr r!r"r#�
Exceptions�	MultiPartr%r&r'�Cryptor(r)r*r+r,�ctypesr-r=�Magicr1r7�	TypeErrorrT�
MAGIC_MIME�load�AttributeErrorr[rrH�	error_strr?r>rMrWra�__all__r�rOr��appendr(r"r5r5r5r6�<module>s���� (����	
��P
>

https://t.me/RX1948 - 2025