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


Python Net.http_POST方法代碼示例

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


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

示例1: __init__

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

#.........這裏部分代碼省略.........
                    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
                url = url2
            if url.find('sharevid.org') > -1:
                html = self.net.http_GET(url).content
                data = {}
                r = re.findall('type="hidden" name="(.+?)"\\s* value="?(.+?)">', html)
                for name, value in r:
                    data[name] = value

                html = self.net.http_POST(url, data).content
                r = re.search("file\\s*:\\s*'(.+?)'", html)
                if r:
開發者ID:Backmute,項目名稱:seppius-xbmc-repo,代碼行數:70,代碼來源:SGInternationalParser.py

示例2:

# 需要導入模塊: from net import Net [as 別名]
# 或者: from net.Net import http_POST [as 別名]
         r = re.search('value="([0-9a-f]+?)" name="hash"', html)
     except:
         pass
 else:
     try:
         r = re.search('input type="hidden" value="(.*?)" name="foo"', html)
     except:
         pass
 if r:
     session_hash = r.group(1)
 else:
     xbmc.executebuiltin('Notification("1","3")')
     return False
 if not'videoslasher' in url:
     try:
         html = net.http_POST(url, form_data={'hash': session_hash, 
                                                        'confirm': 'Continue as Free User'}).content
     except urllib2.URLError, e:
         xbmc.executebuiltin('Notification("1","4")')
 else:
     try:
         html = opener.open(url,urllib.urlencode({'foo': 'bar','confirm': 'Continue as Free User'})).read()
     except:
         pass 
 r = re.search("key: '\#\$0c4de(.*?)'", html)
 player_key = ""
 if not'videoslasher' in url:
     r = re.search('\?stream=(.+?)\'', html)
 else:
     r = re.search('/playlist/(.+?)\'', html)
 if not'videoslasher' in url:
     if r:
開發者ID:noba3,項目名稱:KoTos,代碼行數:34,代碼來源:default.py


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