Uname: Linux server.digisquadtech.com 4.18.0-553.100.1.el8_10.x86_64 #1 SMP Mon Feb 2 04:13:33 EST 2026 x86_64
User: 1091 (madhavfluid)
Group: 1090 (madhavfluid)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//usr/lib64/python2.7      ( Reset | Go to )
File Name: urllib2.pyo

zfc@sWdZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZyddlmZWn!ek
rddlmZnXyddlZWnek
reZnXeZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ddlm%Z%m&Z&m'Z'm(Z(e
j)d Z*da,de    j-ddeddZ.dZ/d    e0fd
YZ1d e1efd YZ2ej3d Z4dZ5ddDdYZ6ddEdYZ7dZ8ddFdYZ9de9fdYZ:de9fdYZ;de9fdYZ<dZ=de9fdYZ>ddGd YZ?d!e?fd"YZ@d#dHd$YZAd%eAe9fd&YZBd'eAe9fd(YZCd)ZDd*dId+YZEd,e9eEfd-YZFd.e9eEfd/YZGd0e9fd1YZHd2eHfd3YZIeJed4rd5eHfd6YZKnd7e9fd8YZLd9e9fd:YZMd;ZNd<ZOd=ZPd>e9fd?YZQd@e9fdAYZRdBeRfdCYZSdS(Js! An extensible library for opening URLs using a variety of protocols

The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below).  It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.

The OpenerDirector manages a collection of Handler objects that do
all the actual work.  Each Handler implements a particular protocol or
option.  The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL.  For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns.  The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler
deals with digest authentication.

urlopen(url, data=None) -- Basic usage is the same as original
urllib.  pass the url and optionally data to post to an HTTP URL, and
get a file-like object back.  One difference is that you can also pass
a Request instance instead of URL.  Raises a URLError (subclass of
IOError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.

build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers.  Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate.  If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.

install_opener -- Installs a new opener as the default opener.

objects of interest:

OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
the Handler classes, while dealing with requests and responses.

Request -- An object that encapsulates the state of a request.  The
state can be as simple as the URL.  It can also include extra HTTP
headers, e.g. a User-Agent.

BaseHandler --

exceptions:
URLError -- A subclass of IOError, individual protocols have their own
specific subclass.

HTTPError -- Also a valid HTTP response, so you can treat an HTTP error
as an exceptional event or valid response.

internals:
BaseHandler and parent
_call_chain conventions

Example usage:

import urllib2

# set up authentication info
authinfo = urllib2.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
                      uri='https://mahler:8092/site-updates.py',
                      user='klem',
                      passwd='geheim$parole')

proxy_support = urllib2.ProxyHandler({"http" : "http://ahad-haam:3128"})

# build a new opener that adds authentication and caching FTP handlers
opener = urllib2.build_opener(proxy_support, authinfo, urllib2.CacheFTPHandler)

# install it
urllib2.install_opener(opener)

f = urllib2.urlopen('http://www.python.org/')


iN(tStringIO(tunwraptunquotet    splittypet    splithosttquotet
addinfourlt    splitporttsplittagttoBytest    splitattrt
ftpwrappert    splitusert splitpasswdt
splitvalue(t    localhostt url2pathnamet
getproxiest proxy_bypassic    Cs|s|s|r|dk    r-tdntsBtdntjdtjjd|d|}td|}t|}nF|rtd|}t|}n"t    dkrta    }nt    }|j
|||S(NsDYou can't pass both context and any of cafile, capath, and cadefaultsSSL support not availabletpurposetcafiletcapathtcontext( tNonet
ValueErrort    _have_ssltssltcreate_default_contexttPurposet SERVER_AUTHt HTTPSHandlert build_openert_openertopen(    turltdatattimeoutRRt    cadefaultRt https_handlertopener((s/usr/lib64/python2.7/urllib2.pyturlopens$       cCs
|adS(N(R (R'((s/usr/lib64/python2.7/urllib2.pytinstall_openerstURLErrorcBseZdZdZRS(cCs|f|_||_dS(N(targstreason(tselfR,((s/usr/lib64/python2.7/urllib2.pyt__init__s cCs d|jS(Ns<urlopen error %s>(R,(R-((s/usr/lib64/python2.7/urllib2.pyt__str__s(t__name__t
__module__R.R/(((s/usr/lib64/python2.7/urllib2.pyR*s    t    HTTPErrorcBsAeZdZejZdZdZedZdZ    RS(sBRaised when HTTP error occurs, but also acts like non-error returncCsV||_||_||_||_||_|dk    rR|j||||ndS(N(tcodetmsgthdrstfptfilenameRt_HTTPError__super_init(R-R"R3R4R5R6((s/usr/lib64/python2.7/urllib2.pyR.s                     cCsd|j|jfS(NsHTTP Error %s: %s(R3R4(R-((s/usr/lib64/python2.7/urllib2.pyR/scCs|jS(N(R4(R-((s/usr/lib64/python2.7/urllib2.pyR,scCs|jS(N(R5(R-((s/usr/lib64/python2.7/urllib2.pytinfos(
R0R1t__doc__RR.R8R/tpropertyR,R9(((s/usr/lib64/python2.7/urllib2.pyR2s              s:\d+$cCs_|j}tj|d}|dkr@|jdd}ntjd|d}|jS(sReturn request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    ittHost(t get_full_urlturlparset
get_headert _cut_port_retsubtlower(trequestR"thost((s/usr/lib64/python2.7/urllib2.pyt request_hosts   tRequestcBseZdidedZdZdZdZdZdZ    dZ
dZ dZ d    Z d
Zd Zd Zd ZdZdZdZddZdZRS(cCst||_t|j\|_|_d|_d|_d|_d|_||_    i|_
x*|j D]\}}|j ||qmWi|_ |dkrt|}n||_||_dS(N(Rt_Request__originalRt_Request__fragmentRttypeREtportt _tunnel_hostR#theaderstitemst
add_headertunredirected_hdrsRFtorigin_req_hostt unverifiable(R-R"R#RMRQRRtkeytvalue((s/usr/lib64/python2.7/urllib2.pyR.s                                 cCs<|dkr/t|d|d|j|St|dS(Nt_Request__r_typet_Request__r_hosttget_i (RURV(tgetattrt__dict__tAttributeError(R-tattr((s/usr/lib64/python2.7/urllib2.pyt __getattr__s  cCs|jrdSdSdS(NtPOSTtGET(thas_data(R-((s/usr/lib64/python2.7/urllib2.pyt
get_methods cCs ||_dS(N(R#(R-R#((s/usr/lib64/python2.7/urllib2.pytadd_datascCs |jdk    S(N(R#R(R-((s/usr/lib64/python2.7/urllib2.pyR_ scCs|jS(N(R#(R-((s/usr/lib64/python2.7/urllib2.pytget_datascCs(|jrd|j|jfS|jSdS(Ns%s#%s(RIRH(R-((s/usr/lib64/python2.7/urllib2.pyR>s    cCsV|jdkrOt|j\|_|_|jdkrOtd|jqOn|jS(Nsunknown url type: %s(RJRRRHRUR(R-((s/usr/lib64/python2.7/urllib2.pytget_types
cCsR|jdkrKt|j\|_|_|jrKt|j|_qKn|jS(N(RERRRURVR(R-((s/usr/lib64/python2.7/urllib2.pytget_hosts
    cCs|jS(N(RV(R-((s/usr/lib64/python2.7/urllib2.pyt get_selector%scCsJ|jdkr(|j r(|j|_n||_|j|_||_dS(Nthttps(RJRLRERHRV(R-RERJ((s/usr/lib64/python2.7/urllib2.pyt    set_proxy(s
     cCs|j|jkS(N(RVRH(R-((s/usr/lib64/python2.7/urllib2.pyt    has_proxy1scCs|jS(N(RQ(R-((s/usr/lib64/python2.7/urllib2.pytget_origin_req_host4scCs|jS(N(RR(R-((s/usr/lib64/python2.7/urllib2.pytis_unverifiable7scCs||j|j<dS(N(RMt
capitalize(R-RStval((s/usr/lib64/python2.7/urllib2.pyRO:scCs||j|j<dS(N(RPRk(R-RSRl((s/usr/lib64/python2.7/urllib2.pytadd_unredirected_header>scCs||jkp||jkS(N(RMRP(R-t header_name((s/usr/lib64/python2.7/urllib2.pyt
has_headerBscCs"|jj||jj||S(N(RMtgetRP(R-Rntdefault((s/usr/lib64/python2.7/urllib2.pyR@Fs    cCs)|jj}|j|j|jS(N(RPtcopytupdateRMRN(R-R5((s/usr/lib64/python2.7/urllib2.pyt header_itemsKsN(R0R1RtFalseR.R\R`RaR_RbR>RcRdReRgRhRiRjRORmRoR@Rt(((s/usr/lib64/python2.7/urllib2.pyRGs(    
                                                                 tOpenerDirectorcBsSeZdZdZdZdZdejdZ    ddZ
dZ RS(cCsMdt}d|fg|_g|_i|_i|_i|_i|_dS(NsPython-urllib/%ss
User-agent(t __version__t
addheadersthandlerst handle_opent handle_errortprocess_responsetprocess_request(R-tclient_version((s/usr/lib64/python2.7/urllib2.pyR.Qs
                c Cst|ds(tdt|nt}xet|D]W}|d krSq;n|jd}|| }||d}|jdr|jd|d}||d}yt|}Wntk
rnX|j    j
|i}    |    |j    |<n]|d    kr|}|j }    n?|d
kr3|}|j }    n!|d kr;|}|j }    nq;|    j|g}
|
rtj|
|n |
j|t}q;W|rtj|j||j|ndS( Nt
add_parents%expected BaseHandler instance, got %rtredirect_requesttdo_opent
proxy_opent_iterrorR!tresponseRD(RRR(thasattrt    TypeErrorRJRutdirtfindt
startswithtintRR{RpRzR|R}t
setdefaulttbisecttinsorttappendtTrueRyR( R-thandlertaddedtmethtitprotocolt    conditiontjtkindtlookupRy((s/usr/lib64/python2.7/urllib2.pyt add_handler\sJ 
        
cCsdS(N((R-((s/usr/lib64/python2.7/urllib2.pytclosesc    GsR|j|d}x9|D]1}t||}||}|dk    r|SqWdS(N((RpRXR(    R-tchainRt    meth_nameR+RyRtfunctresult((s/usr/lib64/python2.7/urllib2.pyt _call_chains    c
Cst|tr!t||}n"|}|dk    rC|j|n||_|j}|d}x8|jj|gD]!}t    ||}||}qxW|j
||}    |d}x;|j j|gD]$}t    ||}|||    }    qW|    S(Nt_requestt    _response( t
isinstancet
basestringRGRRaR$RcR}RpRXt_openR|(
R-tfullurlR#R$treqRRt    processorRR((s/usr/lib64/python2.7/urllib2.pyR!s"      

cCss|j|jdd|}|r%|S|j}|j|j||d|}|rZ|S|j|jdd|S(NRqt default_openRtunknownt unknown_open(RRzRc(R-RR#RR((s/usr/lib64/python2.7/urllib2.pyRs   cGs|d
kr<|jd}|d}d|}d}|}n|j}|d}d}|||f|}|j|}|r|S|r|dd    f|}|j|SdS( NthttpRfis http_error_%sit_erroriRqthttp_error_default(RRf(R{R(R-tprotoR+tdictRthttp_errt    orig_argsR((s/usr/lib64/python2.7/urllib2.pyRs   

        
N( R0R1R.RRRRtsockett_GLOBAL_DEFAULT_TIMEOUTR!RR(((s/usr/lib64/python2.7/urllib2.pyRvPs         /          csRddlfd}t}tttttttt    g}t
t dra|j t nt}xl|D]d}x[|D]S}||rt||r|j|qq~t||r~|j|q~q~WqqWx|D]}|j|qWx|D]}|j|qWx3|D]+}||r=|}n|j|qW|S(s+Create an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP, FTP and when applicable, HTTPS.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
    iNcst|jtfS(N(Rt    ClassTypeRJ(tobj(ttypes(s/usr/lib64/python2.7/urllib2.pytisclassstHTTPS(RRvt ProxyHandlertUnknownHandlert HTTPHandlertHTTPDefaultErrorHandlertHTTPRedirectHandlert
FTPHandlert FileHandlertHTTPErrorProcessorRthttplibRRtsett
issubclasstaddRtremoveR(RyRR'tdefault_classestskiptklasstcheckth((Rs/usr/lib64/python2.7/urllib2.pyRs2                         t BaseHandlercBs)eZdZdZdZdZRS(icCs ||_dS(N(tparent(R-R((s/usr/lib64/python2.7/urllib2.pyR    scCsdS(N((R-((s/usr/lib64/python2.7/urllib2.pyR scCs#t|dstS|j|jkS(Nt handler_order(RRR(R-tother((s/usr/lib64/python2.7/urllib2.pyt__lt__s(R0R1RRRR(((s/usr/lib64/python2.7/urllib2.pyRs        RcBs#eZdZdZdZeZRS(sProcess HTTP error responses.icCsd|j|j|j}}}d|ko7dkns`|jjd|||||}n|S(Nii,R(R3R4R9RR(R-RDRR3R4R5((s/usr/lib64/python2.7/urllib2.pyt http_responses
     (R0R1R:RRthttps_response(((s/usr/lib64/python2.7/urllib2.pyRs     RcBseZdZRS(cCs"t|j||||dS(N(R2R>(R-RR6R3R4R5((s/usr/lib64/python2.7/urllib2.pyR+s(R0R1R(((s/usr/lib64/python2.7/urllib2.pyR*sRcBs:eZdZdZdZdZeZZZdZ    RS(ii
c    Cs|j}|dkr$|dks<|dkr|dkr|jdd    }td
|jjD}t|d |d |jd tSt|j    ||||dS(sReturn a Request or None in response to a redirect.

        This is called by the http_error_30x methods when a
        redirection response is received.  If a redirection should
        take place, return a new Request to allow http_error_30x to
        perform the redirect.  Otherwise, raise HTTPError if no-one
        else should try to handle this url.  Return None if you can't
        but another Handler might.
        i-i.i/i3R^tHEADR]t s%20css3|])\}}|jdkr||fVqdS(scontent-lengths content-typeN(scontent-lengths content-type(RC(t.0tktv((s/usr/lib64/python2.7/urllib2.pys    <genexpr>Js    RMRQRRN(i-i.i/i3(R^R(i-i.i/(
R`treplaceRRMRNRGRiRR2R>(    R-RR6R3R4RMtnewurltmt
newheaders((s/usr/lib64/python2.7/urllib2.pyR6s
     c Cs    d|kr"|jdd}n&d|krD|jdd}ndStj|}|j r|jrt|}d|d<ntj|}tj|j|}|j}|j    dp|j    dp|j    dst
|||d    |||n|j ||||||}    |    dkr4dSt |d
r|j}
|    _|
j|d|jkst|
|jkrt
|j||j|||qni}
|    _|_|
j|dd |
|<|j|j|jj|    d |jS( Ntlocationiturit/ishttp://shttps://sftp://s) - Redirection to url '%s' is not allowedt redirect_dictiR$(t
getheadersR?tpathtnetloctlistt
urlunparseturljoinR>RCRR2RRRRRpt max_repeatstlentmax_redirectionstinf_msgtreadRRR!R$( R-RR6R3R4RMRturlpartst newurl_lowertnewtvisited((s/usr/lib64/python2.7/urllib2.pythttp_error_302XsB          

soThe HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
(
R0R1RRRRthttp_error_301thttp_error_303thttp_error_307R(((s/usr/lib64/python2.7/urllib2.pyR.s     "    8c    Cst|\}}|jds0d}|}nV|jdsRtd|n|jdd}|dkryd}n|d|!}t|\}}|dk    rt|\}}n
d}}||||fS(s3Return (scheme, user, password, host/port) given a URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme:

    >>> _parse_proxy('file:/ftp.example.com/')
    Traceback (most recent call last):
    ValueError: proxy URL with no authority: 'file:/ftp.example.com/'

    The first three items of the returned tuple may be None.

    Examples of authority parsing:

    >>> _parse_proxy('proxy.example.com')
    (None, None, None, 'proxy.example.com')
    >>> _parse_proxy('proxy.example.com:3128')
    (None, None, None, 'proxy.example.com:3128')

    The authority component may optionally include userinfo (assumed to be
    username:password):

    >>> _parse_proxy('joe:password@proxy.example.com')
    (None, 'joe', 'password', 'proxy.example.com')
    >>> _parse_proxy('joe:password@proxy.example.com:3128')
    (None, 'joe', 'password', 'proxy.example.com:3128')

    Same examples, but with URLs instead:

    >>> _parse_proxy('http://proxy.example.com/')
    ('http', None, None, 'proxy.example.com')
    >>> _parse_proxy('http://proxy.example.com:3128/')
    ('http', None, None, 'proxy.example.com:3128')
    >>> _parse_proxy('http://joe:password@proxy.example.com/')
    ('http', 'joe', 'password', 'proxy.example.com')
    >>> _parse_proxy('http://joe:password@proxy.example.com:3128')
    ('http', 'joe', 'password', 'proxy.example.com:3128')

    Everything after the authority is ignored:

    >>> _parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128')
    ('ftp', 'joe', 'password', 'proxy.example.com')

    Test for no trailing '/' case:

    >>> _parse_proxy('http://joe:password@proxy.example.com')
    ('http', 'joe', 'password', 'proxy.example.com')

    Rs//sproxy URL with no authority: %riiN(RRRRRR R (    tproxytschemetr_schemet    authoritytendtuserinfothostporttusertpassword((s/usr/lib64/python2.7/urllib2.pyt _parse_proxys2           
RcBs#eZdZddZdZRS(idcCse|dkrt}n||_x=|jD]/\}}t|d||||jdq.WdS(Ns%s_opencSs||||S(N((trRRJR((s/usr/lib64/python2.7/urllib2.pyt<lambda>s(RRtproxiesRNtsetattrR(R-RRJR"((s/usr/lib64/python2.7/urllib2.pyR.s        c Cs|j}t|\}}}}|dkr9|}n|j|jr_t|jr_dS|r|rdt|t|f}    tj|    j    }
|j
dd|
nt|}|j ||||ks|dkrdS|j j |d|jSdS(Ns%s:%ssProxy-authorizationsBasic RfR$(RcRRRdRERRtbase64t    b64encodetstripRORgRR!R$( R-RRRJt    orig_typet
proxy_typeRRRt    user_passtcreds((s/usr/lib64/python2.7/urllib2.pyRs       
  N(R0R1RRR.R(((s/usr/lib64/python2.7/urllib2.pyRs
tHTTPPasswordMgrcBs8eZdZdZdZedZdZRS(cCs i|_dS(N(tpasswd(R-((s/usr/lib64/python2.7/urllib2.pyR.scCst|tr|g}n||jkr:i|j|<nxVttfD]H}tg|D]}|j||^qW}||f|j||<qGWdS(N(RRR    RRuttuplet
reduce_uri(R-trealmRRR    t default_porttut reduced_uri((s/usr/lib64/python2.7/urllib2.pyt add_passwords (c    Cs|jj|i}xjttfD]\}|j||}xA|jD]3\}}x$|D]}|j||rZ|SqZWqGWq"WdS(N(NN(R    RpRRuR t    iteritemst    is_suburiR(    R-R tauthuritdomainsR treduced_authurituristauthinfoR((s/usr/lib64/python2.7/urllib2.pytfind_user_passwords c
Cstj|}|dr@|d}|d}|dp:d}nd
}|}d}t|\}}|r|d
kr|d
k    ridd6dd6j|}    |    d
k    rd    ||    f}qn||fS( s@Accept authority or URI and extract only the authority and path.iiiRiPRiRfs%s:%dN(R?turlsplitRRRp(
R-RR tpartsRRRRERKtdport((s/usr/lib64/python2.7/urllib2.pyR &s 




     cCsi||krtS|d|dkr(tStj|d|df}t|t|dkretStS(scCheck if test is below base in a URI tree

        Both args must be URIs in reduced form.
        ii(RRut    posixpatht commonprefixR(R-tbasettesttcommon((s/usr/lib64/python2.7/urllib2.pyR=s (R0R1R.RRRR R(((s/usr/lib64/python2.7/urllib2.pyR s
             
tHTTPPasswordMgrWithDefaultRealmcBseZdZRS(cCsDtj|||\}}|dk    r1||fStj|d|S(N(RRR(R-R RRR((s/usr/lib64/python2.7/urllib2.pyRNs
  
(R0R1R(((s/usr/lib64/python2.7/urllib2.pyR!LstAbstractBasicAuthHandlercBs;eZejdejZddZdZdZ    RS(s5(?:[^,]*,)*[     ]*([^     ,]+)[     ]+realm=(["']?)([^"']*)\2cCs4|dkrt}n||_|jj|_dS(N(RRR    R(R-t password_mgr((s/usr/lib64/python2.7/urllib2.pyR.ds      c    Cs|j|d}|rtjj|}|r|j\}}}|dkrgtjdtdn|j    dkr|j
|||SqndS(Nt"t'sBasic Auth Realm was unquoteditbasic(R$R%( RpRR"trxtsearchtgroupstwarningstwarnt UserWarningRCtretry_http_basic_auth(    R-tauthreqRERRMtmoRRR ((s/usr/lib64/python2.7/urllib2.pythttp_error_auth_reqedks      cCs|jj||\}}|dk    rd||f}dtj|j}|j|jd|krodS|j|j||j    j
|d|j SdSdS(Ns%s:%ssBasic %sR$( R    RRRRRR@t auth_headerRmRR!R$(R-RERR Rtpwtrawtauth((s/usr/lib64/python2.7/urllib2.pyR-{s N(
R0R1tretcompiletIR'RR.R0R-(((s/usr/lib64/python2.7/urllib2.pyR"Vs
          tHTTPBasicAuthHandlercBseZdZdZRS(t AuthorizationcCs(|j}|jd|||}|S(Nswww-authenticate(R>R0(R-RR6R3R4RMR"R((s/usr/lib64/python2.7/urllib2.pythttp_error_401s     (R0R1R1R:(((s/usr/lib64/python2.7/urllib2.pyR8stProxyBasicAuthHandlercBseZdZdZRS(sProxy-authorizationcCs(|j}|jd|||}|S(Nsproxy-authenticate(RdR0(R-RR6R3R4RMRR((s/usr/lib64/python2.7/urllib2.pythttp_error_407s     (R0R1R1R<(((s/usr/lib64/python2.7/urllib2.pyR;scCs}tjjdr;td}|j|}|j|Sgt|D]}ttj    dd^qH}dj
|SdS(sReturn n random bytes.s /dev/urandomiiR<N( tosRtexistsR!RRtrangetchrtrandomt    randrangetjoin(tntftsRtL((s/usr/lib64/python2.7/urllib2.pyt randombytess 
1tAbstractDigestAuthHandlercBsSeZddZdZdZdZdZdZdZ    dZ
RS(    cCsO|dkrt}n||_|jj|_d|_d|_d|_dS(Ni(RRR    Rtretriedt nonce_countt
last_nonce(R-R    ((s/usr/lib64/python2.7/urllib2.pyR.s              cCs d|_dS(Ni(RJ(R-((s/usr/lib64/python2.7/urllib2.pytreset_retry_countscCs|j|d}|jdkrBt|jdd|dn|jd7_|r|jd}|jdkr|j||SndS(Niisdigest auth failediitdigest(RpRRJR2R>tsplitRCtretry_http_digest_auth(R-R1RERRMR.R((s/usr/lib64/python2.7/urllib2.pyR0scCs|jdd\}}tt|}|j||}|rd|}|jj|jd|krndS|j|j||j    j
|d|j }|SdS(NRis    Digest %sR$( ROtparse_keqv_listtparse_http_listtget_authorizationRMRpR1RRmRR!R$(R-RR4ttokent    challengetchaltauth_valtresp((s/usr/lib64/python2.7/urllib2.pyRPs
cCs<tjd|j|tjtdfj}|d S(Ns %s:%s:%s:%sii(thashlibtsha1RKttimetctimeRHt    hexdigest(R-tnoncetdig((s/usr/lib64/python2.7/urllib2.pyt
get_cnoncescCsdyK|d}|d}|jd}|jdd}|jdd}Wntk
r_dSX|j|\}}    |dkrdS|jj||j\}
} |
dkrdS|jr|j|j    |} nd} d|
|| f} d|j
|j f}|d    kr||j kr?|j d
7_ nd
|_ ||_ d |j }|j|}d ||||||f}|    || |}nD|dkr|    || d|||f}ntd |d|
|||j |f}|r|d|7}n| r5|d| 7}n|d|7}|r`|d||f7}n|S(NR R^tqopt    algorithmtMD5topaques%s:%s:%ss%s:%sR4is%08xs%s:%s:%s:%s:%ssqop '%s' is not supported.s>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"s , opaque="%s"s , digest="%s"s, algorithm="%s"s, qop=auth, nc=%s, cnonce="%s"(RpRtKeyErrortget_algorithm_implsR    RR>R_tget_entity_digestRbR`ReRLRKR`R*(R-RRVR R^RaRbRdtHtKDRR2tentdigtA1tA2tncvaluetcnoncetnoncebittrespdigR((s/usr/lib64/python2.7/urllib2.pyRSsV

  !              (
csk|j}|dkr$dn.|dkr<dntd|jfd}|fS(NRccSstj|jS(N(RYtmd5R](tx((s/usr/lib64/python2.7/urllib2.pyR0R<tSHAcSstj|jS(N(RYRZR](Rr((s/usr/lib64/python2.7/urllib2.pyR2R<s.Unsupported digest authentication algorithm %rcsd||fS(Ns%s:%s((RFtd(Rh(s/usr/lib64/python2.7/urllib2.pyR7R<(tupperRRC(R-RbRi((Rhs/usr/lib64/python2.7/urllib2.pyRf+s     cCsdS(N(R(R-R#RV((s/usr/lib64/python2.7/urllib2.pyRg:sN( R0R1RR.RMR0RPR`RSRfRg(((s/usr/lib64/python2.7/urllib2.pyRIs                      
    =    tHTTPDigestAuthHandlercBs#eZdZdZdZdZRS(sAn authentication protocol defined by RFC 2069

    Digest authentication improves on basic authentication because it
    does not transmit passwords in the clear.
    R9icCs?tj|jd}|jd|||}|j|S(Niswww-authenticate(R?R>R0RM(R-RR6R3R4RMREtretry((s/usr/lib64/python2.7/urllib2.pyR:Is
    
(R0R1R:R1RR:(((s/usr/lib64/python2.7/urllib2.pyRv?stProxyDigestAuthHandlercBseZdZdZdZRS(sProxy-AuthorizationicCs2|j}|jd|||}|j|S(Nsproxy-authenticate(RdR0RM(R-RR6R3R4RMRERw((s/usr/lib64/python2.7/urllib2.pyR<Vs
     
(R0R1R1RR<(((s/usr/lib64/python2.7/urllib2.pyRxQstAbstractHTTPHandlercBs/eZddZdZdZdZRS(icCs ||_dS(N(t _debuglevel(R-t
debuglevel((s/usr/lib64/python2.7/urllib2.pyR._scCs ||_dS(N(Rz(R-tlevel((s/usr/lib64/python2.7/urllib2.pytset_http_debuglevelbsc
Cs:|j}|s!tdn|jr|j}|jds[|jddn|jds|jddt|qn|}|jrt|j    \}}t
|\}}n|jds|jd|nxH|j j D]:\}}    |j }|j|s|j||    qqW|S(Ns no host givens Content-types!application/x-www-form-urlencodedsContent-lengths%dR=(RdR*R_RbRoRmRRhRReRRRxRk(
R-RDRER#tsel_hostRtseltsel_pathtnameRT((s/usr/lib64/python2.7/urllib2.pyt do_request_es.   
  c  s|j}|s!tdn||d|j|}|j|jt|jjtfd|jj    Ddd<tdj    D|j
ri}d}|kr|||<|=n|j |j
d|ny)|j |j |j|jWn,tjk
rS}|jt|n7Xy|jd    t}    Wntk
r|j}    nX|    j|    _tj|    dt}
t|
|    j|j} |    j| _|    j| _| S(
sReturn an addinfourl object for the request, using http_class.

        http_class must implement the HTTPConnection API from httplib.
        The addinfourl return value is a file-like object.  It also
        has methods and attributes including:
            - info(): return a mimetools.Message object for the headers
            - geturl(): return the original request URL
            - code: HTTP status code
        s no host givenR$c3s-|]#\}}|kr||fVqdS(N((RRR(RM(s/usr/lib64/python2.7/urllib2.pys    <genexpr>s    Rt
Connectioncss'|]\}}|j|fVqdS(N(ttitle(RRRl((s/usr/lib64/python2.7/urllib2.pys    <genexpr>ssProxy-AuthorizationRMt    buffering(RdR*R$tset_debuglevelRzRRPRsRMRNRLt
set_tunnelRDR`ReR#RRRt getresponseRRRtrecvt _fileobjectRR4R>tstatusR3R,( R-t
http_classRthttp_conn_argsRERttunnel_headerstproxy_auth_hdrterrRR6RX((RMs/usr/lib64/python2.7/urllib2.pyRs@
,    
     
)
    (R0R1R.R}RR(((s/usr/lib64/python2.7/urllib2.pyRy]s         RcBseZdZejZRS(cCs|jtj|S(N(RRtHTTPConnection(R-R((s/usr/lib64/python2.7/urllib2.pyt    http_opens(R0R1RRyRt http_request(((s/usr/lib64/python2.7/urllib2.pyRs    RRcBs)eZdddZdZejZRS(icCstj||||_dS(N(RyR.t_context(R-R{R((s/usr/lib64/python2.7/urllib2.pyR.scCs|jtj|d|jS(NR(RRtHTTPSConnectionR(R-R((s/usr/lib64/python2.7/urllib2.pyt
https_opensN(R0R1RR.RRyRt https_request(((s/usr/lib64/python2.7/urllib2.pyRs    tHTTPCookieProcessorcBs2eZddZdZdZeZeZRS(cCs4ddl}|dkr'|j}n||_dS(Ni(t    cookielibRt    CookieJart    cookiejar(R-RR((s/usr/lib64/python2.7/urllib2.pyR.s  cCs|jj||S(N(Rtadd_cookie_header(R-RD((s/usr/lib64/python2.7/urllib2.pyRscCs|jj|||S(N(Rtextract_cookies(R-RDR((s/usr/lib64/python2.7/urllib2.pyRsN(R0R1RR.RRRR(((s/usr/lib64/python2.7/urllib2.pyRs
         RcBseZdZRS(cCs |j}td|dS(Nsunknown url type: %s(RcR*(R-RRJ((s/usr/lib64/python2.7/urllib2.pyRs (R0R1R(((s/usr/lib64/python2.7/urllib2.pyRscCsmi}x`|D]X}|jdd\}}|ddkr[|ddkr[|dd!}n|||<q W|S(s>Parse list of key=value strings where keys are not duplicated.t=iiR$i(RO(tltparsedteltRR((s/usr/lib64/python2.7/urllib2.pyRQs  cCsg}d}t}}x|D]}|r?||7}t}qn|r|dkr]t}qn|dkrrt}n||7}qn|dkr|j|d}qn|dkrt}n||7}qW|r|j|ng|D]}|j^qS(spParse lists as described by RFC 2068 Section 2.

    In particular, parse comma-separated lists where the elements of
    the list may include quoted-strings.  A quoted-string could
    contain a comma.  A non-quoted string could have quotes in the
    middle.  Neither commas nor quotes count if they are escaped.
    Only double-quotes count, not single-quotes.
    R<s\R$t,(RuRRR(RFtrestparttescapeRtcur((s/usr/lib64/python2.7/urllib2.pyRRs4    
 
      
       cCs-ytj|SWntjk
r(dSXdS(N(Rt gethostbynametgaierrorR(RE((s/usr/lib64/python2.7/urllib2.pyt_safe_gethostbyname+sRcBs)eZdZdZdZdZRS(cCsq|j}|d dkr`|dd!dkr`|jr`|jdkr`d|_|jj|S|j|SdS(Nis//iRRtftp(ReRERJRR!topen_local_file(R-RR"((s/usr/lib64/python2.7/urllib2.pyt    file_open3s  ,    cCs|tjdkruy7ttjddtjtjdt_Wqutjk
rqtjdft_quXntjS(NRi(    RtnamesRR
Rtgethostbyname_ext gethostnameRR(R-((s/usr/lib64/python2.7/urllib2.pyt    get_names>s$cCs[ddl}ddl}|j}|j}t|}ytj|}|j}|jj    |j
dt }    |j |d}
t jtd|
pd||    f} |rt|\}} n| s| r(t||jkr(|rd||} n
d|} tt|d| | SWntk
rJ}t|nXtddS(    Nitusegmtis6Content-type: %s
Content-length: %d
Last-modified: %s
s
text/plainsfile://trbsfile not on local host(t email.utilst    mimetypesRdReRR=tstattst_sizetutilst
formatdatetst_mtimeRt
guess_typet    mimetoolstMessageRRRRRR!tOSErrorR*(R-RtemailRRER7t    localfiletstatstsizetmodifiedtmtypeRMRKtorigurlR4((s/usr/lib64/python2.7/urllib2.pyRIs0             
N(R0R1RRRRR(((s/usr/lib64/python2.7/urllib2.pyR1s    
     RcBseZdZdZRS(cCsddl}ddl}|j}|s9tdnt|\}}|dkrc|j}n t|}t|\}}|rt    |\}}nd}t
|}|pd}|pd}yt j |}Wn"t j k
r}t|nXt|j\}    }
|    jd} tt
| } | d | d} } | rg| d rg| d} ny/|j||||| |j} | rdpd}xM|
D]E}t|\}}|jd    kr|dkr|j}qqW| j| |\}}d}|j|jd}|r;|d|7}n|dk    rd|dkrd|d|7}nt|}tj|}t|||jSWn0|jk
r}td|tj dnXdS(Nisftp error: no host givenR<RiiR7tDRJtatARRtsContent-type: %s
sContent-length: %d
s ftp error: %si(RRRR7RtR(!tftplibRRdR*RRtFTP_PORTRR R RRRRR
ReROtmapt connect_ftpR$RRCRutretrfileRR>RRRRt
all_errorstsystexc_info(R-RRRRERKRR    R4RtattrstdirstfiletfwRJR[RTR6tretrlenRMRtsf((s/usr/lib64/python2.7/urllib2.pytftp_openfs\          !   c    Cs%t||||||dt}|S(Nt
persistent(R Ru(R-RR    RERKRR$R((s/usr/lib64/python2.7/urllib2.pyRs    (R0R1RR(((s/usr/lib64/python2.7/urllib2.pyRes    5tCacheFTPHandlercBs>eZdZdZdZdZdZdZRS(cCs1i|_i|_d|_d|_d|_dS(Nii<i(tcacheR$tsoonesttdelayt    max_conns(R-((s/usr/lib64/python2.7/urllib2.pyR.s
                cCs ||_dS(N(R(R-tt((s/usr/lib64/python2.7/urllib2.pyt
setTimeoutscCs ||_dS(N(R(R-R((s/usr/lib64/python2.7/urllib2.pyt setMaxConnsscCs|||dj||f}||jkrJtj|j|j|<n<t|||||||j|<tj|j|j|<|j|j|S(NR(RCRR[RR$R t check_cache(R-RR    RERKRR$RS((s/usr/lib64/python2.7/urllib2.pyRs"
cCstj}|j|krrxT|jjD]@\}}||kr+|j|j|j|=|j|=q+q+Wnt|jj|_t|j|j    krxD|jjD]3\}}||jkr|j|=|j|=PqqWt|jj|_ndS(N(
R[RR$RNRRtmintvaluesRR(R-RRR((s/usr/lib64/python2.7/urllib2.pyRs  


cCsBx!|jjD]}|jqW|jj|jjdS(N(RRRtclearR$(R-tconn((s/usr/lib64/python2.7/urllib2.pyt clear_caches (R0R1R.RRRRR(((s/usr/lib64/python2.7/urllib2.pyRs                 
    (((((((TR:RRYRRR=RRAR5RRR[R?RR*t    cStringIORt ImportErrorRRuRRturllibRRRRRRRRR    R
R R R RRRRRtversionRwRR RR(R)tIOErrorR*R2R6RARFRGRvRRRRRRRRR!R"R8R;RHRIRvRxRyRRRRRRQRRRRRR(((s/usr/lib64/python2.7/urllib2.pyt<module>Ls                
^"              p    'i    H-@
2      n     
    +    4<

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL