Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ÝPfRã @s¨dZddlZddlZddlmZmZddlmZddl m Z ddl m Z ddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZm Z ddl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-m.Z.m/Z/mZmZm0Z0m1Z1ddl2m3Z3yddl4m5Z5Wne6k �rrdd„Z5YnXdZ7dZ8dZ9dZ:Gdd„de;ƒZ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. N)ÚNotImplementedError)r,ÚrequestÚstreamÚtimeoutÚverifyÚcertÚproxiesr&r&r'Úsend:szBaseAdapter.sendcCst‚dS)z!Cleans up adapter specific items.N)r.)r,r&r&r'ÚcloseLszBaseAdapter.close)FNTNN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r+r5r6Ú __classcell__r&r&)r-r'r)4s   r)cs eZdZdZdddddgZeeeef‡fdd„ Zd d „Z d d „Z efd d„Z dd„Z dd„Z dd„Zd$dd„Zdd„Zdd„Zdd„Zdd„Zd%d"d#„Z‡ZS)&Ú HTTPAdaptera�The built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session ` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed DNS lookups, socket connections and connection timeouts, never to requests where data has made it to the server. By default, Requests does not retry failed connections. If you need granular control over the conditions under which we retry a request, import urllib3's ``Retry`` class and pass that instead. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a) Ú max_retriesÚconfigÚ_pool_connectionsÚ _pool_maxsizeÚ _pool_blockcsd|tkrtddd�|_n tj|ƒ|_i|_i|_tt|ƒjƒ||_ ||_ ||_ |j |||d�dS)NrF)Úread)Úblock) ÚDEFAULT_RETRIESrr=Zfrom_intr>Ú proxy_managerr*r<r+r?r@rAÚinit_poolmanager)r,Zpool_connectionsZ pool_maxsizer=Z pool_block)r-r&r'r+ns zHTTPAdapter.__init__cst‡fdd„ˆjDƒƒS)Nc3s|]}|tˆ|dƒfVqdS)N)Úgetattr)Ú.0Úattr)r,r&r'ú �sz+HTTPAdapter.__getstate__..)ÚdictÚ __attrs__)r,r&)r,r'Ú __getstate__€s zHTTPAdapter.__getstate__cCsHi|_i|_x |jƒD]\}}t|||ƒqW|j|j|j|jd�dS)N)rC)rEr>ÚitemsÚsetattrrFr?r@rA)r,ÚstaterIÚvaluer&r&r'Ú __setstate__„s  zHTTPAdapter.__setstate__cKs0||_||_||_tf|||ddœ|—Ž|_dS)aInitializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available. :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. T)Ú num_poolsÚmaxsizerCÚstrictN)r?r@rArÚ poolmanager)r,Z connectionsrTrCZ pool_kwargsr&r&r'rF�s zHTTPAdapter.init_poolmanagercKs–||jkr|j|}n||jƒjdƒr^t|ƒ\}}t|f|||j|j|jdœ|—Ž}|j|<n4|j|ƒ}t |f||j|j|jdœ|—Ž}|j|<|S)aÏReturn urllib3 ProxyManager for the given proxy. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxy: The proxy to return a urllib3 ProxyManager for. :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. :returns: ProxyManager :rtype: urllib3.ProxyManager Úsocks)ÚusernameÚpasswordrSrTrC)Ú proxy_headersrSrTrC) rEÚlowerÚ startswithrr#r?r@rArZr)r,ÚproxyZ proxy_kwargsZmanagerrXrYrZr&r&r'Úproxy_manager_for¤s*    zHTTPAdapter.proxy_manager_forcCs|jƒjdƒrn|rnd}|dk r"|}|s*t}| s>tjj|ƒ rLtdj|ƒƒ‚d|_tjj |ƒsf||_ q€||_ nd|_d|_ d|_ |�rt |t ƒs¦|d|_|d|_n ||_d|_|jrØtjj|jƒ rØtd j|jƒƒ‚|joìtjj|jƒ �rtd j|jƒƒ‚dS) aAVerify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: The SSL certificate to verify. ÚhttpsNTzFCould not find a suitable TLS CA certificate bundle, invalid path: {0}Z CERT_REQUIREDZ CERT_NONErrz:Could not find the TLS certificate file, invalid path: {0}z2Could not find the TLS key file, invalid path: {0})r[r\rÚosÚpathÚexistsÚIOErrorÚformatZ cert_reqsÚisdirZca_certsZ ca_cert_dirÚ isinstancerZ cert_fileZkey_file)r,ÚconnÚurlr2r3Zcert_locr&r&r'Ú cert_verifyÉs8      zHTTPAdapter.cert_verifycCs„tƒ}t|ddƒ|_tt|diƒƒ|_t|jƒ|_||_|jj|_t |j t ƒr^|j j dƒ|_ n|j |_ t |j||ƒ||_||_|S)a¶Builds a :class:`Response ` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter ` :param req: The :class:`PreparedRequest ` used to generate the response. :param resp: The urllib3 response object. :rtype: requests.Response ZstatusNÚheaderszutf-8)rrGZ status_coderrjrÚencodingÚrawÚreasonrfrhÚbytesÚdecoderÚcookiesr/Ú connection)r,ZreqÚrespZresponser&r&r'Úbuild_responseýs    zHTTPAdapter.build_responseNcCsNt||ƒ}|r.t|dƒ}|j|ƒ}|j|ƒ}nt|ƒ}|jƒ}|jj|ƒ}|S)aŒReturns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.ConnectionPool Zhttp)rrr^Zconnection_from_urlrZgeturlrV)r,rhr4r]rErgZparsedr&r&r'Úget_connection"s     zHTTPAdapter.get_connectioncCs*|jjƒx|jjƒD] }|jƒqWdS)z¢Disposes of any internal state. Currently, this closes the PoolManager and any active ProxyManager, which closes any pooled connections. N)rVÚclearrEÚvalues)r,r]r&r&r'r69s zHTTPAdapter.closec Csbt|j|ƒ}t|jƒj}|o"|dk}d}|rDt|ƒjjƒ}|jdƒ}|j}|r^| r^t|jƒ}|S)a?Obtain the url to use when making the final request. If the message is being sent through a HTTP proxy, the full URL has to be used. Otherwise, we should only use the path portion of the URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` being sent. :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. :rtype: str r_FrW)rrhrÚschemer[r\Zpath_urlr) r,r/r4r]rwZis_proxied_http_requestZusing_socks_proxyZ proxy_schemerhr&r&r'Ú request_urlCs      zHTTPAdapter.request_urlcKsdS)a"Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter `. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param request: The :class:`PreparedRequest ` to add headers to. :param kwargs: The keyword arguments from the call to send(). Nr&)r,r/r%r&r&r'Ú add_headers`s zHTTPAdapter.add_headerscCs&i}t|ƒ\}}|r"t||ƒ|d<|S)a Returns a dictionary of the headers to add to any request sent through a proxy. This works with urllib3 magic to ensure that they are correctly sent to the proxy, rather than in a tunnelled request if CONNECT is being used. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter `. :param proxies: The url of the proxy being used for this request. :rtype: dict zProxy-Authorization)rr")r,r]rjrXrYr&r&r'rZns   zHTTPAdapter.proxy_headersFTc)Csª|j|j|ƒ}|j||j||ƒ|j||ƒ}|j|ƒ|jdkpHd|jk } t|tƒr¦y|\} } t | | d�}Wq¾t k r¢} zdj |ƒ} t | ƒ‚WYdd} ~ Xq¾Xnt|t ƒr²n t ||d�}�yL| sð|j |j ||j|jdddd|j|d� }�nt|dƒ�r|j}|jtd�}yâ|j|j |d d �x$|jjƒD]\}}|j||ƒ�q.W|jƒxN|jD]D}|jtt|ƒƒd d…jd ƒƒ|jd ƒ|j|ƒ|jd ƒ�qXW|jdƒy|jd d�}Wntk �rØ|jƒ}YnXtj|||ddd�}Wn|jƒ‚YnXW�n�t t!j"fk �rD} zt#| |d�‚WYdd} ~ X�nZt$k �rè} zˆt| j%t&ƒ�r~t| j%t'ƒ�s~t(| |d�‚t| j%t)ƒ�r˜t*| |d�‚t| j%t+ƒ�r²t,| |d�‚t| j%t-ƒ�rÌt.| |d�‚t#| |d�‚WYdd} ~ Xn¶t/k �r} zt#| |d�‚WYdd} ~ Xnˆt+k �r@} zt,| ƒ‚WYdd} ~ Xn^t-t0fk �rœ} z` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response NzContent-Length)ÚconnectrBzsInvalid timeout {0}. Pass a (connect, read) timeout tuple, or a single float to set both timeouts to the same valueF) ÚmethodrhÚbodyrjZredirectZassert_same_hostÚpreload_contentÚdecode_contentZretriesr1Ú proxy_pool)r1T)Zskip_accept_encodingézutf-8s s0 )Ú buffering)Zpoolrqr}r~)r/)4rtrhrirxryr|rjrfÚtupleÚ TimeoutSauceÚ ValueErrorrdZurlopenr{r=ÚhasattrrZ _get_connÚDEFAULT_POOL_TIMEOUTZ putrequestrNZ putheaderZ endheadersr5ÚhexÚlenÚencodeZ getresponseÚ TypeErrorrZ from_httplibr6r ÚsocketÚerrorrr rmrr rrr Ú _ProxyErrorr Ú _SSLErrorrrÚ _HTTPErrorrrrs)r,r/r0r1r2r3r4rgrhZchunkedrzrBÚeÚerrrrZlow_connÚheaderrQÚiÚrr&r&r'r5„s¤                    zHTTPAdapter.send)N)FNTNN)r7r8r9r:rLÚDEFAULT_POOLSIZErDÚDEFAULT_POOLBLOCKr+rMrRrFr^rirsrtr6rxryrZr5r;r&r&)r-r'r<Qs$ %4%  r<)>r:Zos.pathr`r‹Zpip._vendor.urllib3.poolmanagerrrZpip._vendor.urllib3.responserZpip._vendor.urllib3.utilrrƒZpip._vendor.urllib3.util.retryrZpip._vendor.urllib3.exceptionsrrr r�r r r r�r rrrŽrZmodelsrÚcompatrrZutilsrrrrrrZ structuresrrprÚ exceptionsrrrr r!Zauthr"Z!pip._vendor.urllib3.contrib.socksr#Ú ImportErrorr–r•rDr†Úobjectr)r<r&r&r&r'Ú sB                 $