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.9/site-packages/pip/_internal/network/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/pip/_internal/network/__pycache__/download.cpython-39.pyc
a

W��e��@sTdZddlZddlZddlZddlZddlmZmZm	Z	ddl
mZmZddl
mZddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZmZddlmZmZm Z e�!e"�Z#eee$d
�dd�Z%eee&ee'd�dd�Z(e&e&d�dd�Z)e&e&e&d�dd�Z*eee&d�dd�Z+eeed�dd�Z,Gdd �d �Z-Gd!d"�d"�Z.dS)#z)Download files with progress indicators.
�N)�Iterable�Optional�Tuple)�CONTENT_CHUNK_SIZE�Response)�get_download_progress_renderer)�NetworkConnectionError)�PyPI)�Link)�
is_from_cache)�
PipSession)�HEADERS�raise_for_status�response_chunks)�format_size�redact_auth_from_url�splitext)�resp�returnc
Cs0zt|jd�WStttfy*YdS0dS)Nzcontent-length)�int�headers�
ValueError�KeyError�	TypeError)r�r�B/usr/lib/python3.9/site-packages/pip/_internal/network/download.py�_get_http_response_sizesr)r�link�progress_barrc	Cs�t|�}|jtjkr|j}n|j}t|�}|rB|�dt|��d�}t|�rXt	�
d|�nt	�
d|�t	��tj
krxd}n*t|�r�d}n|s�d}n|dkr�d}nd}t|t�}|s�|St||d�}||�S)	Nz (�)zUsing cached %szDownloading %sFTi@�)Zbar_type�size)r�netlocr	Zfile_storage_domainZshow_urlZurl_without_fragmentrrr�logger�infoZgetEffectiveLevel�logging�INFOrrr)	rrrZtotal_length�urlZ
logged_urlZ
show_progress�chunksZrendererrrr�_prepare_downloads0
r()�filenamercCstj�|�S)zJ
    Sanitize the "filename" value from a Content-Disposition header.
    )�os�path�basename)r)rrr�sanitize_content_filenameHsr-)�content_disposition�default_filenamercCs4tj��}||d<|�d�}|r,tt|��}|p2|S)z�
    Parse the "filename" value from a Content-Disposition header, and
    return the default filename if the result is empty.
    �content-typer))�email�messageZMessageZ	get_paramr-�str)r.r/�mr)rrr�parse_content_dispositionOs

r5)rrrcCs�|j}|j�d�}|r t||�}t|�d}|sPt�|j�dd��}|rP||7}|s~|j|jkr~tj	�|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�r0�)
r)r�getr5r�	mimetypesZguess_extensionr&r*r+)rrr)r.�extrrr�_get_http_response_filename^s
r;)�sessionrrcCs.|j�dd�d}|j|tdd�}t|�|S)N�#r6rT)r�stream)r&�splitr8r
r)r<rZ
target_urlrrrr�_http_get_downloadssr@c@s8eZdZeedd�dd�Zeeeeefd�dd�ZdS)�
DownloaderN�r<rrcCs||_||_dS�N��_session�
_progress_bar��selfr<rrrr�__init__{szDownloader.__init__)r�locationrc
Cs�zt|j|�}WnFtyV}z.|jdus.J�t�d|jj|��WYd}~n
d}~00t||�}tj	�
||�}t|||j�}t
|d��$}|D]}	|�|	�q�Wd�n1s�0Y|j�dd�}
||
fS)z.Download the file given by link into location.N�HTTP error %s while getting %s�wb�Content-Typer7�r@rErZresponser"ZcriticalZstatus_coder;r*r+�joinr(rF�open�writerr8)rHrrJr�er)�filepathr'�content_file�chunk�content_typerrr�__call__�s 
�
*zDownloader.__call__)	�__name__�
__module__�__qualname__rr3rIr
rrWrrrrrAzs
�rAc@sHeZdZeedd�dd�Zeeeeeeeeeffd�dd�Z	dS)�BatchDownloaderNrBcCs||_||_dSrCrDrGrrrrI�szBatchDownloader.__init__)�linksrJrccs�|D]�}zt|j|�}WnFty^}z.|jdus6J�t�d|jj|��WYd}~n
d}~00t||�}tj	�
||�}t|||j�}t
|d��$}	|D]}
|	�|
�q�Wd�n1s�0Y|j�dd�}|||ffVqdS)z0Download the files given by links into location.NrKrLrMr7rN)rHr\rJrrrRr)rSr'rTrUrVrrrrW�s&�
*zBatchDownloader.__call__)
rXrYrZrr3rIrr
rrWrrrrr[�s�	�r[)/�__doc__Z
email.messager1r$r9r*�typingrrrZpip._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	getLoggerrXr"rrr3�bytesr(r-r5r;r@rAr[rrrr�<module>s6
�*

Youez - 2016 - github.com/yon3zu
LinuXploit