當前位置: 首頁>>代碼示例>>Python>>正文


Python Net.http_GET方法代碼示例

本文整理匯總了Python中net.Net.http_GET方法的典型用法代碼示例。如果您正苦於以下問題:Python Net.http_GET方法的具體用法?Python Net.http_GET怎麽用?Python Net.http_GET使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.Net的用法示例。


在下文中一共展示了Net.http_GET方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: OpenNET

# 需要導入模塊: from net import Net [as 別名]
# 或者: from net.Net import http_GET [as 別名]
def OpenNET(url):
    try:
       net = Net(cookie_file=cookiejar)
       #net = Net(cookiejar)
       try:
            second_response = net.http_GET(url)
       except:
            second_response = net.http_GET(url.encode("utf-8"))
       return second_response.content
    except:
       d = xbmcgui.Dialog()
       d.ok(url,"Can't Connect to site",'Try again in a moment')
開發者ID:dknlght,項目名稱:dkodi,代碼行數:14,代碼來源:ADDON.py

示例2: __init__

# 需要導入模塊: from net import Net [as 別名]
# 或者: from net.Net import http_GET [as 別名]

#.........這裏部分代碼省略.........
            if url.find('divxstage.to') > -1:
                page = mod_request(url)
                key = re.compile('flashvars.filekey=".*?-(.+?)";').findall(page)
                filekey = key[0]
                key2 = re.compile('flashvars.file="(.*?)";').findall(page)
                media_id = key2[0]
                api = 'http://www.divxstage.eu/api/player.api.php?user=undefined&key=' + filekey + '&pass=undefined&codes=1&file=' + media_id
                try:
                    html = mod_request(api)
                    r = re.search('url=(.+?)&title', html)
                except:
                    print 'divxstage errorrrrrrrrr'

                if r:
                    stream_url = r.group(1)
                url = stream_url
            if url.find('youwatch.org') > -1:
                #url = url.replace('.org/', '.org/embed-')
                url = url
                soup = mod_request(url)
                html = soup.decode('utf-8')
                jscript = re.findall('function\\(p,a,c,k,e,d\\).*return p\\}(.*)\\)', html)
                if jscript:
                    lsParam = eval(jscript[0].encode('utf-8'))
                    flashvars = exec_javascript(lsParam)
                    r = re.findall('file:"(.*)",provider', flashvars)
                    if r:
                        stream_url = r[0].encode('utf-8')
                url = stream_url
            if url.find('vodlocker.com') > -1:
                url = url.find('embed\-','')
                url = url.find('\-640x360.html','')
                post_url = url
                resp = self.net.http_GET(url)
                html = resp.content
                data = {}
                r = re.findall('type="hidden" name="(.+?)"\\s* value="?(.+?)">', html)
                data['usr_login'] = ''
                for name, value in r:
                    data[name] = value

                data['imhuman'] = 'Proceed to video'
                data['btn_download'] = 'Proceed to video'
                sleep(20)
                html = self.net.http_POST(post_url, data).content
                r = re.search('file\\s*:\\s*"(http://.+?)"', html)
                if r:
                    stream_url = str(r.group(1))
                url = stream_url
            if url.find('vidto.me') > -1:
                url = url.find('embed\-','')
                url = url.find('\-640x360.html','')
                print '39'
                print url
                html = self.net.http_GET(url).content
                sleep(6)
                data = {}
                r = re.findall('type="(?:hidden|submit)?" name="(.+?)"\\s* value="?(.+?)">', html)
                for name, value in r:
                    data[name] = value

                html = self.net.http_POST(url, data).content
                r = re.search('<a id="lnk_download" href="(.+?)"', html)
                if r:
                    r = re.sub(' ', '%20', r.group(1))
                    url2 = r
開發者ID:Backmute,項目名稱:seppius-xbmc-repo,代碼行數:70,代碼來源:SGInternationalParser.py


注:本文中的net.Net.http_GET方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。