Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
ó •�abc@s+dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z mZmZddlmZmZmZmZdd lmZmZmZdd lmZmZdd lmZdd lmZm Z dd l!m"Z"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddlm*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2ddlm3Z3ej4ƒdkrÑy ej5Z6Wne7k rÍej8Z6nXn ejZ6e d„Z9e d„Z:de;fd„ƒYZ<de<fd„ƒYZ=d„Z>dS(s“ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). iÿÿÿÿN(tMapping(t timedeltai(t_basic_auth_str(t cookielibtis_py3t OrderedDictturljointurlparse(tcookiejar_from_dicttextract_cookies_to_jartRequestsCookieJart merge_cookies(tRequesttPreparedRequesttDEFAULT_REDIRECT_LIMIT(t default_hookst dispatch_hook(tto_native_string(tto_key_val_listtdefault_headers(tTooManyRedirectst InvalidSchematChunkedEncodingErrortContentDecodingError(tCaseInsensitiveDict(t HTTPAdapter(t requote_uritget_environ_proxiestget_netrc_authtshould_bypass_proxiestget_auth_from_urlt rewind_bodyt DEFAULT_PORTS(tcodes(tREDIRECT_STATItWindowscCs´|dkr|S|dkr |St|tƒo;t|tƒsB|S|t|ƒƒ}|jt|ƒƒg|jƒD]\}}|dkrt|^qt}x|D] }||=qŸW|S(sèDetermines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a dictionary, they will be merged together using `dict_class` N(tNonet isinstanceRRtupdatetitems(trequest_settingtsession_settingt dict_classtmerged_settingtktvt none_keystkey((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt merge_setting2s  1  cCsZ|dks!|jdƒgkr%|S|dksF|jdƒgkrJ|St|||ƒS(s©Properly merges both requests and session hooks. This is necessary because when request_hooks == {'response': []}, the merge breaks Session hooks entirely. tresponseN(R$tgetR0(t request_hookst session_hooksR*((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt merge_hooksQs !!tSessionRedirectMixincBsPeZd„Zd„Zededded„Zd„Zd„Z d„Z RS(cCs?|jr;|jd}tr.|jdƒ}nt|dƒSdS(s7Receives a Response. Returns a redirect URI or ``None``tlocationtlatin1tutf8N(t is_redirecttheadersRtencodeRR$(tselftrespR7((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytget_redirect_targetbs    cCsàt|ƒ}t|ƒ}|j|jkr.tS|jdkrn|jdkrn|jdkrn|jdkrntS|j|jk}|j|jk}tj|jdƒdf}| rÖ|j|krÖ|j|krÖtS|pß|S(sFDecide whether Authorization header should be removed when redirectingthttpiPthttpsi»N(iPN(i»N( RthostnametTruetschemetportR$tFalseR R2(R=told_urltnew_urlt old_parsedt new_parsedt changed_porttchanged_schemet default_port((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytshould_strip_authxs  c ksèg} |j|ƒ} xÌ| rã|jƒ} | j|ƒ| d|_y |jWn-tttfk r~|jj dt ƒnXt |jƒ|j kr³t d|j d|ƒ‚n|jƒ| jdƒr÷t|jƒ} dt| jƒ| f} nt| ƒ}|jƒ} |js3t|jt| ƒƒ} n t| ƒ} t| ƒ| _|j| |ƒ|jtjtjfkr¯d}x!|D]}| jj|dƒq†Wd| _ n| j}y |d =Wnt!k rÖnXt"| j#||jƒt$| j#|j%ƒ| j&| j#ƒ|j'| |ƒ}|j(| |ƒ| j)dk oVd|kpVd |k}|rlt*| ƒn| }|r€|Vq|j+|d |d |d |d|d|dt | �}t"|j%| |jƒ|j|ƒ} |VqWdS(sBReceives a Response. Returns a generator of Responses or Requests.itdecode_contentsExceeded %s redirects.R1s//s%s:%ssContent-Lengths Content-TypesTransfer-EncodingtCookietstreamttimeouttverifytcerttproxiestallow_redirectsN(sContent-Lengths Content-TypesTransfer-Encoding(,R?tcopytappendthistorytcontentRRt RuntimeErrortrawtreadRFtlent max_redirectsRtcloset startswithRturlRRDtgeturltnetlocRRtrebuild_methodt status_codeR!ttemporary_redirecttpermanent_redirectR;tpopR$tbodytKeyErrorR t_cookiesR tcookiestprepare_cookiestrebuild_proxiest rebuild_autht_body_positionRtsend(R=R>treqRQRRRSRTRUtyield_requeststadapter_kwargsthistRbtprepared_requestt parsed_rurltparsedtpurged_headerstheaderR;t rewindable((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytresolve_redirects‘sr                 cCs{|j}|j}d|kr@|j|jj|ƒr@|d=n|jrUt|ƒnd}|dk rw|j|ƒndS(séWhen being redirected we may want to strip authentication from the request to avoid leaking credentials. This method intelligently removes and reapplies authentication where possible to avoid credential loss. t AuthorizationN(R;RbRNtrequestt trust_envRR$t prepare_auth(R=RwR1R;Rbtnew_auth((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRpýs  $  c Cs5|dk r|ni}|j}|j}t|ƒj}|jƒ}|jdƒ}t|d|ƒ}|jr¿| r¿t |d|ƒ} | j|| jdƒƒ} | r¿|j || ƒq¿nd|krÕ|d=nyt ||ƒ\} } Wnt k rd\} } nX| r1| r1t | | ƒ|d>> import requests >>> s = requests.Session() >>> s.get('http://httpbin.org/get') Or as a context manager:: >>> with requests.Session() as s: >>> s.get('http://httpbin.org/get') R;RmtauthRUthookstparamsRSRTtprefetchtadaptersRQR€R_cCs¥tƒ|_d|_i|_tƒ|_i|_t|_ t |_ d|_ t |_t |_tiƒ|_tƒ|_|jdtƒƒ|jdtƒƒdS(Nshttps://shttp://(RR;R$R–RURR—R˜RFRQRCRSRTRR_R€RRmRRštmountR(R=((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt__init__js           cCs|S(N((R=((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __enter__¡scGs|jƒdS(N(R`(R=targs((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt__exit__¤scCs*|jp i}t|tjƒs0t|ƒ}ntttƒ|jƒ|ƒ}|j}|jrƒ| rƒ|j rƒt |j ƒ}nt ƒ}|j d|j jƒd|j d|jd|jd|jdt|j|jdtƒdt|j|jƒd t||jƒd |d t|j|jƒƒ |S( s‹Constructs a :class:`PreparedRequest ` for transmission and returns it. The :class:`PreparedRequest` has settings merged from the :class:`Request ` instance and those of the :class:`Session`. :param request: :class:`Request` instance to prepare with this session's settings. :rtype: requests.PreparedRequest R�RbtfilestdatatjsonR;R*R˜R–RmR—(RmR%Rt CookieJarRR R R–R€RRbR tprepareR�tupperR R¡R¢R0R;RR˜R5R—(R=RRmtmerged_cookiesR–tp((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytprepare_request§s*        cCsÇtd|jƒd|d|d|d|p-id|d|p?id|d |d | ƒ }|j|ƒ}| poi} |j|j| | ||ƒ}i| d 6| d 6}|j|ƒ|j||�}|S( sñConstructs a :class:`Request `, prepares it and sends it. Returns :class:`Response ` object. :param method: method for the new :class:`Request` object. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. :param files: (optional) Dictionary of ``'filename': file-like-objects`` for multipart encoding upload. :param auth: (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth. :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 allow_redirects: (optional) Set to True by default. :type allow_redirects: bool :param proxies: (optional) Dictionary mapping protocol or protocol and hostname to the URL of the proxy. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. :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. Defaults to ``True``. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :rtype: requests.Response R�RbR;R R¡R¢R˜R–RmR—RRRV(R R¥R¨tmerge_environment_settingsRbR&Rr(R=R�RbR˜R¡R;RmR R–RRRVRUR—RQRSRTR¢Rstpreptsettingst send_kwargsR>((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRÏs*)       cKs#|jdtƒ|jd||�S(såSends a GET request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RVR�(R…RCR(R=Rbtkwargs((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR2scKs#|jdtƒ|jd||�S(séSends a OPTIONS request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RVtOPTIONS(R…RCR(R=RbR­((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytoptions!scKs#|jdtƒ|jd||�S(sæSends a HEAD request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RVRŒ(R…RFR(R=RbR­((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pythead,scKs|jd|d|d||�S(s¬Sends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response RŽR¡R¢(R(R=RbR¡R¢R­((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytpost7s cKs|jd|d||�S(sYSends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tPUTR¡(R(R=RbR¡R­((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytputCs cKs|jd|d||�S(s[Sends a PATCH request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tPATCHR¡(R(R=RbR¡R­((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytpatchNs cKs|jd||�S(sèSends a DELETE request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :rtype: requests.Response tDELETE(R(R=RbR­((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytdeleteYsc Ks|jd|jƒ|jd|jƒ|jd|jƒ|jd|jƒt|tƒrjtdƒ‚n|jdt ƒ}|j dƒ}|j }|j d|j ƒ}tƒ}|j||�}tƒ|} td| ƒ|_td |||�}|jr1x-|jD]} t|j| j| jƒq Wnt|j||jƒ|j|||�} |r{g| D]} | ^qing} | r¯| jd |ƒ| jƒ}| |_n|sôy(t|j||d t |�ƒ|_Wqôtk rðqôXn|s|jn|S( sISend a given PreparedRequest. :rtype: requests.Response RQRSRTRUs#You can only send PreparedRequests.RVRbtsecondsR1iRt(R…RQRSRTRUR%R t ValueErrorRiRCR2R—t get_adapterRbtpreferred_clockRrRtelapsedRRYR RmRR\R}tinserttnextt_nextt StopIterationRZ( R=RR­RVRQR—tadaptertstarttrR¼R>tgenRY((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRrcsB     %  (  c Cs|jr«|dk r$|jdƒnd}t|d|ƒ}x*|jƒD]\}} |j|| ƒqIW|tks�|dkr«tjjdƒp¢tjjdƒ}q«nt ||j ƒ}t ||j ƒ}t ||j ƒ}t ||j ƒ}i|d6|d6|d6|d6S( s^ Check the environment and merge it with some settings. :rtype: dict RƒtREQUESTS_CA_BUNDLEtCURL_CA_BUNDLERSRURQRTN(R€R$R2RR'R…RCtostenvironR0RURQRSRT( R=RbRURQRSRTRƒt env_proxiesR,R-((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR©¬s !cCsMx6|jjƒD]%\}}|jƒj|ƒr|SqWtd|ƒ‚dS(s~ Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter s*No connection adapters were found for '%s'N(RšR'tlowerRaR(R=RbtprefixRÁ((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyRºÉscCs(x!|jjƒD]}|jƒqWdS(s+Closes all adapters and as such the sessionN(RštvaluesR`(R=R-((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR`×scCso||j|ès(tdictt __attrs__(R=tstate((R=sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __getstate__çscCs1x*|jƒD]\}}t|||ƒq WdS(N(R'tsetattr(R=RÓRÐtvalue((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt __setstate__ësN(R“R”t__doc__RÒRœR�RŸR¨R$RCRR2R¯R°R±R³RµR·RrR©RºR`R›RÔR×(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyR•Qs2  7   ) D  I    cCstƒS(sQ Returns a :class:`Session` for context-management. :rtype: Session (R•(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pytsessionðs(?RØRÇtplatformttimet collectionsRtdatetimeRR–RtcompatRRRRRRmRR R R tmodelsR R RR—RRt_internal_utilsRtutilsRRt exceptionsRRRRt structuresRRšRRRRRRRR t status_codesR!R"tsystemt perf_counterR»tAttributeErrortclockR0R5tobjectR6R•RÙ(((sA/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.pyt s<   (""4     ñÿ