def loadvideo(params,data,category,title,thumbnail,plot): # ---------------------------------------------------------- # the loading of series with a lot of seasons is very slow # this system prevents freeze everytime in loading screen # ---------------------------------------------------------- max_len = 3000 while (len(data) > max_len): data_all = data data_trunc = data[:max_len].rfind('<a ') if(data_trunc <= 0): data = data = data_all[max_len:] else: data = data[:data_trunc] listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] patronvideos = url+'[^>]+>([^<]+)' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) if (matches): videotitle = matches[0] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle + " ["+server+"]" , url , thumbnail , plot ) data = data_all[data_trunc:] #end while listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] patronvideos = url+'[^>]+>([^<]+)' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) if (matches): videotitle = matches[0] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle + " ["+server+"]" , url , thumbnail , plot )
def findvideos(item): logger.info("[tumejortv.py] findvideos") # Descarga la página url = item.url data = scrapertools.cachePage(url) #logger.info(data) patron = '<div id="blogitem">[^<]+<p>([^<]+)</p>' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: plot = matches[0] listavideos = servertools.findvideos(data) itemlist = [] for video in listavideos: scrapedtitle = item.title + " (" + video[2] + ")" scrapedurl = video[1] scrapedthumbnail = item.thumbnail scrapedplot = item.plot server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, server=server, folder=False)) return itemlist
def detail(params,url,category): logger.info("[sevillista.py] detail") # Recupera los parámetros title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página de detalle, y busca el iframe data = scrapertools.cachePage(url) patron = '<iframe marginwidth="0" marginheight="0" src="([^"]+)"' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: # Descarga el iframe url = matches[0] data = scrapertools.cachePage(url) # Busca vídeos no megavideo (playlist externa) patron = '<param name="flashvars" value=".amp.skin=.amp.plugins.captions.amp.file.([^\&]+)\&' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: # Descarga la playlist url = matches[0] if url.endswith(".xml"): data2 = scrapertools.cachePage(url) # Busca los vídeos #<title>Parte 1</title> #<annotation>Castellano</annotation> #<location>http://video.ak.facebook.com/cfs-ak-ash1/27673/000/219/106288556079917_23239.mp4</location> patron = '<title>([^<]+)</title>[^>]*' patron += '<annotation>([^<]+)</annotation>[^>]*' patron += '<location>([^<]+)</location>' matches = re.compile(patron,re.DOTALL).findall(data2) for match in matches: scrapedtitle = title + " " + match[0]+" "+match[1]+" [Directo]" scrapedurl = urlparse.urljoin(url,match[2]) scrapedthumbnail = thumbnail scrapedplot = plot if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot ) else: xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title + " [Directo]" , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos conocidos en el iframe # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category): logger.info("[newcineonline.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # La siguiente página patronvideos = '<embed src\="http\:\/\/wwwstatic.megavideo.com\/mv\_player\.swf\?image=[^\&]+\&\;v\=([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)>0: xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Megavideo" , title + " - [Megavideo]" , matches[0], thumbnail , "" ) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def detalle(params, url, category): logger.info("[filmstreaming.py] detalle") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) # Descarga la página data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle + " [" + server + "]", url, thumbnail, plot) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def listvideosTVmirror(params,url,category): logger.info("[dospuntocerovision.py] listvideosTVmirror") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) # Descarga la p�gina data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: #logger.info("") if video[2] == "tu.tv": url = urllib.unquote_plus(servertools.findurl(video[1],video[2])) xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Directo" , title +" - "+video[0], url, thumbnail , "" ) else: xbmctools.addnewvideo( CHANNELNAME , "detail" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def mirrors(item): logger.info("[capitancinema.py] mirrors") title = item.title thumbnail = item.thumbnail plot = item.plot # Descarga la página data = scrapertools.cachePage(item.url) patronvideos = '<li><strong>DISPONIBLE EN EL FORO</strong>[^<]+<a href="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) itemlist = [] if len(matches)>0: url = matches[0] data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: scrapedtitle = title.strip() + " - " + video[0] scrapedurl = video[1] server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle , url=scrapedurl, thumbnail=item.thumbnail, plot=item.plot, server=server, folder=False)) return itemlist
def detail(params, url, category): logger.info("[edumanmovies.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) #<iframe name="frame" marginwidth="0" marginheight="0" src="/p.php?f=43&n=negrologoxd" scrolling="no" frameborder="0" # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo(CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def detail(params,url,category): logger.info("[divxonline.py] detail") title='' thumbnail='' plot='' try: title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) except: pass # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ data=decryptinks(data); listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category): logger.info("[descargapelis.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = "" # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patron = '<table width="100%" cellpadding="0" cellspacing="0">[^<]+?' patron +='<tr>[^<]+?<td align="center"><img src="(.+?)".+?' patron +='<td align="justify" valign="top" class="texto_peli"><b>Sinopsis de (.+?):</b>(.+?)<br />' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: if DEBUG: scrapertools.printMatches(matches) #xbmc.output('test') listavideos = servertools.findvideos(data) thumbnail=matches[0][0] plot=matches[0][2] title=matches[0][1] for video in listavideos: xbmctools.addnewvideo( CHANNELNAME , "play" , CHANNELNAME , video[2] , title + " (" + video[2] + ")" , video[1] , thumbnail, plot ) # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def detail(params, url, category): logger.info("[documentalesatonline.py] detail") title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8") thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") # Descarga la página data = scrapertools.cachePage(url) # logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addvideo(CHANNELNAME, "Megavideo - " + video[0], video[1], category, video[2]) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def mirrors(params,url,category): logger.info("[capitancinema.py] mirrors") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página data = scrapertools.cachePage(url) patronvideos = '<li><strong>DISPONIBLE EN EL FORO</strong>[^<]+<a href="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) if len(matches)>0: url = matches[0] data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params, url, category): logger.info("[dibujosanimadosgratis.py] detail") # Recupera los parámetros title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) # Descarga la página de detalle ''' <div class="post"> <h2 class="postTitle"><a href="http://dibujosanimadosgratis.net/ranma/ranma-%c2%bd-episodio-142-33-audio-latino-dvdrip-hq.html">Ranma ½ Episodio 142 3/3 Audio Latino DVDRip HQ</a></h2> <div class="postMeta"> <span class="date">May.08, 2010</span> en <span class="filed"><a href="http://dibujosanimadosgratis.net/category/ranma" title="Ver todas las entradas en Ranma" rel="category tag">Ranma</a></span> </div> <div class="postContent"><p> <img src="http://i4.ytimg.com/vi/3k4YsDCdfoA/default.jpg" align="right" border="0" width="120" height="90" vspace="4" hspace="4" /> </p> <p> Author: <a href="http://youtube.com/profile?user=AlucardReturn08">AlucardReturn08</a><br/> Keywords: <br/> Added: May 8, 2010<br/> </p> <p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/3k4YsDCdfoA"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/3k4YsDCdfoA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p> </div> ''' data = scrapertools.cachePage(url) patron = '<div class="post">(.*?<div class="postMeta">.*?<div class="postContent">.*?)</div>' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: data = matches[0] logger.info(data) # Plot scrapedplot = scrapertools.htmlclean(data) scrapedplot = scrapedplot.replace("\n", " ") scrapedplot = scrapedplot.replace("\r", " ") # Thumbnail patron = '<img src="([^"]+)"' matches = re.compile(patron, re.DOTALL).findall(data) scrapedthumbnail = "" if len(matches) > 0: scrapedthumbnail = matches[0] # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos conocidos en el iframe # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo(CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, scrapedthumbnail, scrapedplot) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def detail(params,url,category): xbmc.output("[tumejortv.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = "" # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) patron = '<div id="blogitem">[^<]+<p>([^<]+)</p>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: plot = matches[0] listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addnewvideo( CHANNELNAME , "play" , CHANNELNAME , video[2] , title + " (" + video[2] + ")" , video[1] , thumbnail, plot ) # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def findvideos(item): logger.info("[tumejortv.py] findvideos") # Descarga la página url = item.url data = scrapertools.cachePage(url) #logger.info(data) patron = '<div id="blogitem">[^<]+<p>([^<]+)</p>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: plot = matches[0] listavideos = servertools.findvideos(data) itemlist = [] for video in listavideos: scrapedtitle = item.title + " (" + video[2] + ")" scrapedurl = video[1] scrapedthumbnail = item.thumbnail scrapedplot = item.plot server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle , url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, server=server, folder=False)) return itemlist
def detail(params,url,category): xbmc.output("[cineblog01.py] detail") title = params.get("title") thumbnail = params.get("thumbnail") xbmc.output("[cineblog01.py] title="+title) xbmc.output("[cineblog01.py] thumbnail="+thumbnail) # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addvideo( CHANNELNAME , "Megavideo - "+video[0] , video[1] , category , video[2] ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category): logger.info("[edumanmovies.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) #<iframe name="frame" marginwidth="0" marginheight="0" src="/p.php?f=43&n=negrologoxd" scrolling="no" frameborder="0" # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category): xbmc.output("[newcineonline.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # La siguiente página patronvideos = '<embed src\="http\:\/\/wwwstatic.megavideo.com\/mv\_player\.swf\?image=[^\&]+\&\;v\=([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)>0: xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Megavideo" , title + " - [Megavideo]" , matches[0], thumbnail , "" ) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title +" - "+video[0], video[1], thumbnail , "" ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def listvideos(params,url,category): logger.info("[letmewatchthis.py] listvideos") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) url = url.replace(" ","%20") logger.info("url="+url) # ------------------------------------------------------------------------------------ # Descarga la página # ------------------------------------------------------------------------------------ data = scrapertools.cachePage(url) #logger.info(data) listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] scrapedurl = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip()+" "+videotitle , scrapedurl , thumbnail , plot ) # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def detail(params, url, category): logger.info("[terrorygore.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addnewvideo(CHANNELNAME, "play", category, video[2], title + " - " + video[0], video[1], thumbnail, "") # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def detail(params, url, category): logger.info("[descargapelis.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = "" # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patron = '<table width="100%" cellpadding="0" cellspacing="0">[^<]+?' patron += '<tr>[^<]+?<td align="center"><img src="(.+?)".+?' patron += '<td align="justify" valign="top" class="texto_peli"><b>Sinopsis de (.+?):</b>(.+?)<br />' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: if DEBUG: scrapertools.printMatches(matches) #xbmc.output('test') listavideos = servertools.findvideos(data) thumbnail = matches[0][0] plot = matches[0][2] title = matches[0][1] for video in listavideos: xbmctools.addnewvideo(CHANNELNAME, "play", CHANNELNAME, video[2], title + " (" + video[2] + ")", video[1], thumbnail, plot) # Label (top-right)... xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category) xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def play(params,url,category): logger.info("[delatv.py] play") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) server = "" # Abre dialogo dialogWait = xbmcgui.DialogProgress() dialogWait.create( 'Accediendo al video...', title , plot ) # Busca los enlaces a los videos data = scrapertools.cachePage(url) listavideos = servertools.findvideos(data) # Cierra dialogo dialogWait.close() del dialogWait if len(listavideos)>0: url = listavideos[0][1] server = listavideos[0][2] logger.info("url="+url) xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot) else: xbmctools.alertnodisponible()
def detail(params,url,category): logger.info("[descargacineclasico.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) logger.info("[descargacineclasico.py] title="+title) logger.info("[descargacineclasico.py] thumbnail="+thumbnail) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addvideo( CHANNELNAME , title+" - "+video[0] , video[1] , category , video[2] ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def ddpostdetail(params,url,category): logger.info("[mcanime.py] ddpostdetail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) # Descarga la p·gina data = scrapertools.cachePage(url) #logger.info(data) # Foto de la serie de la enciclopedia patron = '<img src="([^"]+)" width="300".*?class="title_pic" />' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: thumbnail = matches[0] # Argumento - texto del post patron = '<div id="download_detail">(.*?)</div>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: plot = scrapertools.htmlclean(matches[0]) plot = plot.replace("\r\n"," ") plot = plot.replace("\r"," ") plot = plot.replace("\n"," ") plot = plot.strip() # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) i = 1 for video in listavideos: try: fulltitle = unicode( title.strip() + " (%d) " + video[0], "utf-8" ).encode("iso-8859-1") except: fulltitle = title.strip() + " (%d) " + video[0] fulltitle = fulltitle % i i = i + 1 videourl = video[1] server = video[2] #logger.info("videotitle="+urllib.quote_plus( videotitle )) #logger.info("plot="+urllib.quote_plus( plot )) #plot = "" #logger.info("title="+urllib.quote_plus( title )) xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , fulltitle , videourl , thumbnail , plot ) # ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------ # AÒade la opciÛn "AÒadir todos los vÌdeos a la lista de descarga" # ------------------------------------------------------------------------------------ xbmctools.addnewvideo( CHANNELNAME , "addalltodownloadlist" , title , "" , "(AÒadir todos los vÌdeos a la lista de descarga)" , url , thumbnail , plot ) # Cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def homedetail(params, url, category): logger.info("[mcanime.py] homedetail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) extradata = urllib.unquote_plus(params.get("extradata")) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(extradata) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo(CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category) xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def detail(params,url,category): xbmc.output("[vertelenovelasonline.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Asigna el título, desactiva la ordenación, y cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def mirrorlist(params,url,category): xbmc.output("[seriespepito.py] mirrorlist") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def homedetail(params, url, category): logger.info("[mcanime.py] homedetail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) extradata = urllib.unquote_plus(params.get("extradata")) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(extradata) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot ) # ------------------------------------------------------------------------------------ # Cierra el directorio xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category) xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def detail(params,url,category): logger.info("[veranime.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patron = '<div id="listacapdd"><div class="listddserie">[^<]+' patron += '<a title="[^"]+" href="([^"]+)"><strong>[^<]+</strong></a>[^<]+' patron += '</div>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: url = matches[0] data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Asigna el título, desactiva la ordenación, y cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category): xbmc.output("[pintadibujos.py] detail") if xbmctools.getPluginSetting("forceview")=="true": xbmc.executebuiltin("Container.SetViewMode(50)") #full list title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addnewvideo( CHANNELNAME , "play" , category , video[2] , title + " - " + video[0] , video[1] , thumbnail , "" ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def addalltodownloadlist(params,url,category): logger.info("[mcanime.py] addalltodownloadlist") title = urllib.unquote_plus( params.get("category") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) # Pide el tÌtulo de la serie como "prefijo" keyboard = xbmc.Keyboard(downloadtools.limpia_nombre_excepto_1(title)) keyboard.doModal() if (keyboard.isConfirmed()): title = keyboard.getText() else: return # Descarga la p·gina data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) # Di·logo de progreso pDialog = xbmcgui.DialogProgress() ret = pDialog.create('pelisalacarta', 'AÒadiendo vÌdeos a la lista de descargas') pDialog.update(0, 'VÌdeo...') totalepisodes = len(listavideos) i = 1 for video in listavideos: try: fulltitle = unicode( title.strip() + " (%d) " + video[0], "utf-8" ).encode("iso-8859-1") except: fulltitle = title.strip() + " (%d) " + video[0] fulltitle = fulltitle % i i = i + 1 url = video[1] server = video[2] # AÒade el enlace a la lista de descargas descargadoslist.savebookmark(fulltitle,url,thumbnail,server,plot) pDialog.update(i*100/totalepisodes, 'VÌdeo...',fulltitle) if (pDialog.iscanceled()): pDialog.close() return # ------------------------------------------------------------------------------------ pDialog.close() advertencia = xbmcgui.Dialog() resultado = advertencia.ok('VÌdeos en lista de descargas' , 'Se han aÒadido todos los vÌdeos' , 'a la lista de descargas') # Cierra el directorio xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def findvideos(item): logger.info("[cuevana.py] findvideos") code = "" if (item.url.startswith("http://www.cuevana.tv/list_search_info.php")): data = scrapertools.cachePage(item.url) logger.info("data=" + data) patron = "window.location\='/series/([0-9]+)/" matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: code = matches[0] logger.info("code=" + code) url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&tipo=s&sub_pre=ES" % matches[ 0] else: # http://www.cuevana.tv/peliculas/2553/la-cienaga/ logger.info("url1=" + item.url) patron = "http://www.cuevana.tv/peliculas/([0-9]+)/" matches = re.compile(patron, re.DOTALL).findall(item.url) if len(matches) > 0: code = matches[0] logger.info("code=" + code) url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&sub_pre=ES#" % matches[ 0] logger.info("url2=" + url) data = scrapertools.cachePage(url) logger.info("data=" + data) # goSource('ee5533f50eab1ef355661eef3b9b90ec','megaupload') patron = "goSource\('([^']+)','megaupload'\)" matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: data = scrapertools.cachePagePost( "http://www.cuevana.tv/player/source_get", "key=%s&host=megaupload&vars=&id=2933&subs=,ES&tipo=&sub_pre=ES" % matches[0]) logger.info("data=" + data) listavideos = servertools.findvideos(data) itemlist = [] for video in listavideos: server = video[2] scrapedtitle = item.title + " [" + server + "]" scrapedurl = video[1] itemlist.append( Item(channel=CHANNELNAME, action="play", title=scrapedtitle, url=scrapedurl, thumbnail=item.thumbnail, plot=item.plot, server=server, folder=False)) return itemlist
def detail(params,url,category): logger.info("[dibujosanimadosgratis.py] detail") # Recupera los parámetros title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página de detalle ''' <div class="post"> <h2 class="postTitle"><a href="http://dibujosanimadosgratis.net/ranma/ranma-%c2%bd-episodio-142-33-audio-latino-dvdrip-hq.html">Ranma ½ Episodio 142 3/3 Audio Latino DVDRip HQ</a></h2> <div class="postMeta"> <span class="date">May.08, 2010</span> en <span class="filed"><a href="http://dibujosanimadosgratis.net/category/ranma" title="Ver todas las entradas en Ranma" rel="category tag">Ranma</a></span> </div> <div class="postContent"><p> <img src="http://i4.ytimg.com/vi/3k4YsDCdfoA/default.jpg" align="right" border="0" width="120" height="90" vspace="4" hspace="4" /> </p> <p> Author: <a href="http://youtube.com/profile?user=AlucardReturn08">AlucardReturn08</a><br/> Keywords: <br/> Added: May 8, 2010<br/> </p> <p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/3k4YsDCdfoA"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/3k4YsDCdfoA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p> </div> ''' data = scrapertools.cachePage(url) patron = '<div class="post">(.*?<div class="postMeta">.*?<div class="postContent">.*?)</div>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: data = matches[0] logger.info(data) # Plot scrapedplot = scrapertools.htmlclean(data) scrapedplot = scrapedplot.replace("\n"," ") scrapedplot = scrapedplot.replace("\r"," ") # Thumbnail patron = '<img src="([^"]+)"' matches = re.compile(patron,re.DOTALL).findall(data) scrapedthumbnail = "" if len(matches)>0: scrapedthumbnail = matches[0] # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos conocidos en el iframe # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , scrapedthumbnail , scrapedplot ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(params,url,category): xbmc.output("[divxonline.py] detail") title = params.get("title") thumbnail = params.get("thumbnail") xbmc.output("[divxonline.py] title="+title) xbmc.output("[divxonline.py] thumbnail="+thumbnail) data0 = scrapertools.cachePage(url) # descarga pagina de reproduccion # tipo 1: hay un iframe con una página con los videos # obtiene la url del frame con los videos match = re.search('<iframe src="(.*?)"',data0,re.DOTALL | re.IGNORECASE) if match: xbmc.output("URLVideo: " + match.group(1)) # los cambios suelen afectar por aquí # Descarga el frame con los videos data = scrapertools.cachePage(urlparse.urljoin(url,match.group(1))) #xbmc.output(data) listavideos = servertools.findvideos(data) else: # tipo 2: los vídeos están en la página (no sé si sigue siendo vigente) listavideos = servertools.findvideos(data0) # ------------------------------------------------------------------------------------ # Añade los enlaces a los videos # ------------------------------------------------------------------------------------ for video in listavideos: xbmctools.addvideo( CHANNELNAME , "Megavideo - "+video[0] , video[1] , category , video[2] ) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def detail(item): logger.info("[cine15.py] detail") title = item.title thumbnail = item.thumbnail plot = item.plot # Descarga la página data = scrapertools.cachePage(item.url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a videos no megavideo (playlist xml) # ------------------------------------------------------------------------------------ patronvideos = 'flashvars[^f]+file=([^\&]+)\&' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] if len(matches)>0: if ("xml" in matches[0]): data2 = scrapertools.cachePage(matches[0]) logger.info("data2="+data2) patronvideos = '<track>[^<]+' patronvideos += '<title>([^<]+)</title>[^<]+' patronvideos += '<location>([^<]+)</location>[^<]+' patronvideos += '</track>' matches = re.compile(patronvideos,re.DOTALL).findall(data2) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[0] scrapedurl = match[1].strip() scrapedthumbnail = thumbnail scrapedplot = plot if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle + " [Directo]" , url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, server="Directo", folder=False)) else: itemlist.append( Item(channel=CHANNELNAME, action="play" , title=title + " [Directo]" , url=matches[0], thumbnail=thumbnail, plot=plot, server="Directo", folder=False)) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play" , title=title.strip() + " - " + videotitle , url=url, thumbnail=thumbnail, plot=plot, server=server, folder=False)) # ------------------------------------------------------------------------------------ return itemlist
def detallecapitulo(params, url, category): logger.info("[watchanimeon.py] detallecapitulo") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo(CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot) # ------------------------------------------------------------------------------------ # Extrae el enlace a la serie completa patron = '<a href="([^"]+)" title="View all posts in' matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = "Ver serie completa" scrapedurl = urlparse.urljoin(url, match) scrapedthumbnail = thumbnail scrapedplot = plot if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "detalleserie", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def play(params,url,category): logger.info("[frozenlayer.py] play") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) server = params["server"] # En tu.tv, la URL es la del detalle en el servidor if server=="tu.tv": data = scrapertools.cachePage(url) listavideos = servertools.findvideos(data) if len(listavideos)>0: url = listavideos[0][1] xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def detail(params, url, category): logger.info("[mocosoftx.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") if "CDATA" in url: data = url patronthumb = '<img src="([^"]+)"' matches = re.compile(patronthumb, re.DOTALL).findall(data) scrapertools.printMatches(matches) else: #Descarga la página sid = GetSessionID() data = scrapertools.cachePage(url + sid) patronthumb = '<img src="([^"]+)" alt="" border="0" />[</a>|<br />]+' matches = re.compile(patronthumb, re.DOTALL).findall(data) scrapertools.printMatches(matches) #logger.info(data) #addnewvideo( canal , accion , category , server , title , url , thumbnail, plot ): # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) c = 0 for video in listavideos: c = c + 1 try: imagen = matches[c] except: imagen = thumbnail xbmctools.addnewvideo(CHANNELNAME, "play", category, video[2], title + " - [" + video[2] + "]", video[1], imagen, plot) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def findvideos(item): logger.info("[cuevana.py] findvideos") code ="" if (item.url.startswith("http://www.cuevana.tv/list_search_info.php")): data = scrapertools.cachePage(item.url) logger.info("data="+data) patron = "window.location\='/series/([0-9]+)/" matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: code = matches[0] logger.info("code="+code) url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&tipo=s&sub_pre=ES" % matches[0] else: # http://www.cuevana.tv/peliculas/2553/la-cienaga/ logger.info("url1="+item.url) patron = "http://www.cuevana.tv/peliculas/([0-9]+)/" matches = re.compile(patron,re.DOTALL).findall(item.url) if len(matches)>0: code = matches[0] logger.info("code="+code) url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&sub_pre=ES#" % matches[0] logger.info("url2="+url) data = scrapertools.cachePage(url) logger.info("data="+data) # goSource('ee5533f50eab1ef355661eef3b9b90ec','megaupload') patron = "goSource\('([^']+)','megaupload'\)" matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: data = scrapertools.cachePagePost("http://www.cuevana.tv/player/source_get","key=%s&host=megaupload&vars=&id=2933&subs=,ES&tipo=&sub_pre=ES" % matches[0]) logger.info("data="+data) listavideos = servertools.findvideos(data) itemlist = [] for video in listavideos: server = video[2] scrapedtitle = item.title + " [" + server + "]" scrapedurl = video[1] itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle , url=scrapedurl, thumbnail=item.thumbnail, plot=item.plot, server=server, folder=False)) return itemlist
def play(params, url, category): logger.info("[frozenlayer.py] play") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") server = params["server"] # En tu.tv, la URL es la del detalle en el servidor if server == "tu.tv": data = scrapertools.cachePage(url) listavideos = servertools.findvideos(data) if len(listavideos) > 0: url = listavideos[0][1] xbmctools.playvideo(CHANNELNAME, server, url, category, title, thumbnail, plot)
def play(params,url,category): logger.info("[tutvsite.py] play") title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" ) thumbnail = xbmc.getInfoImage( "ListItem.Thumb" ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) server = params["server"] logger.info("[tutvsite.py] thumbnail="+thumbnail) logger.info("[tutvsite.py] server="+server) # Descarga la página de detalle y extrae el vídeo data = scrapertools.cachePage(url) listavideos = servertools.findvideos(data) if len(listavideos)>0: url = listavideos[0][1] logger.info("[tutvsite.py] url="+url) xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def detail(params, url, category): logger.info("[seriesonline.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los mirrors, o a los capítulos de las series... # ------------------------------------------------------------------------------------ logger.info("Busca el enlace de página siguiente...") try: # La siguiente página patronvideos = '<a href="([^"]+)">Sigu' matches = re.compile(patronvideos, re.DOTALL).findall(data) for match in matches: addfolder("#Siguiente", urlparse.urljoin(url, match), "list") except: logger.info("No encuentro la pagina...") # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addnewvideo(CHANNELNAME, "play", category, video[2], title + " - " + video[0], video[1], thumbnail, "") # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
def play(params, url, category): logger.info("[tutvsite.py] play") title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8") thumbnail = xbmc.getInfoImage("ListItem.Thumb") plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") server = params["server"] logger.info("[tutvsite.py] thumbnail=" + thumbnail) logger.info("[tutvsite.py] server=" + server) # Descarga la página de detalle y extrae el vídeo data = scrapertools.cachePage(url) listavideos = servertools.findvideos(data) if len(listavideos) > 0: url = listavideos[0][1] logger.info("[tutvsite.py] url=" + url) xbmctools.playvideo(CHANNELNAME, server, url, category, title, thumbnail, plot)
def detallecapitulo(params,url,category): logger.info("[watchanimeon.py] detallecapitulo") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip() + " - " + videotitle , url , thumbnail , plot ) # ------------------------------------------------------------------------------------ # Extrae el enlace a la serie completa patron = '<a href="([^"]+)" title="View all posts in' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = "Ver serie completa" scrapedurl = urlparse.urljoin(url,match) scrapedthumbnail = thumbnail scrapedplot = plot if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detalleserie" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def listmirrors(params, url, category): logger.info("[sesionvip.py] detail") title = params.get("title") thumbnail = params.get("thumbnail") logger.info("[sesionvip.py] title=" + title) logger.info("[sesionvip.py] thumbnail=" + thumbnail) ''' # Descarga la página y extrae el enlace a la siguiente pagina data = scrapertools.cachePage(url) patronvideos = '<p style="text-align: center;">.*?<a href\="(http\://www.sesionvip.com/[^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) #logger.info(data) if len(matches)==0: xbmctools.alertnodisponible() return # Descarga la siguiente página y extrae el enlace a los mirrors url = matches[0] ''' data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addvideo(CHANNELNAME, video[0], video[1], category, video[2]) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def AddVideoURL(devuelve, encontrados, title, url): #Megavideo tipo "http://www.megavideo.com/?v=CN7DWZ8S" logger.info("0) Enlace estricto a megavideo") patronvideos = 'http\:\/\/www.megavideo.com\/.*?v\=([A-Z0-9a-z]{8})' matches = re.compile(patronvideos).findall(url) for match in matches: AddVideoID(devuelve, encontrados, title, match, 'Megavideo') #Megavideo tipo "http://www.megavideo.com/v/CN7DWZ8S" logger.info("1) Enlace estricto a megavideo") patronvideos = 'http\:\/\/www.megavideo.com\/v\/([A-Z0-9a-z]{8})' matches = re.compile(patronvideos).findall(url) for match in matches: AddVideoID(devuelve, encontrados, title, match, 'Megavideo') #Megavideo tipo "http://www.megaupload.com/?d=CN7DWZ8S" logger.info("2) Enlace estricto a megaupload") patronvideos = 'http\:\/\/www.megaupload.com\/.*?d\=([A-Z0-9a-z]{8})' matches = re.compile(patronvideos).findall(url) for match in matches: AddVideoID(devuelve, encontrados, title, match, 'Megaupload') #Megavideo tipo "http://www.megaupload.com/?d=CN7DWZ8S" logger.info("3) Enlace estricto a megaupload") patronvideos = 'http\:\/\/www.megavideo.com\/.*?d\=([A-Z0-9a-z]{8})' matches = re.compile(patronvideos).findall(url) for match in matches: AddVideoID(devuelve, encontrados, title, match, 'Megaupload') #Megavideo tipo "http://www.megaupload.com/?d=CN7DWZ8S" logger.info("4) Enlace estricto a megavideo") patronvideos = 'http\:\/\/wwwstatic.megavideo.com\/mv_player.swf\?v\=([A-Z0-9a-z]{8})' matches = re.compile(patronvideos).findall(url) for match in matches: AddVideoID(devuelve, encontrados, title, match, 'Megavideo') videosarray = servertools.findvideos(url) for videoa in videosarray: AddVideoID(devuelve, encontrados, title, videoa[1], videoa[2]) return
def detail(params, url, category): logger.info("[peliculashd.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patron = '<span class="title">([^<]+)</span>' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: title = matches[0] # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] if server != "Megaupload": xbmctools.addnewvideo(__channel__, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot) # ------------------------------------------------------------------------------------ # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def findvideos(item): logger.info("[yotix.py] play") title = urllib.unquote_plus( params.get("title") ) url = item.url thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) server = urllib.unquote_plus( params.get("server") ) data = scrapertools.cachePage(url) #logger.info(data) itemlist = [] # Busca videos directos patron = 'so.addParam\(\'flashvars\',\'\&file\=([^\&]+)\&' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: scrapedurl = matches[0] newurl = findnewlocation(scrapedurl) if newurl!="": url = newurl itemlist.append( Item(channel=CHANNELNAME, action="play" , title=title , url=url, thumbnail=thumbnail, plot=plot, server="Directo", folder=False)) # Busca el resto de videos listavideos = servertools.findvideos(data) itemlist = [] for video in listavideos: scrapedtitle = item.title + " (" + video[2] + ")" scrapedurl = video[1] scrapedthumbnail = item.thumbnail scrapedplot = item.plot server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle , url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, server=server, folder=False)) return itemlist
def detail(params, url, category): logger.info("[veranime.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patron = '<div id="listacapdd"><div class="listddserie">[^<]+' patron += '<a title="[^"]+" href="([^"]+)"><strong>[^<]+</strong></a>[^<]+' patron += '</div>' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: url = matches[0] data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] xbmctools.addnewvideo(CHANNELNAME, "play", category, server, title.strip() + " - " + videotitle, url, thumbnail, plot) # ------------------------------------------------------------------------------------ # Asigna el título, desactiva la ordenación, y cierra el directorio xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def findvideos(item): logger.info("[pelisalacarta.py] findvideos") # Descarga la página import scrapertools data = scrapertools.cachePage(item.url) #logger.info(data) # Busca los enlaces a los videos import servertools listavideos = servertools.findvideos(data) itemlist = [] for video in listavideos: scrapedtitle = item.title.strip() + " - " + video[0] scrapedurl = video[1] server = video[2] import xbmctools xbmctools.addnewvideo(item.channel, "play", "", server, scrapedtitle, scrapedurl, item.thumbnail, item.plot) # ------------------------------------------------------------------------------------ return itemlist
def mirrors(item): logger.info("[capitancinema.py] mirrors") title = item.title thumbnail = item.thumbnail plot = item.plot # Descarga la página data = scrapertools.cachePage(item.url) patronvideos = '<li><strong>DISPONIBLE EN EL FORO</strong>[^<]+<a href="([^"]+)"' matches = re.compile(patronvideos, re.DOTALL).findall(data) itemlist = [] if len(matches) > 0: url = matches[0] data = scrapertools.cachePage(url) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: scrapedtitle = title.strip() + " - " + video[0] scrapedurl = video[1] server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play", title=scrapedtitle, url=scrapedurl, thumbnail=item.thumbnail, plot=item.plot, server=server, folder=False)) return itemlist
def listmirrors(params,url,category): logger.info("[gratisdocumentales.py] detail") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) #plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) plot = urllib.unquote_plus( params.get("plot") ) # ------------------------------------------------------------------------------------ # Descarga la página # ------------------------------------------------------------------------------------ data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca el argumento # ------------------------------------------------------------------------------------ patronvideos = '<div class="ficha_des">(.*?)</div>' matches = re.compile(patronvideos,re.DOTALL).findall(data) if len(matches)>0: plot = scrapertools.htmlclean(matches[0]) # ------------------------------------------------------------------------------------ # Busca el thumbnail # ------------------------------------------------------------------------------------ patronvideos = '<div class="ficha_img pelicula_img">[^<]+' patronvideos += '<img src="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) if len(matches)>0: thumbnail = matches[0] # ------------------------------------------------------------------------------------ # Busca los enlaces a los mirrors, o a los capítulos de las series... # ------------------------------------------------------------------------------------ # url = "http://www.gratisdocumentales.es/inc/mostrar_contenido.php?sec=pelis_ficha&zona=online&id=video-4637" patronvideos = '<div class="ver_des_peli iframe2">[^<]+' patronvideos += '<ul class="tabs-nav" id="([^"]+)">' matches = re.compile(patronvideos,re.DOTALL).findall(data) ''' <div id="ficha_ver_peli"> <div class="v_online"> <h2>Ver online <span>El destino de Nunik</span></h2> <div class="opstions_pelicula_list"> <div class="tit_opts" style="cursor:pointer;" onclick="location.href='http://www.gratisdocumentales.es/peliculas/drama/el-destino-de-nunik_espanol-dvd-rip-megavideo-6026.html'"> <p>Mirror 1: Megavideo</p> <p><span>CALIDAD: DVD-RIP | IDIOMA: ESPAÑOL</span></p> <p class="v_ico"><img src="http://caratulas.gratisdocumentales.es/img/cont/megavideo.png" alt="Megavideo" /></p> </div> <div class="tit_opts" style="cursor:pointer;" onclick="location.href='http://www.gratisdocumentales.es/peliculas/drama/el-destino-de-nunik_espanol-dvd-rip-megavideo-6027.html'"> <p>Mirror 2: Megavideo</p> <p><span>CALIDAD: DVD-RIP | IDIOMA: ESPAÑOL</span></p> <p class="v_ico"><img src="http://caratulas.gratisdocumentales.es/img/cont/megavideo.png" alt="Megavideo" /></p> </div> </div> </div> </div> ''' data = scrapertools.cachePage("http://www.gratisdocumentales.es/inc/mostrar_contenido.php?sec=pelis_ficha&zona=online&id="+matches[0]) patronvideos = '<div class="tit_opts" style="cursor:pointer;" onclick="location.href=\'([^\']+)\'">[^<]+' patronvideos += '<p>([^<]+)</p>[^<]+' patronvideos += '<p><span>([^<]+)</span>' matches = re.compile(patronvideos,re.DOTALL).findall(data) for match in matches: logger.info("Encontrado iframe mirrors "+match[0]) # Lee el iframe mirror = urlparse.urljoin(url,match[0].replace(" ","%20")) req = urllib2.Request(mirror) 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) data=response.read() response.close() listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] scrapedurl = video[1] server = video[2] xbmctools.addnewvideo( CHANNELNAME , "play" , category , server , title.strip()+" "+match[1]+" "+match[2]+" "+videotitle , scrapedurl , thumbnail , plot ) # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def detail(params, url, category): logger.info("[documentariestv.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) thumnbail = thumbnail logger.info("[prueba.py] title=" + title) logger.info("[prueba.py] thumbnail=" + thumbnail) patrondescrip = '<h3>Description</h3>(.*?)</tr>' # Descarga la p�gina data = scrapertools.cachePage(url) descripcion = "" plot = "" matches = re.compile(patrondescrip, re.DOTALL).findall(data) if DEBUG: if len(matches) > 0: descripcion = matches[0] descripcion = descripcion.replace(" ", "") descripcion = descripcion.replace("<br/>", "") descripcion = descripcion.replace("\r", "") descripcion = descripcion.replace("\n", " ") descripcion = descripcion.replace("\t", " ") descripcion = re.sub("<[^>]+>", " ", descripcion) # logger.info("descripcion="+descripcion) descripcion = acentos(descripcion) # logger.info("descripcion="+descripcion) try: plot = unicode(descripcion, "utf-8").encode("iso-8859-1") except: plot = descripcion # ---------------------------------------------------------------------------- # Busca los enlaces a los videos de : "Megavideo" # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] logger.info("url =" + url) if url.endswith(".jpg"): break server = video[2] if server == "Megavideo" or "Veoh": xbmctools.addnewvideo( CHANNELNAME, "play", category, server, title.strip().replace("(Megavideo)", "").replace(" ", " ") + " - " + videotitle, url, thumbnail, plot) else: xbmctools.addnewvideo( CHANNELNAME, "play", category, server, title.strip().replace(server, "").replace(" ", " ") + " - " + videotitle, url, thumbnail, plot) # ------------------------------------------------------------------------------------ # ---- Extrae los videos directos ----- # Extrae los enlaces a los v�deos (Directo) patronvideos = "file: '([^']+)'" servidor = "Directo" extraevideos(patronvideos, data, category, title + " - directo", thumbnail, plot, servidor) # --------------------------------------- # --- Extrae los videos de veoh ---- patronvideos = 'var embed_code[^>]+> <param name="movie" value="http://www.veoh.com/static/swf/webplayer/WebPlayer.swf.*?permalinkId=(.*?)&player=videodetailsembedded&videoAutoPlay=0&id=anonymous"></param>' servidor = "Veoh" extraevideos(patronvideos, data, category, title + " - Video en Veoh", thumbnail, plot, servidor) # --------------------------------------- #var embed_code = '<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=1447612366747092264&hl=en&fs=true" style="width:496px;height:401px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="window"> </embed>' ; # --- Extrae los videos de google ---- patronvideos = '<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf.*?docid=(.*?)&hl=en&' servidor = "Google" extraevideos(patronvideos, data, category, title + " - Video en google", thumbnail, plot, servidor) # --------------------------------------- # --- Extrae los videos de http://n59.stagevu.com ---- patronvideos = '"http://n59.stagevu.com/v/.*?/(.*?).avi"' servidor = "Stagevu" extraevideos(patronvideos, data, category, title, thumbnail, plot, servidor) # --Muestra Una opcion mas para videos documentales relacionados con el tema-- xbmctools.addnewfolder(CHANNELNAME, "verRelacionados", category, "Watch related video", data, thumbnail, "Search some related Documenties") # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def ListarVideos(params, url, category): url1 = "http://www.series21.com" url1 = urlparse.urljoin(url1, url) title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = urllib.unquote_plus(params.get("plot")) data = scrapertools.cachePage(url1) # Busca el area donde estan los videos y la descripcion patronvideos = '<div id="content">(.*?)<!-- FIN #content-->' matches = re.compile(patronvideos, re.DOTALL).findall(data) matchesBK = matches[0] # Extrae las entradas (videos) para megavideo patronvideos = '<span style="font-size:12px;"><strong>(.*?)</strong></span><br/>.*?' patronvideos += '<span.*?>.*?<a href="http\:\/\/www.megavideo.com\/([\?v=|v/|\?d=]+)([A-Z0-9]{8}).*?" target' matches = re.compile(patronvideos, re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) encontrados = set() for match in matches: if match[2] not in encontrados: encontrados.add(match[2]) if 'v' in match[1]: server = "Megavideo" else: server = "Megaupload" doblaje = scrapertools.entityunescape(match[0]) # Titulo scrapedtitle = title + " - [" + doblaje + "]" + " (" + server + ")" # URL scrapedurl = match[2] # Thumbnail scrapedthumbnail = thumbnail # Argumento #print 'este es el plot %s ' %plot #print ' doblaje %s ' %doblaje scrapedplot = plot if ("Español" in plot) and not (doblaje in plot): scrapedplot = scrapedplot.replace("Español", doblaje) elif "subtitulado" in plot and not (doblaje in plot): scrapedplot = scrapedplot.replace( "Versión original (subtitulado)", doblaje) elif not doblaje in plot: scrapedplot += "\n" + "Doblaje : " + doblaje # Depuracion if (DEBUG): logger.info("scrapedtitle=" + scrapedtitle) logger.info("scrapedurl=" + scrapedurl) logger.info("scrapedthumbnail=" + scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewvideo(CHANNELNAME, "play", category, server, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) if len(matches) == 0: listavideos = servertools.findvideos(data) encontrados = set() for titulo, scrapedurl, servidor in listavideos: if scrapedurl.strip() not in encontrados: encontrados.add(scrapedurl.strip()) xbmctools.addnewvideo(CHANNELNAME, "play", category, servidor, title + " - %s" % titulo, scrapedurl, thumbnail, plot) patronvideos = '<span class="bloque-doblaje">(.+?)</span>[^<]+' patronvideos += '<span class="bloque-link">[^<]+<a href="javascript\:goTo\(\'([^\']+)\'\, \'([^\']+)\'\)"(.+?)</span>' #patronvideos +='(?:\| <a href="javascript\:goTo\(\'([^\']+)\'\, \'([^\']+)\'\)".*?)</span>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # URL if "megavideo" in match[2]: server = "Megavideo" elif "megaupload" in match[2]: server = "Megaupload" if "esp.gif" in match[0]: doblaje = "Español" else: doblaje = match[0].strip() base64 = decrypt21.Base64() try: url2 = re.compile( "javascript\:goTo\(\'([^\']+)\'\, \'([^\']+)\'\)").findall( match[3])[0] scrapedurl2 = base64._extract_code(base64.decode(url2[0])) scrapedurl = base64._extract_code(base64.decode(match[1])) part1 = " Parte 1 " part2 = " Parte 2 " scrapedtitle2 = title + part2 + " - [" + doblaje + "]" + " (" + server + ")" #print match[3] except: scrapedurl = base64._extract_code(base64.decode(match[1])) part1 = "" part2 = "" scrapedtitle = title + part1 + " - [" + doblaje + "]" + " (" + server + ")" # Thumbnail scrapedthumbnail = thumbnail # Argumento scrapedplot = plot # Depuracion if (DEBUG): logger.info("scrapedtitle=" + scrapedtitle) logger.info("scrapedurl=" + scrapedurl) logger.info("scrapedthumbnail=" + scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewvideo(CHANNELNAME, "play", category, server, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) if part2: xbmctools.addnewvideo(CHANNELNAME, "play", category, server, scrapedtitle2, scrapedurl2, scrapedthumbnail, scrapedplot) # Extrae las entradas (videos) directos patronvideos = 'flashvars="file=([^\&]+)\&controlbar=over' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches) > 0: data1 = scrapertools.cachePage(matches[0]) #logger.info(data) patron = 'author">(.*?)</media:credit>.*?<media\:content url="([^"]+)"' matches = re.compile(patron, re.DOTALL).findall(data1) scrapertools.printMatches(matches) for match in matches: # Añade al listado de XBMC xbmctools.addnewvideo( CHANNELNAME, "play", category, "Directo", title + " - [" + match[0] + "]" + " (Directo)", match[1], thumbnail, plot) # Busca el Spoiler patronvideos = '(http://www.youtube.com[^"]+)"' matchSpoiler = re.compile(patronvideos, re.DOTALL).findall(data) if len(matchSpoiler) > 0: encontrados = set() for match in matchSpoiler: if match not in encontrados: encontrados.add(match) # Añade al listado de XBMC xbmctools.addnewvideo(CHANNELNAME, "youtubeplay", category, "Directo", "Ver El Spoiler de : " + title, match, thumbnail, "Ver Video Spoiler") # Lista series relacionadas titulo = "Ver otros capitulos de esta temporada" matches = buscarelacionados(matchesBK) plot2 = "CAPITULOS DE ESTA TEMPORADA :\n\n" for match in matches: plot2 = plot2 + "-" + match[2] + "\n" xbmctools.addnewfolderextra(CHANNELNAME, "listarelacionados", category, titulo, url, thumbnail, plot2, matchesBK) #<div class="film"><a href="/house/#t_57"><img src="/thumbs/temporadas/95/120/57.jpg" # Cambiar de Temporada patron = 'div class="film"><a href="([^"]+)"><img src="([^"]+)" style' matchSerie = re.compile(patron, re.DOTALL).findall(matchesBK) if len(matchSerie) > 1: for temp in matchSerie: url2 = urlparse.urljoin(url1, temp[0]) thumbnail = urlparse.urljoin(url1, temp[1]) titulo = "Cambiar a otras temporadas" titulo_serie = temp[0].split("/") titulo2 = titulo_serie[1].replace("-", " ") #print ' titulo%s ' %titulo2 xbmctools.addnewfolderextra(CHANNELNAME, "listarTemporada", category, titulo, url2, thumbnail, plot, titulo2) break # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) # Disable sorting... xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) # End of directory... xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def detail(item): logger.info("[cine15.py] detail") title = item.title thumbnail = item.thumbnail plot = item.plot # Descarga la página data = scrapertools.cachePage(item.url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a videos no megavideo (playlist xml) # ------------------------------------------------------------------------------------ patronvideos = 'flashvars[^f]+file=([^\&]+)\&' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] if len(matches) > 0: if ("xml" in matches[0]): data2 = scrapertools.cachePage(matches[0]) logger.info("data2=" + data2) patronvideos = '<track>[^<]+' patronvideos += '<title>([^<]+)</title>[^<]+' patronvideos += '<location>([^<]+)</location>[^<]+' patronvideos += '</track>' matches = re.compile(patronvideos, re.DOTALL).findall(data2) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[0] scrapedurl = match[1].strip() scrapedthumbnail = thumbnail scrapedplot = plot if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="play", title=scrapedtitle + " [Directo]", url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, server="Directo", folder=False)) else: itemlist.append( Item(channel=CHANNELNAME, action="play", title=title + " [Directo]", url=matches[0], thumbnail=thumbnail, plot=plot, server="Directo", folder=False)) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: videotitle = video[0] url = video[1] server = video[2] itemlist.append( Item(channel=CHANNELNAME, action="play", title=title.strip() + " - " + videotitle, url=url, thumbnail=thumbnail, plot=plot, server=server, folder=False)) # ------------------------------------------------------------------------------------ return itemlist
def detail(params,url,category): logger.info("[documentalesatonline2.py] detail") #title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" ) #thumbnail = urllib.unquote_plus( params.get("thumbnail") ) #plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patronvideos0 = '- [0-9]+? de [0-9]+?:(.+)' #- 1 de 3: matches0 = re.compile(patronvideos0).findall(data) if len(matches0)==0: patronvideos0 = 'Episodio \d+(.+)' #- Episodio 03: matches0 = re.compile(patronvideos0).findall(data) #logger.info(matches0) if len(matches0)>0: listavideos = servertools.findvideos(data) if (2*len(matches0))==len(listavideos): logger.info("es el doble, vamos a anadir un link de megavideo y uno de megaupload por cada fideo") length=len(matches0) for i in range(len(matches0)): logger.info(listavideos[0+i][0]) logger.info(listavideos[0+i][1]) logger.info(listavideos[0+i][2]) #logger.info(matches0) xbmctools.addvideo( CHANNELNAME , strip_ml_tags(matches0[i]).replace(":","").strip() + " " + listavideos[0+i][0] , listavideos[0+i][1] , category , listavideos[0+i][2] ) xbmctools.addvideo( CHANNELNAME , strip_ml_tags(matches0[i]).replace(":","").strip() + " " + listavideos[length+i][0] , listavideos[length+i][1] , category , listavideos[length+i][2] ) else: logger.info("vamos a ponerlos con el nombre del titulo todos, el mismo que el por defecto") logger.info("no hay capitulos") patronvideos = '(.+?)\(' matches = re.compile(patronvideos).findall(category) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addvideo( CHANNELNAME , matches[0] + video[0] , video[1] , category , video[2] ) # addvideo( "Mafia rusa.2010 [Megavideo]" , "3KT95673" , "Megavideo" , "")" # ------------------------------------------------------------------------------------ #for i in matches0: # logger.info(strip_ml_tags(i)) else: logger.info("no hay capitulos") patronvideos = '(.+?)\(' matches = re.compile(patronvideos).findall(category) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ listavideos = servertools.findvideos(data) for video in listavideos: xbmctools.addvideo( CHANNELNAME , matches[0] + video[0] , video[1] , category , video[2] ) # ------------------------------------------------------------------------------------ patronvideos = '<a rel="bookmark" href="../(.+?)">(.+?)<' matches = re.compile(patronvideos).findall(data) for z in matches: xbmctools.addfolder( CHANNELNAME, z[1], "http://documentalesatonline.loquenosecuenta.com/" + z[0], "detail") #<a href="http://programastvonline.blogspot.com/2010/09/cuarto-milenio-6x02-tardigrados-el.html">Cuarto Milenio 6×02: Tardígrados, El Misterio Medjugorje, El fantasma del Verdugo y En los límites del miedo (26-09-10).Online.</a><br /> patronvideos = '<a href="(http://programastvonline.blogspot.com.+?)">(.+?)<' matches = re.compile(patronvideos).findall(data) #logger.info(str(len(matches)) + " no te veo!") for z in matches: #xbmctools.addnewfolder("programastv","detail",category,z[1],z[0],"","") #xbmctools.addnewfolder(canal, accion, category, title, url, thumbnail, plot, Serie, totalItems) xbmctools.addfolder("programastv", z[1], z[0], "parsear") #xbmctools.addnewfolder(canal, accion, category, title, url, thumbnail, plot, Serie, totalItems) #<a rel="bookmark" href="../2010/11/cuarto-milenio-6x06-el-pan-malditoanxelinossenales-del-espacio-exterior-y-murcia-la-torre-de-los-exorcismos-24-10-10-descargaronline/">Cuarto Milenio 6×06: El pan maldito,Anxeliños,Señales del espacio exterior y Murcia: La Torre de los exorcismos (24-10-10) (Descargaronline)</a><br /> # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def listvideos(params,url,category): logger.info("[peliculas21.py] listvideos") if url=="": url = "http://www.peliculas21.com" # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) #title = urllib.unquote_plus(params.get("title")) #thumbnail = urllib.unquote_plus(params.get("thumbnail")) #plot = urllib.unquote_plus(params.get("plot")) # Busca el area donde estan los videos y la descripcion patronvideos = '<div class="peliculadoblaje">(.*?)<!-- FIN #content-->' matches = re.compile(patronvideos,re.DOTALL).findall(data) # busca el titulo y el thumbnail patronvideos = '<img src="([^"]+)"[^>]+>[^<]+<[^>]+>([^<]+)</div>' matches2 = re.compile(patronvideos,re.DOTALL).findall(matches[0]) for match in matches2: title = match[1] thumbnail = urlparse.urljoin(url,match[0]) plot = "" patronvideos = '<b>Duración:</b>(.*?)<br />' duracion = re.compile(patronvideos,re.DOTALL).findall(matches[0]) if len(duracion)>0:plot = "Duracion:"+duracion[0] + "\n" patronvideos = '<b>Género:</b>(.*?)<br />' genero = re.compile(patronvideos,re.DOTALL).findall(matches[0]) if len(genero)>0:plot = plot + "Genero: "+genero[0] +"\n" patronvideos = '<b>Sinopsis:</b>(.*?)</div>' sinopsis = re.compile(patronvideos,re.DOTALL).findall(matches[0]) # Busca los actores matchesactores = buscactores(matches[0]) if len(matchesactores)>0: plot = plot + "Actores: " c = 0 actores = "ACTORES DE ESTA PELICULA :\n\n" for match in matchesactores: c = c + 1 actores = actores + "-"+match[1] + "\n" if c == 3: plot = plot + match[1] + "\n" elif c == 4: plot = plot + "* " + match[1]+" " else: plot = plot + match[1]+ " , " plot = plot + "\nSinopsis: " + sinopsis[0] plot = re.sub("<[^>]+>"," ",plot) # Busca el trailer patronvideos = '<param name="movie" value="([^"]+)"></param>' matchtrailer = re.compile(patronvideos,re.DOTALL).findall(matches[0]) if len(matchtrailer)>0: for match in matchtrailer: # Añade al listado de XBMC xbmctools.addnewvideo( CHANNELNAME , "youtubeplay" , category ,"Directo", "Ver El Trailer de : "+title , match , thumbnail, plot ) else: import trailertools print title s = unicode( title, "latin-1" ) # Añade al listado de XBMC xbmctools.addnewfolder( "trailertools" , "buscartrailer" , category , config.getLocalizedString(30110)+" "+title , url , os.path.join(IMAGES_PATH, 'trailertools.png'), plot ) # Buscar trailer para matchesBK = matches[0] # Extrae las entradas (videos) para megavideo con tipo de audio patronvideos = '<span style="font-size:12px;"><strong>(.*?)</strong></span><br/>.*?' patronvideos += '<span.*?>.*?<a href="http\:\/\/www.megavideo.com\/[\?v=|v/]+([A-Z0-9]{8}).*?" target="_blank">1</a>.</span><br />' matches = re.compile(patronvideos,re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) encontrados = set() for match in matches: if match[1] not in encontrados: encontrados.add(match[1]) # Titulo scrapedtitle = title + " - [" +scrapertools.entityunescape(match[0])+ "]" + " (Megavideo)" # URL scrapedurl = match[1] # Thumbnail scrapedthumbnail = thumbnail # Argumento scrapedplot = plot # Depuracion if (DEBUG): logger.info("scrapedtitle="+scrapedtitle) logger.info("scrapedurl="+scrapedurl) logger.info("scrapedthumbnail="+scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewvideo( CHANNELNAME , "play" , category ,"Megavideo", scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) if len(matches)==0: listavideos = servertools.findvideos(data) encontrados = set() for titulo,scrapedurl,servidor in listavideos: if scrapedurl.strip() not in encontrados: encontrados.add(scrapedurl.strip()) xbmctools.addnewvideo( CHANNELNAME , "play" , category ,servidor, title+ " - %s" % titulo , scrapedurl , thumbnail, plot ) ''' <span class="bloque-uploader">Anónimo</span> <span class="bloque-doblaje"><img src="../images/esp.gif" class="bandera" /></span> <span class="bloque-link">Opción 8: <a href="javascript:goTo('aHR0cDovL3d3dy5tZWdhdmlkZW8uY29tLz92PTVOM0JYOVMx', 'megavideo.com')" rel="nofollow">Ver película</a></span> ''' patronvideos = '<span class="bloque-doblaje">(.+?)</span>[^<]+' patronvideos +='<span class="bloque-link">[^<]+<a href="javascript\:goTo\(\'([^\']+)\'\, \'([^\']+)\'\)"(.+?)</span>' #patronvideos +='(?:\| <a href="javascript\:goTo\(\'([^\']+)\'\, \'([^\']+)\'\)".*?)</span>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # URL if "megavideo" in match[2]: server = "Megavideo" elif "megaupload" in match[2]: server = "Megaupload" if "esp.gif" in match[0]: doblaje = "Español" else: doblaje = match[0].strip() base64 = decrypt21.Base64() try: url2 = re.compile("javascript\:goTo\(\'([^\']+)\'\, \'([^\']+)\'\)").findall(match[3])[0] scrapedurl2 = base64._extract_code(base64.decode(url2[0])) scrapedurl = base64._extract_code(base64.decode(match[1])) part1 = " Parte 1 " part2 = " Parte 2 " scrapedtitle2 = title + part2+ " - [" +doblaje+ "]" + " ("+server+")" #print match[3] except: scrapedurl = base64._extract_code(base64.decode(match[1])) part1 = "" part2 = "" scrapedtitle = title + part1+ " - [" +doblaje+ "]" + " ("+server+")" # Thumbnail scrapedthumbnail = thumbnail # Argumento scrapedplot = plot # Depuracion if (DEBUG): logger.info("scrapedtitle="+scrapedtitle) logger.info("scrapedurl="+scrapedurl) logger.info("scrapedthumbnail="+scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewvideo( CHANNELNAME , "play" , category ,server, scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) if part2: xbmctools.addnewvideo( CHANNELNAME , "play" , category ,server, scrapedtitle2 , scrapedurl2 , scrapedthumbnail, scrapedplot ) # Extrae las entradas (videos) directos patronvideos = 'flashvars="file=([^\&]+)\&controlbar=over' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)>0: data1 = scrapertools.cachePage(matches[0]) #logger.info(data) patron = 'author">(.*?)</media:credit>.*?<media\:content url="([^"]+)"' matches = re.compile(patron,re.DOTALL).findall(data1) scrapertools.printMatches(matches) for match in matches: # Añade al listado de XBMC xbmctools.addnewvideo( CHANNELNAME , "play" , category , "Directo" , title +" - ["+match[0]+"]"+ " (Directo)" , match[1] , thumbnail , plot ) # Busca otras peliculas relacionadas con los actores if len(matchesactores)>0: titulo = "Busca otros Films de los actores de esta pelicula" xbmctools.addnewfolder( CHANNELNAME , "listaractores" , category , titulo , matchesBK , thumbnail, actores ) # Lista peliculas relacionadas titulo = "Ver Peliculas Relacionadas" matches = buscarelacionados(matchesBK) plot2 = "PELICULAS RELACIONADAS :\n\n" for match in matches: plot2 = plot2 + "-"+match[1]+"\n" xbmctools.addnewfolder( CHANNELNAME , "listarelacionados" , category , titulo , matchesBK , thumbnail, plot2 ) # Label (top-right)... xbmcplugin.setPluginCategory( handle=pluginhandle, category=category ) # Disable sorting... xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE ) # End of directory... xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )