本文整理汇总了Python中resources.libs.main.supportedHost函数的典型用法代码示例。如果您正苦于以下问题:Python supportedHost函数的具体用法?Python supportedHost怎么用?Python supportedHost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了supportedHost函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LINKLISTSS
def LINKLISTSS(mname,url):
link=main.OPENURL(url)
link=link.replace('\r','').replace('\n','').replace('\t','')
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('<p><!--baslik:.+?--><br /><IFRAME SRC="(.+?)"',re.I).findall(link)
if match:
host=re.compile("http://(.+?)/.+?").findall(match[0])
host=host[0].replace('www.','')
host=host.split('.')[0]
if main.supportedHost(host):
main.addDown2(mname+' [COLOR blue]'+host.upper()+' [/COLOR]',match[0],327,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
match=re.compile('<a href="([^<]+)"><span>(.+?)</span></a>',re.DOTALL).findall(link)
for url,host in match:
if main.supportedHost(host):
main.addDown2(mname+' [COLOR blue]'+host.upper()+' [/COLOR]',url,327,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例2: LINKSP2
def LINKSP2(mname,url):
link=main.OPENURL(url)
link=main.unescapes(link)
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match0=re.compile('title="[^"]+?">([^"]+?)</a>.+?</p><ul>(.+?)</ul>').findall(link)
if not match0:
match0=re.compile('<h4>(.+?)</h4>(.+?)</ul>').findall(link)
if not match0:
match0=re.compile('<p><img src=".+?" alt="([^"]+?)" /></p>.+?<ul>(.+?)</ul>').findall(link)
for mname, links in reversed(match0):
match1=re.compile('<li><a href="([^"]+?)"[^>]*?><img [^>]*?alt="([^"]+?)"[^>]*?></a></li>').findall(links)
match= match1 + re.compile('<li><a href="([^"]+?)"[^>]*?>([^>]+?)</a></li>').findall(links)
filename = False
for murl, name in match:
fn = re.search('/([^/]+?\.(mkv|avi|mp4))(\.html)?$',murl)
if fn:
filename = fn.group(1)
break
for murl, name in match:
name = name[0].upper() + name[1:]
if main.supportedHost(name):
thumb=name.lower()
# if re.search('billionuploads',murl) and filename: murl += '#@#' + filename
main.addDown2(main.CleanTitle(mname)+' [COLOR blue]'+name+'[/COLOR]',murl,209,art+'/hosts/'+thumb+".png",art+'/hosts/'+thumb+".png")
示例3: ListSceneLogLinks
def ListSceneLogLinks(mname,url):
html = main.OPENURL(url)
html = main.unescapes(html)
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
paragraphs = re.compile('<p>.*?</p>',re.I|re.DOTALL).findall(html)
itemsAdded = 0
from urlparse import urlparse
for paragraph in paragraphs:
links = re.compile('<a[\s]*?href="(.*?)"',re.I|re.DOTALL).findall(paragraph)
if len(links) == 1: # if more than 1 links per paragraph, its probably splitted file
for url in links:
if not re.search('rar',url,re.I):
host = urlparse(url).hostname.replace('www.','').partition('.')[0]
if main.supportedHost(host):
title = mname
quality = re.search('(?i)(720p|1080p|HDTV|PDTV|WEB DL|DVDRIP|WS DSR|DSR|BDRip|WEBRiP)',url,re.I)
if quality and not quality.group(1).lower() in mname.lower() :
title = re.sub('\[COLOR.*?\[/COLOR\]','',title).strip()
title += ' [COLOR red]'+quality.group(1).upper()+'[/COLOR]'
host = re.sub('^(https?://)?[^/]*?([^/^.]+?)\.\w+?/.*','\\2',url).upper()
thumb = host.lower()
main.addDown2(title+' [COLOR blue]'+host+'[/COLOR]',url,658,art+'/hosts/'+thumb+".png",art+'/hosts/'+thumb+".png")
itemsAdded += 1
if not itemsAdded:
xbmcplugin.endOfDirectory(int(sys.argv[1]), False, False)
xbmc.executebuiltin("XBMC.Notification(Sorry,No sources found!,3000)")
示例4: LINKLIST2
def LINKLIST2(mname,url):
if selfAddon.getSetting("hide-download-instructions") != "true": main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('href="(.+?)" target="_blank">(.+?)</a>',re.DOTALL).findall(url)
for url,host in match:
if main.supportedHost(host):
mname=main.removeColoredText(mname)
main.addDown2(mname+' [COLOR blue]'+host.upper()+' [/COLOR]',url,314,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例5: LISTHOST
def LISTHOST(mname,murl,thumb):
epi = re.findall('\ss(\d+)e(\d+)\s',mname + " ",re.I)
for s,e in epi: pass
if e[0:1]=='0': epis=e[1:]
else: epis=e
CheckNextEpi= int(epis)+1
if(len(str(CheckNextEpi))==1): CheckNextEpi = "0" + str(CheckNextEpi)
CheckNextEpi ="S" + str(s) + "E" + str(CheckNextEpi)
CurrentEpi = re.search('(?i)(s\d+e\d+)',mname)
link=main.OPENURL(murl)
link=link.replace('\r','').replace('\n','').replace('\t','')
if selfAddon.getSetting("hide-download-instructions") != "true": main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
if CheckNextEpi in link: links = re.search('<td class="mnllinklist" align="right"><div class="right">'+CurrentEpi.group(1)+'.+?</div>(.+?)<div class="right">'+CheckNextEpi+'.+?</div>', link)
else: links = re.search('<td class="mnllinklist" align="right"><div class="right">'+CurrentEpi.group(1)+'.+?</div>(.+?)<!-- End of the page footer -->', link)
if links:
links = links.group(1)
match=re.compile('''<a onclick='.+?href="([^"]+?)" target=".+?"><div>.+?</div><span>Loading Time: <span class='.+?'>([^<]+?)</span><br/>Host:(.+?)<br/>''', re.DOTALL).findall(links)
for url, loadtime, name in match:
domain=name
name=name.replace(' ','')
if name[0:1]=='.': name=name[1:]
name=name.split('.')[0]
if main.supportedHost(name.strip().lower()):
try:mediaID=url.split('?id=')[1]
except:mediaID=url.split('http://')[1].split('/')[1]
main.addDown2(mname+' [COLOR red](Loading Time: '+loadtime+')[/COLOR]'+' [COLOR blue]'+name.upper()+'[/COLOR]',name.lower().strip()+'x1x8x'+mediaID,462,art+'/hosts/'+name.lower()+'.png',art+'/hosts/'+name.lower()+'.png')
示例6: LINK2
def LINK2(name,url):
html = main.OPENURL(url)
html=html.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('IFRAME SRC','iframe src').replace("",'').replace('\xe2\x80\x99',"'").replace('\xe2\x80\x93','-')
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
r = re.compile(r'<b>([^"]*)</b></span><br /><iframe src="([^"]*)"',re.M|re.DOTALL).findall(html)
for host,url in r:
from urlparse import urlparse
host = urlparse(url).hostname.replace('www.','').partition('.')[0]
if main.supportedHost(host):
main.addDown2(name.strip()+" [COLOR blue]"+host.upper()+"[/COLOR]",url,2,art+'/hosts/'+host+'.png',art+'/hosts/'+host+'.png')
示例7: LINKLIST
def LINKLIST(mname,url):
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile("""><img alt="([^<]+)" src="[^<]+" onClick="cargar.?'#player','(.+?)'""",re.DOTALL).findall(link)
for host,url in match:
host=host.replace(' Java','').replace('ShockShare','SockShare').replace('.to','')
print host
if main.supportedHost(host):
mname=main.removeColoredText(mname)
main.addDown2(mname+' [COLOR blue]'+host.upper()+'[/COLOR]','http://www.estrenosvk.com/player/'+url,310,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例8: ListDirectDownloadTVLinks
def ListDirectDownloadTVLinks(mname,url):
ok=True
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('{"url":"([^"]+?)","hostname":"([^"]+?)"}').findall(url)
for url,host in match:
thumb=host.lower()
urlExceptions = re.compile('rar').findall(url)
# hostExceptions = re.compile('fileom|oteupload').findall(host)
# if not urlExceptions and not hostExceptions:
if not urlExceptions and main.supportedHost(host):
main.addDown2(mname+' [COLOR blue]'+host.upper()+'[/COLOR]',url,210,art+"/hosts/"+thumb+".png",art+"/hosts/"+thumb+".png")
示例9: LINKLIST
def LINKLIST(mname,url):
link=main.OPENURL2(url)
link=link.replace('<iframe src="http://ads.affbuzzads.com','')
link=main.unescapes(link)
if selfAddon.getSetting("hide-download-instructions") != "true": main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('<iframe src="(.+?)" frameborder',re.DOTALL).findall(link)
for url in match:
hostn=re.compile("http://(.+?)/.+?").findall(url)
for hname in hostn:
host=hname.replace('www.','').replace('embed.','').replace('.es','').replace('.in','').replace('.sx','').replace('.net','').replace('.com','').replace('.to','').replace('.org','').replace('.ch','').replace('.eu','').replace('.ES','')
host=host.split('.')[0]
if main.supportedHost(host):
mname=main.removeColoredText(mname)
main.addDown2(mname+' [COLOR blue]'+host.upper()+' [/COLOR]',url,314,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例10: LISTEPISODE
def LISTEPISODE(mname,url):
link=main.OPENURL(url)
link=link.replace('\r','').replace('\n','').replace('\t','')
link=main.unescapes(link)
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('<dd><a href="([^<]+)" class="zoombox.+?" title="([^<]+)">',re.DOTALL).findall(link)
for url,name in match:
hostn=re.compile("http://(.+?)/.+?").findall(url)
for hname in hostn:
host=hname.replace('www.','').replace('embed.','').replace('.es','').replace('.in','').replace('.sx','').replace('.net','').replace('.com','').replace('.to','').replace('.org','').replace('.ch','').replace('.eu','').replace('.ES','')
host=host.split('.')[0]
if main.supportedHost(host):
mname=main.removeColoredText(mname)
main.addDown2(name+' [COLOR blue]'+host.upper()+' [/COLOR]',url,797,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例11: LINKLIST
def LINKLIST(mname,url):
link=main.OPENURL(url)
link=link.replace('\r','').replace('\n','').replace('\t','').replace('<iframe src="//www.facebook.com/plugins/likebox.php','').replace('<iframe src="http://creative.rev2pub.com','')
link=main.unescapes(link)
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('<center><iframe.+?src="(.+?)".+?',re.DOTALL | re.IGNORECASE).findall(link)
#main.ErrorReport(match)
for url in match:
hostn=re.compile("http://(.+?)/.+?").findall(url)
for hname in hostn:
host=hname.replace('www.','').replace('embed.','').replace('.es','').replace('.in','').replace('.sx','').replace('.net','').replace('.com','').replace('.to','').replace('.org','').replace('.ch','').replace('.eu','').replace('.ES','')
host=host.split('.')[0]
if main.supportedHost(host):
mname=main.removeColoredText(mname)
main.addDown2(mname+' [COLOR blue]'+host.upper()+' [/COLOR]',url,797,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例12: LINKLIST
def LINKLIST(mname,url):
link=main.OPENURL(url)
link=main.unescapes(link)
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('<span class="(.+?)">.+?</span></td><td class="tdcalidad">(.+?)</td><td class=".+?<img src=".+?" alt="(.+?)" />.+?</td>.+?title=".+?" href="(.+?)">',re.DOTALL).findall(link)
for lang,qua,host,url in match:
if 'flag flag_0' in lang:
lang= ' [COLOR red]ESP[/COLOR]'
if 'flag flag_1' in lang:
lang= ' [COLOR yellow]LAT[/COLOR]'
if 'flag flag_2' in lang:
lang= ' [COLOR purple]ENG[/COLOR]'
if 'flag flag_3' in lang:
lang= ' [COLOR green]SUB[/COLOR]'
if main.supportedHost(host):
mname=main.removeColoredText(mname)
main.addDown2(mname+' [COLOR blue]'+host.upper()+' [/COLOR]'+ lang+' [COLOR aqua]'+qua+'[/COLOR]',url,67,art+'/hosts/'+host.lower()+".png",art+'/hosts/'+host.lower()+".png")
示例13: LINKLIST
def LINKLIST(mname, url):
link = main.OPENURL(url)
link = main.unescapes(link)
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]", "", "")
match = re.compile("""><img alt="([^<]+)" src="[^<]+" onClick="cargar.?'#player','(.+?)'""", re.DOTALL).findall(
link
)
for host, url in match:
host = host.replace(" Java", "").replace("ShockShare", "SockShare").replace(".to", "")
print host
if main.supportedHost(host):
mname = main.removeColoredText(mname)
main.addDown2(
mname + " [COLOR blue]" + host.upper() + "[/COLOR]",
"http://www.fxcine.com/player/" + url,
310,
art + "/hosts/" + host.lower() + ".png",
art + "/hosts/" + host.lower() + ".png",
)
示例14: ListDirectDownloadTVLinks
def ListDirectDownloadTVLinks(mname,url):
ok=True
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
match=re.compile('{"url":"([^"]+?)","hostname":"([^"]+?)"}').findall(url)
prev = ''
archived = ''
for url,host in match:
if (host == prev and not host in archived ):
archived += host
prev = host
h = 0
for url,host in match:
thumb=host.lower()
urlExceptions = re.compile('rar').findall(url)
if not (urlExceptions or host in archived) and main.supportedHost(host):
h += 1
main.addDown2(mname+' [COLOR blue]'+host.upper()+'[/COLOR]',url,210,art+"/hosts/"+thumb+".png",art+"/hosts/"+thumb+".png")
if not h:
xbmcplugin.endOfDirectory(int(sys.argv[1]), False, False)
xbmc.executebuiltin("XBMC.Notification(Sorry,No Playable Links Found,2000)")
示例15: LISTHOSTERS
def LISTHOSTERS(name,url):
html = GETHTML(url)
if html == None: return
if selfAddon.getSetting("hide-download-instructions") != "true":
main.addLink("[COLOR red]For Download Options, Bring up Context Menu Over Selected Link.[/COLOR]",'','')
r = re.findall(r'class="td_cols"><a target=\'_blank\'.+?href=\'(.+?)\'>',html, re.M|re.DOTALL)
try:
t = re.findall(r'rel="nofollow">((?!.*\.rar).*)</a>', html, re.I)
r = r+t
except: pass
if len(r) == 0:
addon.show_ok_dialog(['No Playable Streams Found,','It Might Be That They Are Still Being Uploaded,',
'Or They Are Unstreamable Archive Files'],'MashUP: TV-Release')
xbmcplugin.endOfDirectory(int(sys.argv[1]), False, False)
return
from urlparse import urlparse
for url in r:
url = url.replace("180upload.nl","180upload.com")
host = urlparse(url).hostname.replace('www.','').partition('.')[0]
if main.supportedHost(host):
main.addDown2(name.strip()+" [COLOR blue]"+host.upper()+"[/COLOR]",url,1005,art+'/hosts/'+host+'.png',art+'/hosts/'+host+'.png')