本文整理汇总了Python中t0mm0.common.net.net函数的典型用法代码示例。如果您正苦于以下问题:Python net函数的具体用法?Python net怎么用?Python net使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了net函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_link
def get_link(murl):
setCookie(murl)
response = net().http_GET(murl)
link = response.content
link = cleanHex(link)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
m3u8=re.findall('<a href="([^"]+?.m3u8)">',link)
iframe=re.findall('<iframe src="(http://admin.livestreamingcdn.com[^"]+?)"',link)
if m3u8:
return m3u8[0]
elif iframe:
response = net().http_GET(iframe[0])
link = response.content
link = cleanHex(link)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
vlink=re.findall('file: "([^"]+?.m3u8)"',link)
return vlink[0]
else:
swf=re.findall("src='([^<]+).swf'",link)[0]
file=re.findall("file=(.+?)&",link)[0]
file=file.replace('.flv','')
streamer=re.findall("streamer=(.+?)&",link)[0]
if '.mp4' in file and 'vod' in streamer:
file='mp4:'+file
return streamer+' playpath='+file+' swfUrl='+swf+'.swf pageUrl='+murl
else:
return streamer+' playpath='+file+' swfUrl='+swf+'.swf pageUrl='+murl+' live=true timeout=20'
示例2: LISTSP5
def LISTSP5(murl):
nrDomain = GetNewUrl();
murl=nrDomain+'/latest.php'
lurl=nrDomain+'/login2.php'
net().http_POST(lurl,{'email':user,'password':passw})
response = net().http_GET(murl)
link = response.content
if response.get_url() != murl:
xbmc.executebuiltin("XBMC.Notification(Sorry!,Email or Password Incorrect,10000,"+smalllogo+")")
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'',art+'/link.png')
match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(link)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until Movie list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
id = 1;
for year,url,name in match:
name=main.unescapes(name)
if(year=='0'):
year='0000'
url=nrDomain+url
main.addDown3(name+' [COLOR red]('+year+')[/COLOR]',url,58,'','',id)
id += 1
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if (dialogWait.iscanceled()):
return False
dialogWait.close()
del dialogWait
main.GA("HD","Starplay")
main.VIEWS()
示例3: LISTCONTENT
def LISTCONTENT(murl,thumb):
setCookie(murl)
response = net().http_GET(murl)
link = response.content
link = cleanHex(link)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
if 'http://hostaccess.org/7-SFE-SZE-HOSTACCESS/media/vod.php' == murl:
response = net().http_GET('http://sportsaccess.se/forum/misc.php?page=Replays')
link = response.content
link = cleanHex(link)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
match=re.compile('<a href="([^"]+)"><img src="([^"]+)" width=".+?alt="([^"]+)"></a>').findall(link)
for url,thumb,name in match:
if 'http' not in thumb:
thumb='http://sportsaccess.se/forum/'+thumb
main.addDir(name,url,411,thumb)
else:
match=re.compile('<a href="(.+?)">(.+?)</a>').findall(link)
for url,name in match:
if 'GO BACK' not in name and '1 Year Subscriptions' not in name and 'Live Broadcasts' not in name and '<--- Return To On Demand Guide' not in name:
name = re.sub('(?sim)<[^>]*?>','',name)
if 'http' not in url:
url='http://sportsaccess.se'+url
main.addPlayL(name,url,413,thumb,'','','','','')
示例4: find_noobroom_video_url
def find_noobroom_video_url(page_url):
import urllib2
headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36'}
setCookie(re.sub('http://([^/]+?)/.*','\\1',page_url))
html = net().http_GET(page_url).content
media_id = re.compile('"file": "(.+?)"').findall(html)[0]
fork_url = re.compile('"streamer": "(.+?)"').findall(html)[0] + '&start=0&file=' + media_id
class MyHTTPRedirectHandler(urllib2.HTTPRedirectHandler):
def http_error_302(self, req, fp, code, msg, headers):
#print headers
self.video_url = headers['Location']
#print self.video_url
return urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
http_error_301 = http_error_303 = http_error_307 = http_error_302
myhr = MyHTTPRedirectHandler()
opener = urllib2.build_opener(
urllib2.HTTPCookieProcessor(net()._cj),
urllib2.HTTPBasicAuthHandler(),
myhr)
urllib2.install_opener(opener)
req = urllib2.Request(fork_url)
for k, v in headers.items():
req.add_header(k, v)
try: response = urllib2.urlopen(req)
except: pass
return myhr.video_url
示例5: Index
def Index():
deletecachefiles()
announce()
setCookie('http://rarehost.net/amember/member')
response = net().http_GET('http://rarehost.net/amember/member')
if not 'Logged in as' in response.content:
dialog = xbmcgui.Dialog()
dialog.ok('HQZone', 'Login Error','An error ocurred logging in. Please check your details','Ensure your account is active on http://hqzone.tv')
quit()
link = response.content
link = cleanHex(link)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
addDir('[COLOR blue][B]--- View Todays Overview ---[/B][/COLOR]','http://hqzone.tv/forums/forum.php',7,icon,fanart)
addDir('[COLOR blue][B]--- View This Weeks Schedule ---[/B][/COLOR]','http://hqzone.tv/forums/calendar.php?c=1&do=displayweek',6,icon,fanart)
addLink(' ','url',5,icon,fanart)
vip=re.compile('<li><a href="(.+?)">VIP Streams</a>').findall(link)
if len(vip)>0:
vip=vip[0]
addDir('[COLOR gold]VIP[/COLOR] HQ Streaming Channels','http://rarehost.net/amember/vip/vip.php',2,icon,fanart)
addDir('[COLOR gold]VIP[/COLOR] HQ Video on Demand','url',4,icon,fanart)
addLink(' ','url',5,icon,fanart)
addLink('How to Subscribe','url',302,icon,fanart)
addLink('[COLOR blue]Twitter[/COLOR] Feed','url',100,icon,fanart)
addLink('HQZone Account Status','url',200,icon,fanart)
addDir('HQ Zone Support','url',300,icon,fanart)
addLink(' ','url',5,icon,fanart)
response = net().http_GET('http://pastebin.com/raw.php?i=Jp76gEmp')
link = response.content
ticker=re.compile('<ticker>(.+?)</ticker>').findall(link)[0]
addLink('[COLOR red][I]'+ ticker +'[/I][/COLOR]','url','mode',icon,fanart)
xbmc.executebuiltin('Container.SetViewMode(50)')
示例6: SEARCHRlsmix
def SEARCHRlsmix(murl):
log_in = net().http_POST('http://directdownload.tv',{'username':user,'password':passw,'Login':'Login'}).content
seapath=os.path.join(main.datapath,'Search')
SeaFile=os.path.join(seapath,'SearchHistoryTv')
try:
os.makedirs(seapath)
except:
pass
if murl == 'rlsmix':
keyb = xbmc.Keyboard('', 'Search For Shows or Movies')
keyb.doModal()
if (keyb.isConfirmed()):
search = keyb.getText()
encode=urllib.quote(search)
surl='http://directdownload.tv/index/search/keyword/'+encode+'/qualities/pdtv,dsr,realhd,dvdrip,webdl,webdl1080p/from/0/search'
if not os.path.exists(SeaFile) and encode != '':
open(SeaFile,'w').write('search="%s",'%encode)
else:
if encode != '':
open(SeaFile,'a').write('search="%s",'%encode)
searchis=re.compile('search="(.+?)",').findall(open(SeaFile,'r').read())
for seahis in reversed(searchis):
continue
if len(searchis)>=10:
searchis.remove(searchis[0])
os.remove(SeaFile)
for seahis in searchis:
try:
open(SeaFile,'a').write('search="%s",'%seahis)
except:
pass
else:
encode = murl
surl='http://directdownload.tv/index/search/keyword/'+encode+'/qualities/pdtv,dsr,realhd,dvdrip,webdl,webdl1080p/from/0/search'
link = net().http_GET(surl).content
urllist=main.unescapes(link)
match=re.compile('{"release":"(.+?)","when":.+?,"size":".+?","links":(.+?),"idtvs".+?}').findall(urllist)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until Show list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0,'[B]Will load instantly from now on[/B]',remaining_display)
for name,url in match:
name=name.replace('.',' ')
url=url.replace('\/','/')
main.addDirTE(name,url,62,'','','','','','')
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if (dialogWait.iscanceled()):
return False
dialogWait.close()
del dialogWait
main.GA("Movie1k","Search")
示例7: setCookie
def setCookie(srDomain):
cookieExpired = False
if os.path.exists(cookie_file):
try:
cookie = open(cookie_file).read()
expire = re.search('expires="(.*?)"',cookie, re.I)
if expire:
expire = str(expire.group(1))
import time
if time.time() > time.mktime(time.strptime(expire, '%Y-%m-%d %H:%M:%SZ')):
cookieExpired = True
except: cookieExpired = True
if not os.path.exists(cookie_file) or cookieExpired:
html = net().http_GET(srDomain).content
r = re.findall(r'<input type="hidden" name="(.+?)" value="(.+?)" />', html, re.I)
post_data = {}
post_data['amember_login'] = user
post_data['amember_pass'] = passw
for name, value in r:
post_data[name] = value
print post_data
net().http_GET('https://hostaccess.org/amember/protect/new-rewrite?f=2&url=/member1/&host=hostaccess.org&ssl=off')
net().http_POST('https://hostaccess.org/amember/protect/new-rewrite?f=2&url=/member1/&host=hostaccess.org&ssl=off',post_data)
net().save_cookies(cookie_file)
else:
net().set_cookies(cookie_file)
示例8: resolve_veehd
def resolve_veehd(url):
name = "veeHD"
cookie_file = os.path.join(datapath, "%s.cookies" % name)
user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"
from random import choice
userName = ["mashup1", "mashup3", "mashup4", "mashup5", "mashup6", "mashup7"]
try:
loginurl = "http://veehd.com/login"
ref = "http://veehd.com/"
submit = "Login"
terms = "on"
remember_me = "on"
data = {
"ref": ref,
"uname": choice(userName),
"pword": "xbmcisk00l",
"submit": submit,
"terms": terms,
"remember_me": remember_me,
}
html = net(user_agent).http_POST(loginurl, data).content
net().save_cookies(cookie_file)
headers = {}
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
}
net().set_cookies(cookie_file)
print "Mash Up VeeHD - Requesting GET URL: %s" % url
html = net().http_GET(url, headers).content
fragment = re.findall('playeriframe".+?attr.+?src : "(.+?)"', html)
frag = "http://%s%s" % ("veehd.com", fragment[1])
net().set_cookies(cookie_file)
html = net().http_GET(frag, headers).content
r = re.search('"video/divx" src="(.+?)"', html)
if r:
stream_url = r.group(1)
if not r:
message = name + "- 1st attempt at finding the stream_url failed probably an Mp4, finding Mp4"
addon.log_debug(message)
a = re.search('"url":"(.+?)"', html)
if a:
r = urllib.unquote(a.group(1))
if r:
stream_url = r
else:
xbmc.executebuiltin("XBMC.Notification(File Not Found,VeeHD,2000)")
return False
if not a:
a = re.findall('href="(.+?)">', html)
stream_url = a[1]
return stream_url
except Exception, e:
print "**** Mash Up VeeHD Error occured: %s" % e
# addon.show_small_popup('[B][COLOR green]Mash Up: VeeHD Resolver[/COLOR][/B]','Error, Check XBMC.log for Details',5000, error_logo)
raise ResolverError(str(e), "VeeHD")
示例9: SEASONS
def SEASONS(url,name):
try:
title = re.compile(r'www.movie2k.to-(.+?)-watch').findall(url.replace('/','-'))[0]
html = net().http_GET(url,{'Cookie':'onlylanguage=en'}).content
seasons = re.compile('<OPTION value="[^a-zA-Z]+">Season (.+?)</OPTION>').findall(html.replace(' selected','').replace('\t',''))
cover = grab.get_seasons(name.replace('[B][COLOR green]','').replace('[/COLOR][/B]','').replace('*SUBTITLED*',''), None, seasons, overlay=6)
covers= re.compile("'cover_url': '(.+?)',").findall(str(cover))
for i in range(0,len(seasons)):
addDir("%s ~ Season %s"%(name,seasons[i].replace('\t','').encode('ascii','ignore').strip()),url,6,covers[i],None,int(len(seasons)))
except:
html = net().http_GET(url,{'Cookie':'onlylanguage=en'}).content
redirect = re.compile('<TD id="tdmovies" width="538"><a href="(.+?)">',re.DOTALL).findall(html.replace('\t',''))
link="http://www.movie2k.to/%s"%re.compile('<TD id="tdmovies" width="538"><a href="(.+?)">',re.DOTALL).findall(net().http_GET("http://www.movie2k.to/%s"%redirect[0],{'Cookie':'onlylanguage=en'}).content)[0]
SEASONS(link,name)
示例10: vodlisting
def vodlisting(name,url):
setCookie('http://rarehost.net/amember/member')
response = net().http_GET(url)
link = response.content
link = cleanHex(link)
match=re.compile("playlist: '(.+?)'").findall(link)[0]
if 'Weeklies' in name:url='http://rarehost.net/amember/free/'+match
else:url = 'http://rarehost.net/amember/vip/'+match
setCookie('http://rarehost.net/amember/member')
response = net().http_GET(url)
link = response.content
link = cleanHex(link)
match=re.compile('<title>(.+?)</title>.+?source file="(.+?)"',re.DOTALL).findall(link)
for name,url in match:
addLink(name,url,53,icon,fanart)
示例11: setCookie
def setCookie(srDomain):
html = net().http_GET(srDomain).content
r = re.findall(r'<input type="hidden" name="(.+?)" value="(.+?)" />', html, re.I)
post_data = {}
post_data["amember_login"] = user
post_data["amember_pass"] = passw
for name, value in r:
post_data[name] = value
net().http_GET("http://straighthost.com/billing/member")
net().http_POST("http://straighthost.com/billing/member", post_data)
net().save_cookies(cookie_file)
net().set_cookies(cookie_file)
示例12: setCookie
def setCookie(srDomain):
html = net().http_GET(srDomain).content
r = re.findall(r'<input type="hidden" name="(.+?)" value="(.+?)" />', html, re.I)
post_data = {}
post_data['amember_login'] = user
post_data['amember_pass'] = passw
for name, value in r:
post_data[name] = value
net().http_GET('http://rarehost.net/amember/member')
net().http_POST('http://rarehost.net/amember/member',post_data)
net().save_cookies(cookie_file)
net().set_cookies(cookie_file)
示例13: IiI
def IiI ( srDomain ) :
I11 = net ( ) . http_GET ( srDomain ) . content
Oo0o0000o0o0 = re . findall ( r'<input type="hidden" name="(.+?)" value="(.+?)" />' , I11 , re . I )
oOo0oooo00o = { }
oOo0oooo00o [ 'amember_login' ] = II1
oOo0oooo00o [ 'amember_pass' ] = O00ooooo00
for i1i1II , oO0o0o0ooO0oO in Oo0o0000o0o0 :
oOo0oooo00o [ i1i1II ] = oO0o0o0ooO0oO
net ( ) . http_GET ( base64 . b64decode ( ooOo ) )
net ( ) . http_POST ( base64 . b64decode ( ooOo ) , oOo0oooo00o )
net ( ) . save_cookies ( I1IiiI )
net ( ) . set_cookies ( I1IiiI )
示例14: luckydip
def luckydip(url):
response = net().http_GET(url)
link = response.content
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
match=re.compile('<title>(.+?)</title><link>(.+?)</link>').findall(link)
for channel,url in match:
addLink(channel,url,53,icon,fanart)
示例15: getchannels
def getchannels(url):
vip = 0
if 'vip' in url:
baseurl = 'http://rarehost.net/site/vip/'
vip = 1
else:baseurl = 'http://rarehost.net/site/free/'
setCookie('http://rarehost.net/site/member')
response = net().http_GET(url)
link = response.content
link = cleanHex(link)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','')
match=re.compile('<a href="(.+?)"></br><font color= "\#fff" size="\+1"><b>(.+?)</b>').findall(link)
for url,channel in match:
channel = channel + ':'+ ':'+ ':'+ ':'
channel = channel.replace('</font>','').replace('Online','[COLOR limegreen]Online[/COLOR]').replace('Offline','[COLOR red]Offline[/COLOR]').replace('online','[COLOR limegreen]Online[/COLOR]').replace('offline','[COLOR red]Offline[/COLOR]')
channel = channel.replace('**HD**','[COLOR gold]**HD**[/COLOR]').replace('**720p**','[COLOR gold]**720p**[/COLOR]')
chsplit = channel.split(':')
channel = '[COLOR blue]'+chsplit[0]+'[/COLOR]'+' '+chsplit[1]+chsplit[2]
url = baseurl+url
addLink(channel,url,3,icon,fanart)
match=re.compile("<a href='(.+?)'></br><font color= '\#fff' size='\+1'><b>(.+?)</b>").findall(link)
print match
for url,channel in match:
channel = channel + ':'+ ':'+ ':'+ ':'
channel = channel.replace('</font>','').replace('Online','[COLOR limegreen]Online[/COLOR]').replace('Offline','[COLOR red]Offline[/COLOR]').replace('online','[COLOR limegreen]Online[/COLOR]').replace('offline','[COLOR red]Offline[/COLOR]')
channel = channel.replace('**HD**','[COLOR gold]**HD**[/COLOR]').replace('**720p**','[COLOR gold]**720p**[/COLOR]')
chsplit = channel.split(':')
channel = '[COLOR blue]'+chsplit[0]+'[/COLOR]'+' '+chsplit[1]+chsplit[2]
url = baseurl+url
addLink(channel,url,3,icon,fanart)
xbmc.executebuiltin('Container.SetViewMode(50)')