当前位置: 首页>>代码示例>>Python>>正文


Python net.http_GET函数代码示例

本文整理汇总了Python中net.http_GET函数的典型用法代码示例。如果您正苦于以下问题:Python http_GET函数的具体用法?Python http_GET怎么用?Python http_GET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了http_GET函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: LOGIN_VK

def LOGIN_VK(number,password,GET_URL):

                
    
    headers = {}
    headers.update({'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive',
                    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                    'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-GB,en-US;q=0.8,en;q=0.6',
                    'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36'})
    
    
    html = net.http_GET('http://vk.com')
    
    
    ip_h = re.search(r'ip_h\"\svalue=\"(.*?)\"', html.content, re.I)
    html = net.http_POST('https://login.vk.com/?act=login', {'act':'login','role':'al_frame','expire':'',
                                                             'captcha_sid':'','_origin':'http://vk.com','ip_h':ip_h.group(1),
                                                             'email':str(number),'pass':str(password)})
    if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    
    html = net.http_GET(GET_URL).content.replace('\\','')
    return html
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:25,代码来源:default.py

示例2: PAYSUBS

def PAYSUBS(cat):
    dialog = xbmcgui.Dialog()
    net.set_cookies(cookie_jar)
    URL = "http://www.ntv.mx/?c=4&a=8&item_id=%s&amount=1" % cat
    link = net.http_GET(URL).content
    data = json.loads(link)
    if "success" in link:
        cat = str(data["body"])
        CARDPAY(cat)
    elif "failure" in link:
        dialog = xbmcgui.Dialog()
        winput = data["message"]
        dialog.ok("NTV.mx", "", winput, "")
        return
    else:
        if dialog.yesno(
            "NTV.mx", "You Have a Similar Subscription", "", "What Do You Want To Do", "Extend", "Create New"
        ):
            print "######################################   CREATE NEW"
            link = net.http_GET(URL + "&force=1").content
            data = json.loads(link)
            if "success" in link:
                cat = str(data["body"])
                CARDPAY(cat)
            elif "failure" in link:
                winput = data["message"]
                dialog.ok("NTV.mx", "", winput, "")
                return
        else:
            print "######################################   EXTEND"
            titlereturn = ["Cancel"]
            idreturn = ["Cancel"]
            body = data["body"]
            candidates = body["candidates"]

            for field in candidates:
                name = "%s-(%s) [COLOR yellow]%s[/COLOR]" % (field["title"], field["time_left"], field["status_tag"])
                titlereturn.append(name)
                idreturn.append(field["id"])
            cat = idreturn[xbmcgui.Dialog().select("Which Do You Want To Extend", titlereturn)]
            if "Cancel" in cat:
                print "Cancel"
            else:
                net.set_cookies(cookie_jar)
                url = URL + "&opt=%s" % cat
                link = net.http_GET(url).content
                data = json.loads(link)

                if "success" in link:
                    cat = str(data["body"])
                    CARDPAY(cat)
                elif "failure" in link:
                    winput = data["message"]
                    dialog.ok("NTV.mx", "", winput, "")
                    return
开发者ID:neopack1,项目名称:Aarron-Lee-XBMC-Repo-Oficial,代码行数:55,代码来源:default.py

示例3: PAYSUBS

def PAYSUBS(cat):
    dialog = xbmcgui.Dialog()
    net.set_cookies(cookie_jar)
    URL='http://www.wliptv.com/?c=4&a=8&item_id=%s&amount=1'%cat
    link = net.http_GET(URL, headers={'User-Agent' : UA}).content
    data = json.loads(link)
    if 'success' in link:
        cat= str(data['body'])
        CARDPAY(cat)
    elif 'failure' in link:
        dialog = xbmcgui.Dialog()
        winput= data['message']
        dialog.ok("IPTV World", '',winput, '')
        return
    else:
        if dialog.yesno("IPTV World", "You Have a Similar Subscription",'', "What Do You Want To Do","Extend","Create New"):
                print '######################################   CREATE NEW'
                link = net.http_GET(URL+'&force=1', headers={'User-Agent' : UA}).content
                data = json.loads(link)
                if 'success' in link:
                    cat= str(data['body'])
                    CARDPAY(cat)
                elif 'failure' in link:
                    winput= data['message']
                    dialog.ok("IPTV World", '',winput, '')
                    return
        else:
                print '######################################   EXTEND'
                titlereturn = ['Cancel']
                idreturn = ['Cancel']
                body = data['body']
                candidates = body['candidates']
                
                for field in candidates:  
                    name='%s-(%s) [COLOR yellow]%s[/COLOR]'%(field['title'],field['time_left'],field['status_tag'])               
                    titlereturn.append(name)             
                    idreturn.append(field['id'])   
                cat= idreturn[xbmcgui.Dialog().select('Which Do You Want To Extend', titlereturn)]
                if 'Cancel' in cat:
	                print 'Cancel'
                else:
	                net.set_cookies(cookie_jar)
	                url=URL+'&opt=%s'%cat
	                link = net.http_GET(url, headers={'User-Agent' : UA}).content
	                data = json.loads(link)
	                
	                
	                if 'success' in link:
	                    cat= str(data['body'])
	                    CARDPAY(cat)
	                elif 'failure' in link:
	                    winput= data['message']
	                    dialog.ok("IPTV World", '',winput, '')
	                    return
开发者ID:exp-repo,项目名称:exp-repo,代码行数:54,代码来源:default.py

示例4: LOGOUT

def LOGOUT():
    net.set_cookies(cookie_jar)
    html = net.http_GET(site).content
    match=re.compile('  href="(.+?)">Log Out</a>').findall(html)[0]
    net.set_cookies(cookie_jar)
    logout = net.http_GET(match.replace('#038;','')).content
    if 'You are now logged out' in logout:
        print '===============LOGGED OUT !!==============='
        dialog = xbmcgui.Dialog()
        dialog.ok(THESITE.upper(),'', "You Are Now Logged Out", "")
        EXIT()
开发者ID:browno01,项目名称:sportmania-1,代码行数:11,代码来源:default.py

示例5: open_url

def open_url(url):
        try:
                net.set_cookies(cookie_file)
                link = net.http_GET(url).content
                link = cleanHex(link)
                return link
        except:
                import cloudflare
                cloudflare.createCookie(url,cookie_file,'Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0')
                net.set_cookies(cookie_file)
                link = net.http_GET(url).content
                link = cleanHex(link)
                return link
开发者ID:kevintone,项目名称:tdbaddon,代码行数:13,代码来源:default.py

示例6: server

def server():
    net.set_cookies(cookie_jar)
    a=net.http_GET('http://'+THESITE+'/payments/api/matrix/channels',headers={'User-Agent' :UA}).content
  
    print 'WEB READ'
    
    return a
开发者ID:bialagary,项目名称:mw,代码行数:7,代码来源:default.py

示例7: PLAY_STREAM

def PLAY_STREAM(name,url,iconimage,cat):
    try:
        _name=name.split(' -')[0].replace('[/COLOR]','').replace('[COLOR yellow]','')
        playername=name.split('- ')[1].replace('[/COLOR]','').replace('[COLOR yellow]','')
    except:
        _name=name.replace('[/COLOR]','')
        playername=name.replace('[/COLOR]','')
    net.set_cookies(cookie_jar)
    url = '&mwAction=content&xbmc=1&mwData={"id":%s,"type":"tv"}'%cat
    link = net.http_GET(site+url, headers={'User-Agent' : UA}).content
    
    if '"allown":false' in link:
        try:
            match=re.compile('"message":"(.+?)"').findall(link)
            dialog = xbmcgui.Dialog()
            dialog.ok("NTV.mx", '', match[0].replace('\/','/'))
        except:
            dialog = xbmcgui.Dialog()
            dialog.ok("NTV.mx", '', 'Please Sign Up To Watch The Streams')
        
    else:
        match=re.compile('"src":"(.+?)","type":"rtmp"').findall(link)
        if match:
            url=match[0].replace('\/','/')

        else:
            match=re.compile('"src":"(.+?)","type":"hls"').findall(link)
            hls=match[0].replace('\/','/')
            url=hls
        liz=xbmcgui.ListItem(playername, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": playername} )
        liz.setProperty("IsPlayable","true")
        liz.setPath(url)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
开发者ID:noba3,项目名称:KoTos,代码行数:34,代码来源:default.py

示例8: GETCHANNELS

def GETCHANNELS():
	global chname
	global chlogos
	global chicon
	global chstream
	global headers
	chname=[]
	chlogos=[]
	chicon=[]
	chstream=[]
        headers={'User-Agent':'Dalvik/2.1.0 (Linux; U; Android 5.1.1; SM-G920F Build/LMY47X)',
			 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
			 'Accept-Encoding' : 'gzip',
        		 'Connection':'Keep-Alive'}
        page = net.http_GET ('aHR0cHM6Ly9kbC5kcm9wYm94LmNvbS9zL2RlNGtxcjA4czQ0bDJuei9pZCUzRDE0LnBocA=='.decode('base64'),headers).content
        match=re.compile('"channel_title":"(.+?)","channel_url":"(.+?)","channel_thumbnail":"(.+?)"').findall(page)
        match.sort()
        for name,url,thumb in match:
                if not '\u' in name:
                        thumb='http://proyectoluzdigital.info/tvguia/download/tododeportes/Logos/'+thumb
                        chname.append(name)
                        chicon.append(thumb)
                        chstream.append(url)
                        List.addItem(name)
      	window.setFocus(List)
开发者ID:kodiline,项目名称:repository.Play-Mix-EVO,代码行数:25,代码来源:default.py

示例9: PLAY_STREAM

def PLAY_STREAM(name, url, iconimage, cat):
    try:
        _name = name.split(" -")[0].replace("[/COLOR]", "").replace("[COLOR yellow]", "")
        playername = name.split("- ")[1].replace("[/COLOR]", "").replace("[COLOR yellow]", "")
    except:
        _name = name.replace("[/COLOR]", "")
        playername = name.replace("[/COLOR]", "")
    net.set_cookies(cookie_jar)
    url = '&mwAction=content&xbmc=1&mwData={"id":%s,"type":"tv"}' % cat
    link = net.http_GET(site + url).content
    if '"allown":false' in link:
        try:
            match = re.compile('"message":"(.+?)"').findall(link)
            dialog = xbmcgui.Dialog()
            dialog.ok("NTV.mx", "", match[0].replace("\/", "/"))
        except:
            dialog = xbmcgui.Dialog()
            dialog.ok("NTV.mx", "", "Please Sign Up To Watch The Streams")

    else:
        match = re.compile('"src":"(.+?)","type":"rtmp"').findall(link)
        rtmp = match[0].replace("\/", "/")
        playpath = rtmp.split("live/")[1]
        app = "live?" + rtmp.split("?")[1]
        url = (
            "%s swfUrl=http://ntv.mx/inc/grindplayer/GrindPlayer.swf app=%s playPath=%s pageUrl=http://ntv.mx/?c=2&a=0&p=50 timeout=10"
            % (rtmp, app, playpath)
        )
        liz = xbmcgui.ListItem(playername, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        liz.setInfo(type="Video", infoLabels={"Title": playername})
        liz.setProperty("IsPlayable", "true")
        pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        pl.clear()
        pl.add(url, liz)
        xbmc.Player().play(pl)
开发者ID:neopack1,项目名称:Aarron-Lee-XBMC-Repo-Oficial,代码行数:35,代码来源:default.py

示例10: CARDDETAILS

def CARDDETAILS(cat):
    nameselect = ["Cancel", "Visa", "Mastercard"]
    returnselect = ["Cancel", "visa", "master"]
    type = returnselect[xbmcgui.Dialog().select("Please Card Type", nameselect)]
    if not "Cancel" in type:
        name = Search("Name On Card").replace(" ", "%20")
        card = Numeric("16 Digit Card Number")
        month = Numeric("Expiry Month")
        year = Numeric("Expiry Full Year (YYYY)")
        cvv = Numeric("Security On Back Of Card (CVV)")
        url = (
            'https://www.ntv.mx/?c=8&a=15&oid=%s&card={"type":"%s","number":"%s","name":"%s","month":"%s","year":"%s","cvv":"%s"}'
            % (cat, type, card, name, month, year, cvv)
        )
        net.set_cookies(cookie_jar)
        link = net.http_GET(url).content
        data = json.loads(link)
        if "success" in link:
            dialog = xbmcgui.Dialog()
            winput = data["message"]
            dialog.ok("NTV.mx", "", winput, "")
        else:
            dialog = xbmcgui.Dialog()
            winput = data["message"]
            dialog.ok("NTV.mx", "", winput, "")
            if dialog.yesno("NTV.mx", "Do You Want To Try Again", ""):
                CARDDETAILS(cat)
            else:
                return
开发者ID:neopack1,项目名称:Aarron-Lee-XBMC-Repo-Oficial,代码行数:29,代码来源:default.py

示例11: resolve

def resolve(url):
        import net
        net = net.Net()
        web_url = url
        html = net.http_GET(web_url).content
        data = {}
        r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html)
        if r:
            for name, value in r:
                data[name] = value
        import captcha_lib
        data['method_free'] = 'Free Download'
        data.update(captcha_lib.do_captcha(html))
        html = net.http_POST(web_url, data).content
        data = {}
        r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html)
        if r:
            for name, value in r:
                data[name] = value
        data['referer'] = web_url
        headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36' }
        request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers)
        try: stream_url = urllib2.urlopen(request).geturl()
        except: return
        return stream_url
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:25,代码来源:default.py

示例12: EPISODES2

def EPISODES2(name,url,iconimage):
        imgid=url
        link = net.http_GET('http://api.animetoon.tv/GetDetails/'+url,headers=header).content
        id2 = re.compile('"id":"(.+?)"').findall(link)#THERE IS MORE THAN 1 ID
        foundnames=[]
        for num in id2:      
                links = net.http_GET('http://api.animetoon.tv/GetVideos/'+num+'\?direct',headers=header).content
                plinks = re.compile('"filename":"(.+?)","link":"(.+?)"').findall(links)
                for name,url in plinks:
                        url = url.replace('\/','/')
                        name=name.replace('_',' ').replace('.mp4','').replace('at ','').title()
                        if name in foundnames:
                                name = name+"[COLOR yellow][I] (version 2)[/COLOR][/I]"
                        iconimage = 'http://www.animetoon.tv/images/series/big/'+imgid+'.jpg'
                        foundnames.append(name)
                        addLink(name,url,2,iconimage,fanart)
开发者ID:anotherthief,项目名称:MetalKettles-Addon-Repository,代码行数:16,代码来源:default.py

示例13: GENRE

def GENRE(name,cat):
    _GENRE_=name.lower()
    now= datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S').replace(' ','%20')
    
    net.set_cookies(cookie_jar)
    url='&mwAction=category&xbmc=2&mwData={"id":"%s","time":"%s","type":"tv"}'%(cat,now)
    link = net.http_GET(site+url, headers={'User-Agent' : UA }).content
    data = json.loads(link)
    channels=data['contents']
    uniques=[]
    
    offset= int(data['offset'])
    for field in channels:
        genre      =  field['genre']
        endTime      =  field['time_to']
        name         =  field['name'].encode("utf-8")
        channel      =  field['id']
        whatsup      =  field['whatsup'].encode("utf-8")
        description  =  field['descr'].encode("utf-8")
        r=re.compile("(.+?)-(.+?)-(.+?) (.+?):(.+?):(.+?)")
        matchend     =  r.search(endTime)
        endyear      =  matchend.group(1)
        endmonth     =  matchend.group(2)
        endday       =  matchend.group(3)
        endhour      =  matchend.group(4)
        endminute    =  matchend.group(5)

        endDate  =  datetime.datetime(int(endyear),int(endmonth),int(endday),int(endhour),int(endminute)) + datetime.timedelta(seconds = offset)

        
        if ADDON.getSetting('tvguide')=='true':
            name='%s - [COLOR yellow]%s[/COLOR]'%(name,whatsup)
        if genre == _GENRE_:
            addDir(name,'url',200,imageUrl+channel+'.png',channel,'',description,now,endDate,whatsup)
        setView('movies', 'channels-view')         
开发者ID:exp-repo,项目名称:exp-repo,代码行数:35,代码来源:default.py

示例14: CARDDETAILS

def CARDDETAILS(cat):
        nameselect=['Cancel','Visa','Mastercard']
        returnselect=['Cancel','visa','master']
        type= returnselect[xbmcgui.Dialog().select('Please Card Type', nameselect)]
        if not 'Cancel' in type:
	        name=Search('Name On Card').replace(' ','%20')
	        card=Numeric('16 Digit Card Number')
	        month=Numeric('Expiry Month')
	        year=Numeric('Expiry Full Year (YYYY)')
	        cvv=Numeric('Security On Back Of Card (CVV)')
	        url='https://www.wliptv.com/?c=8&a=15&oid=%s&card={"type":"%s","number":"%s","name":"%s","month":"%s","year":"%s","cvv":"%s"}'%(cat,type,card,name,month,year,cvv)
	        net.set_cookies(cookie_jar)
	        link = net.http_GET(url, headers={'User-Agent' : UA}).content
	        data = json.loads(link)
	        if 'success' in link:
	            dialog = xbmcgui.Dialog()
	            winput= data['message']
	            dialog.ok("IPTV World", '',winput, '')
	        else:
	            dialog = xbmcgui.Dialog()
	            winput= data['message']
	            dialog.ok("IPTV World", '',winput, '')
	            if dialog.yesno("IPTV World", "Do You Want To Try Again", ""):
	               CARDDETAILS(cat)
	            else:
	                return
开发者ID:exp-repo,项目名称:exp-repo,代码行数:26,代码来源:default.py

示例15: onClick

 def onClick(self, controlID):
     if controlID == 7:
         if int(self.getControl(5).isSelected()) > 0:  self.card_type = 'master'
         if int(self.getControl(6).isSelected()) > 0:  self.card_type = 'visa'
         xbmc.executebuiltin( "Skin.Reset(AnimeWindowXMLDialogClose)" )
         self.close()
         self.name = self.getControl(8).getText().replace(' ','%20') 
         self.card_number = self.getControl(9).getText()
         self.expiry_month = self.getControl(10).getText()
         self.expiry_year = self.getControl(21).getText()
         self.sec_cvv = self.getControl(22).getText()
         net.set_cookies(cookie_jar)
         url = 'https://www.wliptv.com/?c=8&a=15&oid=%s&card={"type":"%s","number":"%s","name":"%s","month":"%s","year":"%s","cvv":"%s"}'%(self.cat,
                                                                                                                                              self.card_type,
                                                                                                                                              self.card_number,
                                                                                                                                              self.name,
                                                                                                                                              self.expiry_month,
                                                                                                                                              self.expiry_year,
                                                                                                                                              self.sec_cvv)
         link = net.http_GET(url, headers={'User-Agent' : UA}).content
         data = json.loads(link)
         if 'success' in link:
             dialog = xbmcgui.Dialog()
             winput= data['message']
             dialog.ok("IPTV World", '',winput, '')
         else:
             dialog = xbmcgui.Dialog()
             winput= data['message']
             dialog.ok("IPTV World", '',winput, '')
             if dialog.yesno("IPTV World", "Do You Want To Try Again", ""):
                 card_payment('thingy.xml',ADDON.getAddonInfo('path'),'DefaultSkin',cat=cat).show() 
             else: return
开发者ID:exp-repo,项目名称:exp-repo,代码行数:32,代码来源:default.py


注:本文中的net.http_GET函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。