403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.6/site-packages/pip/_internal/network/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.6/site-packages/pip/_internal/network/__pycache__/download.cpython-36.pyc
3

�N�a��@sTdZddlZddlZddlZddlZddlmZmZmZddl	m
Z
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZmZddlmZmZmZej e!�Z"eee#d
�dd�Z$eee%ee&d�dd�Z'e%e%d�dd�Z(e%e%e%d�dd�Z)eee%d�dd�Z*eeed�dd�Z+Gdd �d �Z,Gd!d"�d"�Z-dS)#z)Download files with progress indicators.
�N)�Iterable�Optional�Tuple)�CONTENT_CHUNK_SIZE�Response)�DownloadProgressProvider)�NetworkConnectionError)�PyPI)�Link)�
is_from_cache)�
PipSession)�HEADERS�raise_for_status�response_chunks)�format_size�redact_auth_from_url�splitext)�resp�returnc
Cs.yt|jd�Stttfk
r(dSXdS)Nzcontent-length)�int�headers�
ValueError�KeyError�	TypeError)r�r�/usr/lib/python3.6/download.py�_get_http_response_sizesr)r�link�progress_barrcCs�t|�}|jtjkr|j}n|j}t|�}|r>dj|t|��}t	|�rTt
jd|�nt
jd|�t
j�t
jkrtd}n*t	|�r�d}n|s�d}n|d	kr�d}nd}t|t�}|s�|St||d�|�S)
Nz{} ({})zUsing cached %szDownloading %sFT�(i�)�maxi@�)rZnetlocr	Zfile_storage_domainZshow_urlZurl_without_fragmentr�formatrr�logger�infoZgetEffectiveLevel�logging�INFOrrr)rrrZtotal_length�urlZ
logged_urlZ
show_progress�chunksrrr�_prepare_downloads.
r()�filenamercCstjj|�S)zJ
    Sanitize the "filename" value from a Content-Disposition header.
    )�os�path�basename)r)rrr�sanitize_content_filenameGsr-)�content_disposition�default_filenamercCs,tj|�\}}|jd�}|r$t|�}|p*|S)z�
    Parse the "filename" value from a Content-Disposition header, and
    return the default filename if the result is empty.
    r))�cgiZparse_header�getr-)r.r/Z_type�paramsr)rrr�parse_content_dispositionNs

r3)rrrcCs�|j}|jjd�}|r t||�}t|�d}|sPtj|jjdd��}|rP||7}|r�|j|jkr�tj	j|j�d}|r�||7}|S)zoGet an ideal filename from the given HTTP response, falling back to
    the link filename if not provided.
    zcontent-disposition�zcontent-type�)
r)rr1r3r�	mimetypesZguess_extensionr&r*r+)rrr)r.Zextrrr�_get_http_response_filename\s
r7)�sessionrrcCs.|jjdd�d}|j|tdd�}t|�|S)N�#r4rT)r�stream)r&�splitr1r
r)r8rZ
target_urlrrrr�_http_get_downloadqsr<c@s8eZdZeedd�dd�Zeeeeefd�dd�ZdS)�
DownloaderN)r8rrcCs||_||_dS)N)�_session�
_progress_bar)�selfr8rrrr�__init__yszDownloader.__init__)r�locationrcCs�yt|j|�}WnDtk
rT}z(|jdk	s0t�tjd|jj|��WYdd}~XnXt||�}t	j
j||�}t|||j
�}t|d��}x|D]}	|j|	�q�WWdQRX|jjdd�}
||
fS)z.Download the file given by link into location.NzHTTP error %s while getting %s�wbzContent-Typer5)r<r>r�response�AssertionErrorr"�critical�status_coder7r*r+�joinr(r?�open�writerr1)r@rrBr�er)�filepathr'�content_file�chunk�content_typerrr�__call__�s

zDownloader.__call__)	�__name__�
__module__�__qualname__r�strrAr
rrPrrrrr=xsr=c@sHeZdZeedd�dd�Zeeeeeeeeeffd�dd�Z	dS)�BatchDownloaderN)r8rrcCs||_||_dS)N)r>r?)r@r8rrrrrA�szBatchDownloader.__init__)�linksrBrccs�x�|D]�}yt|j|�}WnDtk
r^}z(|jdk	s:t�tjd|jj|��WYdd}~XnXt||�}t	j
j||�}t|||j
�}t|d��}	x|D]}
|	j|
�q�WWdQRX|jjdd�}|||ffVqWdS)z0Download the files given by links into location.NzHTTP error %s while getting %srCzContent-Typer5)r<r>rrDrEr"rFrGr7r*r+rHr(r?rIrJrr1)r@rVrBrrrKr)rLr'rMrNrOrrrrP�s$


zBatchDownloader.__call__)
rQrRrSrrTrArr
rrPrrrrrU�s
rU).�__doc__r0r$r6r*ZtypingrrrZpip._vendor.requests.modelsrrZpip._internal.cli.progress_barsrZpip._internal.exceptionsrZpip._internal.models.indexr	Zpip._internal.models.linkr
Zpip._internal.network.cacherZpip._internal.network.sessionrZpip._internal.network.utilsr
rrZpip._internal.utils.miscrrrZ	getLoggerrQr"rrrT�bytesr(r-r3r7r<r=rUrrrr�<module>s4
%

Youez - 2016 - github.com/yon3zu
LinuXploit