Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu():
- addDir("[B]"+'Filmes'+"[/B]",baseurl,3,art + 'fllmes2.png',art + 'cinema2.jpg','')
- addDirf("[B]"+'Series'+"[/B]",baseseries,100,art +'series-tv.jpg')
- addDir("[B]"+'Animes'+"[/B]",'-',2,art+'animes.png',art+'fanart_animes.jpg','')
- addDir("[B]"+'Desenhos'+"[/B]",basedes,100,art+'kids.png',art+'desenhos-animados.jpg','')
- addDir("[B]"+'Lançamentos'+"[/B]",baseurl,11,art+'filmes.png',art+'filmes3.png','')
- addDir("[B]"+'Pesquisar Filmes'+"[/B]",'-',9,art + 'pesquisa.png',art +'Filmes-1.jpg','')
- addDir("[B]"+'Pesquisar Séries, Animes ou Desenhos'+"[/B]",'-',20,art + 'pesquisa.png',art+'procserandes.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def todas_categorias(url):
- link = abrir_url(url)
- match=re.compile('<li class="topcat"><a href="(.*?)" class="topcat">(.*?)</a>').findall(link)
- for url,name in match:
- if 'Dublado' in name:
- addDir('[COLOR white]'"[B]"+"Filmes "+ name.encode('utf-8')+"s"+"[/B]"'[/COLOR]',url,10,art + 'fllmes2.png',art + 'cinema2.jpg','')
- if 'Legendado' in name and 'Animes' not in name:
- addDir('[COLOR white]'"[B]"+"Filmes "+ name.encode('utf-8')+"s"+"[/B]"'[/COLOR]',url,21,art + 'fllmes2.png',art + 'cinema2.jpg','')
- if 'Nacional' in name:
- addDir('[COLOR white]'"[B]"+"Filmes Nacionais"+"[/B]"'[/COLOR]',url,22,art + 'fllmes2.png',art + 'cinema2.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def catego_lanc(url):
- codigo_fonte = abrir_url(url)
- texto = re.findall('<li class="topcat selectedcat"><a href="http://www.redecanais.com/browse-filmes-videos-1-date.html"(.*?)</ul>',codigo_fonte,re.DOTALL)[0]
- match = re.compile('<li class=""><a href="(.*?)" class="">(.*?)</a> </li>').findall(texto)
- for url,name in match:
- if '2015' in name:
- addDir('[COLOR white]'"[B]"+clearname(name)+"[/B]"'[/COLOR]',url,4,art + 'fllmes2.png',art + 'cinema2.jpg','')
- if '2016' in name:
- addDir('[COLOR white]'"[B]"+clearname(name)+"[/B]"'[/COLOR]',url,4,art + 'fllmes2.png',art + 'cinema2.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def categ_lanc2(url):
- codigo_fonte = abrir_url(url)
- texto = re.findall('<li class="topcat"><a href="http://www.redecanais.com/browse-filmes-dublado-videos-1-date.html"(.*?)</ul>',codigo_fonte,re.DOTALL)[0]
- match = re.compile('<li class=""><a href="(.*?)" class="">(.*?)</a>').findall(texto)
- for url,name in match:
- if 'Legendado' not in url and 'Animes' not in url:
- addDir('[COLOR white]'"[B]"+clearname(name)+"[/B]"'[/COLOR]',url,4,art + 'fllmes2.png',art + 'cinema2.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def categ_dub(url):
- codigo_fonte = abrir_url(url)
- texto = re.findall('<li class="topcat"><a href="http://www.redecanais.com/browse-filmes-dublado-videos-1-date.html"(.*?)</ul>',codigo_fonte,re.DOTALL)[0]
- match = re.compile('<li class=""><a href="(.*?)" class="">(.*?)</a>').findall(texto)
- for url,name in match:
- addDir('[COLOR white]'"[B]"+clearname(name)+"[/B]"'[/COLOR]',url,4,art + 'fllmes2.png',art + 'cinema2.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def categ_leg(url):
- codigo_fonte = abrir_url(url)
- texto = re.findall('<li class="topcat"><a href="http://www.redecanais.com/browse-filmes-legendado-videos-1-date.html"(.*?)</ul>',codigo_fonte,re.DOTALL)[0]
- match = re.compile('<li class=""><a href="(.*?)" class="">(.*?)</a>').findall(texto)
- for url,name in match:
- addDir('[COLOR white]'"[B]"+clearname(name)+"[/B]"'[/COLOR]',url,4,art + 'fllmes2.png',art + 'cinema2.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def categ_nac(url):
- codigo_fonte = abrir_url(url)
- texto = re.findall('<li class="topcat"><a href="http://www.redecanais.com/browse-filmes-nacional-videos-1-date.html"(.*?)</ul>',codigo_fonte,re.DOTALL)[0]
- match = re.compile('<li class=""><a href="(.*?)" class="">(.*?)</a>').findall(texto)
- for url,name in match:
- addDir('[COLOR white]'"[B]"+clearname(name)+"[/B]"'[/COLOR]',url,4,art + 'fllmes2.png',art + 'cinema2.jpg','')
- xbmc.executebuiltin('Container.SetViewMode(51)')
- def cat_animes(url):
- addDir("[B]"+'Animes Dublados'+"[/B]",baseanindub,15,art+'animes.png',art+'fanart_animes.jpg','')
- addDir("[B]"+'Animes Legendados'+"[/B]",baseaninleg,15,art+'animes.png',art+'fanart_animes.jpg','')
- def listar_filmes(url):
- link = abrir_url(url)
- match=re.compile('<a href="(.*?)" class="pm-thumb-fix pm-thumb-145"><span class="pm-thumb-fix-clip"><img src="(.*?)" alt="(.*?)" ').findall(link)
- for url,iconimage,name in match:
- addDirf(clearname(name),url,103,iconimage,False)
- xbmc.executebuiltin('Container.SetViewMode(500)')
- try:
- match=re.compile('<a href="(.*?)">(.*?)</a>').findall(link)
- for url,prox in match:
- if "»" in prox:
- addDir('[COLOR maroon][B]Next Page>>> [/B][/COLOR]',url,4,art+'Next_256.png','','')
- except:
- pass
- ########################################series filipe#######################################
- def listarseries(url):
- html = abrir_url(url)
- itens = re.compile(r'<br />(.+?)</a>').findall(html)
- for item in itens:
- name = re.compile(r' (.+?)- <').findall(item)[0]
- if 'span' in name:
- name = re.compile(r'<br /> (.+?)- <').findall(item)[0]
- url = re.compile(r'href="(.+?)"').findall(item)[0]
- addDirf(clearname(name),'http://www.redecanais.com'+url,101,'-')
- def clearname(name):
- name = name.replace('â','â').replace('é','é').replace('Ú','Ú').replace('&','&').replace('ó','ó').replace('í','í').replace('ã','ã').replace('’','’').replace('á','á').replace('ç','ç').replace('ê','ê').replace('õ','õ').replace(' ','').replace('É','É')
- return name
- def listartemporadas(url):
- html = abrir_url(url)
- #img = re.compile(r'alt="(.+?)" /><br /> <strong>').findall(html)[0]
- if not re.compile(r'font-size: x-large;(.+?)Temporada').findall(html):
- return listarepisodios2('name',url,'img')
- itens = re.compile(r'font-size: x-large;(.+?Temporada)<').findall(html)
- for item in itens:
- name = re.compile(r'">(.+?Temporada)').findall(item)[0]
- if 'strong' in name:
- name = re.compile(r'strong>(.+?Temporada)').findall(item)[0]
- addDirf(name.replace('ª','ª'),url,102,'img')
- def listarepisodios(name,url,iconimage):
- idd = re.compile(r'(.+?)ª Temporada').findall(name)[0]
- html = abrir_url(url)
- try:
- busc = idd+'ª Temporada(.+?)<span'
- ht2 = re.compile(busc).findall(html)[0]
- except:
- busc = idd+'ª Temporada(.+?)</p>'
- ht2 = re.compile(busc).findall(html)[0]
- itens = re.compile(r'(Epi.+?</a>.+?</a>)').findall(ht2)
- for item in itens:
- name = re.compile(r'(Epi.+?-)').findall(item)[0].replace('Episódio','Episódio').replace('-','')
- epis = re.compile(r'<a (href=.+?)</a>').findall(item)
- for episodio in epis:
- if 'Dublado' in episodio:
- name = name+' - Dublado'
- url = re.compile(r'href="(.+?)"').findall(episodio)[0]
- #print name
- #print url
- addDirf(name,url,103,iconimage,False)
- if 'Legendado' in episodio:
- name = name+' - Legendado'
- url = re.compile(r'href="(.+?)"').findall(episodio)[0]
- #print name
- #print url
- addDirf(name.replace(' - Dublado',''),url,103,iconimage,False)
- if 'Assistir' in episodio:
- name = name
- url = re.compile(r'href="(.+?)"').findall(episodio)[0]
- #print name
- #print url
- addDirf(name,url,103,iconimage,False)
- def listarepisodios2(name,url,iconimage):
- html = abrir_url(url)
- itens = re.compile(r'<strong>(.+?)<br />').findall(html)
- for item in itens:
- try:
- name = re.compile(r'(Epis.+?)- </strong>').findall(item)[0].replace('Episódio','Episódio')
- except:
- name = re.compile(r'(Epis.+?) - - <a').findall(item)[0].replace('Episódio','Episódio')
- epis = re.compile(r'<a href=(.+?)</strong>').findall(item)
- print epis
- for episodio in epis:
- if 'Dublado' in episodio:
- name = name+' - Dublado'
- url = re.compile(r'"(.+?)"').findall(episodio)[0]
- addDirf(name,url,103,iconimage,False)
- if 'Legendado' in episodio:
- name = name+' - Legendado'
- url = re.compile(r'"(.+?)"').findall(episodio)[0].replace(' - Dublado','')
- addDirf(name,url,103,iconimage,False)
- if 'Assistir' in episodio:
- name = name
- url = re.compile(r'"(.+?)"').findall(episodio)[0]
- addDirf(name,url,103,iconimage,False)
- def resolverredecanais(url):
- if not 'http://' in url:
- url = 'http://www.redecanais.com'+url
- xbmc.log(url)
- link = abrir_url(url)
- match=re.compile('<iframe name="Player" ="" src="(.*?)"').findall(link)[0]
- req = urllib2.Request(match)
- req.add_header('User-Agent', 'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36')
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- url = re.compile(r'file: "(.+?)"').findall(link)[0]
- return url
- def player_rede_de_canais(name,url,iconimage):
- try:
- caixastatus = xbmcgui.DialogProgress()
- caixastatus.create(addon_name, 'Procurando e Resolvendo o Link..','Por Favor Aguarde...')
- pg=10
- caixastatus.update(pg)
- playlist = xbmc.PlayList(0)
- playlist.clear()
- link = resolverredecanais(url)
- listitem = xbmcgui.ListItem(name,thumbnailImage=iconimage)
- listitem.setInfo("Video", {"Title":name})
- listitem.setProperty('mimetype', 'video/mp4')
- playlist.add(link,listitem)
- pg=100
- caixastatus.update(pg)
- caixastatus.close()
- xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO)
- xbmcPlayer.play(playlist)
- sys.exit(0)
- except:
- pass
- ######################################################################################################################################################
- def listar_animes(url):
- link = abrir_url(url)
- match=re.compile('<a href="(.*?)" class="pm-thumb-fix pm-thumb-145"><span class="pm-thumb-fix-clip"><img src="(.*?)" alt="(.*?)" ').findall(link)
- for url,img,name in match:
- addDir(name,url,16,img,img,'')
- xbmc.executebuiltin('Container.SetViewMode(500)')
- try:
- match=re.compile('<a href="(.*?)">(.*?)</a>').findall(link)
- for url,prox in match:
- if "»" in prox:
- addDir('[COLOR maroon][B]Next Page>>> [/B][/COLOR]',url,15,art+'Next_256.png','','')
- except:
- pass
- def listar_episodios_animes(url,iconimage):
- link = abrir_url(url)
- fanart=re.compile('<p itemprop="description"><p><img src="(.*?)" alt=').findall(link)
- for img in fanart:
- fig=img
- if 'hackgu-returner' in url:
- match=re.compile('<strong>(.*?)-.*?<a href="(.*?)" target=.*?><strong>Assistir</strong>').findall(link)
- elif 'dog-days-legendado' in url:
- match=re.compile('<strong>(.*?)- <strong><a href="(.*?)" target="_blank">Assistir</a>').findall(link)
- elif 'avatar-a-lenda-de-korra' in url:
- match=re.compile('<strong>(.*?) - <strong><a href="(.*?)" rel="nofollow" target="_blank">Assistir</a></strong><br />').findall(link)
- elif 'itsuka-tenma-no-kuro-usagi' in url:
- match=re.compile('<strong><a href="(.*?)".*?<strong>(.*?)</strong>').findall(link)
- for url,name in match:
- addDirf(clearname(name),url,103,img,False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- else:
- match=re.compile('<strong>(.*?)- <a href="(.*?)".*? target=.*?><strong>Assistir</strong></a><br />').findall(link)
- for name,url in match:
- if 'avatar-a-lenda-de-korra' not in url:
- url=base1+url
- name=name.replace('Episódio','Episodio').replace('</strong>','').replace('ã','ã').replace('é','é').replace('ç','ç').replace('á','á').replace('É','É').replace('ô','ô').replace('ó','ó').replace('â','â').replace('í','í').replace('Ú','Ú').replace('ú','ú').replace('</span><br /> <strong>',' ').replace('ê','ê')
- if '<span style="font' not in name and 'avatar-a-lenda-de-korra' not in url:
- addDirf(clearname(name),url,103,img,False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- else:
- addDirf(clearname(name),url,103,img,False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- try:
- match=re.compile('<a href="(.*?)">(.*?)</a>').findall(link)
- for url,prox in match:
- if "»" in prox:
- addDir('[COLOR maroon][B]Next Page>>> [/B][/COLOR]',url,16,art+'Next_256.png','','')
- except:
- pass
- def listar_desenhos(url):
- html = gethtml(url)
- soup = html.find("ul",{"class":"cat_desenhos"})
- categorias = soup.findAll("li")
- for categoria in categorias:
- titulo = categoria.a.text
- url = categoria.a["href"]
- if 'Pantera' in titulo:
- addDir("[B]"+titulo.encode('utf-8')+"[/B]",url,19,art+'kids.png',art+'vintage2.png','')
- elif 'Hora da Aventura - Dublado' in titulo:
- addDir("[B]"+titulo.encode('utf-8')+"[/B]",url,19,art+'kids.png',art+'vintage2.png','')
- elif 'Avengers Assemble' in titulo:
- addDir("[B]"+titulo.encode('utf-8')+"[/B]",url,19,art+'kids.png',art+'vintage2.png','')
- elif 'Family Guy' in titulo:
- addDir("[B]"+titulo.encode('utf-8')+"[/B]",url,19,art+'kids.png',art+'vintage2.png','')
- elif 'Liga da Justi' in titulo:
- addDir("[B]"+titulo.encode('utf-8')+"[/B]",url,19,art+'kids.png',art+'vintage2.png','')
- else:
- addDir("[B]"+titulo.encode('utf-8')+"[/B]",url,18,art+'kids.png',art+'vintage2.png','')
- xbmcplugin.setContent(int(sys.argv[1]), 'movies')
- xbmc.executebuiltin('Container.SetViewMode(502)')
- def listar_desenhos2(url):
- link = abrir_url(url)
- match=re.compile('<a href="(.*?)" class="pm-thumb-fix pm-thumb-145"><span class="pm-thumb-fix-clip"><img src="(.*?)" alt="(.*?)" ').findall(link)
- for url,img,name in match:
- if 'A Pequena Sereia (Dublado)' in name:
- addDirf(name,url,103,art+'A Pequena Sereia Filme1.jpg',False)
- else:
- addDirf(name,url,103,img,False)
- xbmc.executebuiltin('Container.SetViewMode(502)')
- try:
- match=re.compile('<a href="(.*?)">(.*?)</a>').findall(link)
- for url,prox in match:
- if "»" in prox:
- addDir('[COLOR maroon][B]Next Page>>> [/B][/COLOR]',url,18,art+'Next_256.png','','')
- except:
- pass
- def listar_desenhos3(url):
- link = abrir_url(url)
- fanart=re.compile('<p><img src="(.*?)" alt=.*?/><br />').findall(link)
- for img in fanart:
- fig=img
- fanart2=re.compile('<p><img class="decoded" src="(.*?)" alt=').findall(link)
- for img2 in fanart2:
- fig2=img2
- if 'pantera-cor-de-rosa' in url:
- match=re.compile('<strong>(.*?)- <strong><a href="(.*?)" target="_blank">Assistir</a></strong><br />').findall(link)
- elif 'hora-de-aventura' in url:
- match=re.compile('<strong>(.*?) - <a href="(.*?)" target="_blank">Assistir</a></strong><br />').findall(link)
- else:
- match=re.compile('<strong>(.*?)- <a href="(.*?)".*? target=.*?><strong>Assistir</strong></a><br />').findall(link)
- for name,url in match:
- if 'http://' not in url:
- url=base1+url
- name=name.replace('Episódio','Episodio').replace('</strong>','').replace('ã','ã').replace('é','é').replace('ç','ç').replace('á','á').replace('É','É').replace('ô','ô').replace('ó','ó').replace('â','â').replace('í','í').replace('Ú','Ú').replace('ú','ú').replace('</span><br /> <strong>',' ').replace('“P”','"P"').replace('ê','ê').replace('<strong>','').replace('ª',' - ').replace('çõ','çõ').replace('<span style="font-size: x-large;">','').replace('</span>','').replace('<br />',' ')
- if '<span style="font' not in name and 'hora-de-aventura' not in url and 'musicvideo' not in url and 'liga-da-justica' not in url:
- if 'http://' not in url:
- url=base1+url
- addDirf(name,url,103,img,False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- elif 'hora-de-aventura' in url:
- addDirf(name,url,103,fig2,False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- elif 'musicvideo' in url and 'liga-da-justica' in url:
- addDirf(name,url,103,'',False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- else:
- addDirf(name,url,103,fig2,False)
- xbmc.executebuiltin('Container.SetViewMode(51)')
- try:
- match=re.compile('<a href="(.*?)">(.*?)</a>').findall(link)
- for url,prox in match:
- if "»" in prox:
- addDir('[COLOR maroon][B]Next Page>>> [/B][/COLOR]',url,16,art+'Next_256.png','','')
- except:
- pass
- def pegar_link(url):
- link = abrir_url(url)
- match=re.compile('<iframe name="Player" ="" src="(.*?)"').findall(link)
- for url in match:
- url=url.replace('serverf2','serverfdowns2')
- # addDir(url,url,1,'','','')file: "(.*?)",
- link = abrir_url(url)
- match1=re.compile('<a href="(.*?)" >').findall(link)
- for url1 in match1:
- if 'mp4' in url1:
- url1=url1.replace('?download','')
- print url1
- url = urlresolver.resolve(url1)
- url = urlresolver.resolve(url1)
- pg = 0
- caixastatus = xbmcgui.DialogProgress()
- caixastatus.create(addon_name, 'Procurando e Resolvendo o Link..','Por Favor Aguarde...')
- caixastatus.update(pg)
- playvideo(url)
- def pesquisa_series():
- keyb = xbmc.Keyboard('', 'Digite a Série, Anime ou Desenho Desejado...')
- keyb.doModal()
- if (keyb.isConfirmed()):
- search = keyb.getText()
- parametro_pesquisa=urllib.quote(search)
- url = 'http://www.redecanais.com/search.php?keywords='+parametro_pesquisa+'/'
- listar_series2(url)
- return
- def pesquisa():
- keyb = xbmc.Keyboard('', 'Digite o Filme Desejado...')
- keyb.doModal()
- if (keyb.isConfirmed()):
- search = keyb.getText()
- parametro_pesquisa=urllib.quote(search)
- url = 'http://www.redecanais.com/search.php?keywords='+parametro_pesquisa+'/'
- listar_filmes(url)
- return
- ##############################################################################################################
- ## FUNÇÕES ##
- ##############################################################################################################
- ##############################################################################################################
- def playvideo(url):
- pl=xbmc.PlayList(1)
- pl.clear()
- listitem = xbmcgui.ListItem(path=url, thumbnailImage=iconimage)
- xbmc.PlayList(1).add(url, listitem)
- xbmc.Player().play(pl)
- sys.exit(0)
- def RESOLVE(url):
- print url
- arquivo = url
- url1 = urlresolver.resolve(url)
- if url1:
- try:
- liz = xbmcgui.ListItem(path=url, thumbnailImage=iconimage)
- liz.setInfo(type="Video", infoLabels={ "Title": name })
- liz.setProperty("IsPlayable","true")
- liz.setPath(url1)
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
- except: pass
- else:
- liz = xbmcgui.ListItem(path=url, thumbnailImage=iconimage)
- liz.setInfo(type="Video", infoLabels={ "Title": name })
- liz.setProperty("IsPlayable","true")
- liz.setPath(url)
- xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
- def get_params():
- param=[]
- paramstring=sys.argv[2]
- if len(paramstring)>=2:
- params=sys.argv[2]
- cleanedparams=params.replace('?','')
- if (params[len(params)-1]=='/'):
- params=params[0:len(params)-2]
- pairsofparams=cleanedparams.split('&')
- param={}
- for i in range(len(pairsofparams)):
- splitparams={}
- splitparams=pairsofparams[i].split('=')
- if (len(splitparams))==2:
- param[splitparams[0]]=splitparams[1]
- return param
- def addDir(name,url,mode,iconimage,fanart,description):
- u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)+"&description="+urllib.quote_plus(description)
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
- liz.setInfo( type="Video", infoLabels={ "Title": name,"Plot":description} )
- liz.setProperty('fanart_image', fanart)
- if mode==1 or mode==8:
- liz.setProperty("IsPlayable","true")
- ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False)
- else:
- ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
- return ok
- def addDirf(name,url,mode,iconimage,pasta=True,total=1,plot=''):
- u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)
- ok=True
- liz=xbmcgui.ListItem(name, iconImage="iconimage", thumbnailImage=iconimage)
- liz.setProperty('fanart_image', iconimage)
- liz.setInfo( type="video", infoLabels={ "title": name, "plot": plot } )
- ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=pasta,totalItems=total)
- return ok
- def gethtml(url):
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- response = urllib2.urlopen(req)
- link = response.read()
- soup = BeautifulSoup(link)
- return soup
- def abrir_url(url):
- req = urllib2.Request(url)
- req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
- response = urllib2.urlopen(req)
- link=response.read()
- response.close()
- return link
- params=get_params()
- url=None
- name=None
- mode=None
- iconimage=None
- description=None
- site=None
- try:
- url=urllib.unquote_plus(params["url"])
- except:
- pass
- try:
- name=urllib.unquote_plus(params["name"])
- except:
- pass
- try:
- iconimage=urllib.unquote_plus(params["iconimage"])
- except:
- pass
- try:
- mode=int(params["mode"])
- except:
- pass
- try:
- description=urllib.unquote_plus(params["description"])
- except:
- pass
- if mode==None or url==None or len(url)<1:
- print ""
- menu()
- elif mode==1:RESOLVE(url)
- elif mode==2:cat_animes(url)
- elif mode==3:todas_categorias(url)
- elif mode==4:listar_filmes(url)
- elif mode==5:listar_links(url)
- elif mode==7:pegar_link(url)
- elif mode==8:playvideo(url)
- elif mode==9:pesquisa()
- elif mode==10:categ_dub(url)
- elif mode==11:catego_lanc(url)
- elif mode==15:listar_animes(url)
- elif mode==16:listar_episodios_animes(url,iconimage)
- elif mode==17:listar_desenhos(url)
- elif mode==18:listar_desenhos2(url)
- elif mode==19:listar_desenhos3(url)
- elif mode==20:pesquisa_series()
- elif mode==21:categ_leg(url)
- elif mode==22:categ_nac(url)
- elif mode==23:categ_lanc2(url)
- elif mode ==100:
- listarseries(url)
- elif mode==101:
- listartemporadas(url)
- elif mode==102:
- listarepisodios(name,url,iconimage)
- elif mode==103:
- player_rede_de_canais(name,url,iconimage)
- xbmcplugin.endOfDirectory(int(sys.argv[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement