def categorias(params,url,category): xbmc.output("[goear.py] listcategorias") # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # Extrae las entradas (carpetas) patronvideos = '<div class="cate-tipos"><a href="([^"]+)">([^<]+)</a></div>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url,match[0]) if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"]") # Añade al listado de XBMC addnewfolder( "categoryresults" , scrapedtitle , scrapedurl ) patronvideos = '<div class="flechas" style="float:right;"><a href="([^"]+)"><strong>Siguiente »</strong></a></div></div>' # 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 performsearch(texto): xbmc.output("[peliculasyonkis.py] performsearch") url = "http://www.peliculasyonkis.com/buscarPelicula.php?s="+texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC resultados.append( [CHANNELNAME , "detailfolder" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] ) return resultados
def listsimple(item): logger.info("[cinegratis.py] listsimple") url = item.url # Descarga la página data = scrapertools.cachePage(url) # Extrae los items patronvideos = "<a href='(index.php\?module\=player[^']+)'[^>]*>(.*?)</a>" matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: # Atributos scrapedtitle = match[1] scrapedtitle = scrapedtitle.replace("<span class='style4'>","") scrapedtitle = scrapedtitle.replace("</span>","") scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") itemlist.append( Item(channel=CHANNELNAME, action="findvideos" , title=scrapedtitle , url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot)) return itemlist
def performsearch(texto): xbmc.output("[yotix.py] performsearch") url = "http://yotix.tv/?s="+texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<div class="galleryitem">[^<]+' patronvideos += '<h1><a title="([^"]+)"[^<]+</a></h1>[^<]+' patronvideos += '<a href="([^"]+)"><img src="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: # Atributos scrapedtitle = match[0].replace("–","-") scrapedurl = match[1] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC resultados.append( [CHANNELNAME , "listmirrors" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] ) return resultados
def categorias(params, url, category): logger.info("[documentalesatonline.py] novedades") # Descarga la página data = scrapertools.cachePage(url) # logger.info(data) # Extrae las entradas (carpetas) patronvideos = "<a dir='ltr' href='([^']+)'>([^<]+)</a>[^<]+<span dir='ltr'>([^<]+)</span>" matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] + " " + match[2] scrapedurl = urlparse.urljoin(url, match[0]) scrapedthumbnail = "" scrapedplot = "" if DEBUG: logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME, "novedades", 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 performsearch(texto): logger.info("[cine15.py] performsearch") url = "http://www.seriesyonkis.com/buscarSerie.php?s="+texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<h2><li><a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)".*?' patronvideos += '<span[^>]+>(.*?)</span>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = match[2] scrapedplot = match[3] if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC resultados.append( [CHANNELNAME , "list" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] ) return resultados
def allmovieslist(params,url,category): logger.info("[watchanimeon.py] allmovieslist") # Descarga la página data = scrapertools.cachePage(url) # Extrae el bloque con las entradas correspondientes a esa letra patron = '<ul class="sip-list">(.*?)</ul>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)>0: data = matches[0] # Ahora extrae las series patron = '<li><a href="([^"]+)"[^>]+>([^<]+)</a></li>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = match[1].replace("–","-") scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detallecapitulo" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 newlist(params,url,category): logger.info("[vertelenovelasonline.py] listmirrors") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) #<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.vertelenovelasonline.com/2009/11/amor-palos.html"> #<img style="cursor:pointer; cursor:hand;width: 186px; height: 320px;" src="http://1.bp.blogspot.com/__kdloiikFIQ/SwSWTExa3NI/AAAAAAAAl9Q/JmBSh1D40kE/s320/amor+a+palos.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5405610707194141906" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.vertelenovelasonline.com/2009/11/alcanzar-una-estrella-ii. #<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.vertelenovelasonline.com/2009/10/catalina-y-sebastian.html"> #<img style="cursor: pointer; width: 186px; height: 320px;" src="http://4.bp.blogspot.com/__kdloiikFIQ/SuH75qhmrfI/AAAAAAAAk8A/aLUZX2HAmUY/s320/catalina+y+sebastian.jpg" alt="" id="BLOGGER_PHOTO_ID_5395870796652916210" border="0" /></a><a onblur=" patron = '<a onblur="[^"]+" href="([^"]+)">' patron += '<img style="[^"]+" src="([^"]+)"[^>]+></a>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # http://www.vertelenovelasonline.com/2009/10/dona-barbara.html scrapedtitle = match[0][44:-5] scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = urlparse.urljoin(url,match[1]) scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "listmirrors" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 performsearch(texto): logger.info("[documentariestv.py] performsearch") url = "http://www.documentariestv.net/search.php?keywords=" + texto + "&btn=Search" # Descarga la p�gina data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<li class="video">[^<]+<div class="video_i">[^<]+<a href="([^"]+)"[^"]+"([^"]+)" alt="([^"]+)"[^/]+/><div class="tag".*?</div>[^<]+<span class="artist_name">([^<]+)</span>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: scrapedtitle = acentos(match[2]) scrapedurl = match[0] scrapedthumbnail = match[1] scrapedplot = match[3] if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # A�ade al listado de XBMC resultados.append([ CHANNELNAME, "detail", "buscador", scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot ]) return resultados
def listvideos(params, url, category): logger.info("[peliculasonlineflv.py] listvideos") scrapedthumbnail = "" scrapedplot = "" # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = "<h2 class='title'>Ultimas Peliculas Subidas</h2>(.*?)</div>" matches = re.compile(patronvideos, re.DOTALL).findall(data) if len(matches) > 0: patronvideos = '<a.+?href="([^"]+)".+?><img.+?' patronvideos += 'src="([^"]+)"' matches = re.compile(patronvideos, re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) for match in matches: regexp = re.compile(r'http:\/\/[^\/]+\/[^\/]+\/[^\/]+\/([^\.]+)\.html') matchtitle = regexp.search(match[0]) if matchtitle is not None: scrapedtitle = matchtitle.group(1).replace("-", " ") else: scrapedtitle = match[0] scrapedtitle = scrapedtitle.replace("–", "-") scrapedtitle = scrapedtitle.replace(" ", " ") scrapedtitle = scrapedtitle.replace("&;", "&") scrapedurl = match[0] scrapedthumbnail = match[1] scrapedplot = "" #scrapedplot = scrapedplot.replace("…","") if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "detail", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # Extrae la marca de siguiente página patronvideos = '<div class="left"><a href="([^"]+)" ><span>«</span> Entradas Anteriores</a></div>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches) > 0: scrapedtitle = "Página siguiente" scrapedurl = urlparse.urljoin(url, matches[0]) scrapedthumbnail = "" scrapedplot = "" xbmctools.addnewfolder(CHANNELNAME, "listvideos", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # Propiedades 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 SearchResult(params, url, category): logger.info("[peliculasonlineflv.py] SearchResult") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<p class="entry-title"><[^>]+>[^<]+</span><a href="([^"]+)"[^>]+>([^<]+)</a></p>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedurl = match[0] scrapedtitle = match[1] scrapedtitle = scrapedtitle.replace("–", "-") scrapedtitle = scrapedtitle.replace(" ", " ") scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "detail", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # Propiedades 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 ListCat(params, url, category): logger.info("[peliculasonlineflv.py] peliscat") # Descarga la página data = scrapertools.cachePage(url) patronvideos = '<li><a href="[^"]+" title="">Generos</a>(.*?)</ul>' matches = re.compile(patronvideos, re.DOTALL).findall(data) # Extrae las entradas (carpetas) if len(matches) > 0: patronvideos = '<li><a href="([^"]+)" title="">([^<]+)</a>' matches = re.compile(patronvideos, re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "listvideosMirror", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # Propiedades 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 DocuARCHIVO(params, url, category): logger.info("[peliculasonlineflv.py] DocuSeries") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = "<li class='archivedate'>[^<]+" patronvideos += "<a href='([^']+)'>([^<]+)</a>([^<]+)</li>" matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedurl = match[0] scrapedtitle = match[1] + match[2] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "listvideosMirror", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # Propiedades 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 performsearch(texto): logger.info("[peliculasonlineflv.py] performsearch") url = "http://peliculasonlineflv.wordpress.com/index.php?s=" + texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<p class="entry-title"><[^>]+>[^<]+</span><a href="([^"]+)"[^>]+>([^<]+)</a></p>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: scrapedtitle = match[1] scrapedtitle = scrapedtitle.replace("–", "-") scrapedtitle = scrapedtitle.replace(" ", " ") scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC resultados.append([ CHANNELNAME, "detail", "buscador", scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot ]) return resultados
def newlist(item): # Descarga la página data = scrapertools.downloadpageGzip(item.url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<div class="item">.*?<a href="([^"]+)"[^<]+<img src="([^"]+)".*?<div class="cover boxcaption">[^<]+<h1>([^<]+)</h1>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: scrapedtitle = match[2] scrapedurl = urlparse.urljoin(item.url, match[0]) scrapedthumbnail = urlparse.urljoin(item.url, match[1]) scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="detail", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot)) return itemlist
def extraevideos(patronvideos, data, category, title, thumbnail, plot, servidor): logger.info("patron=" + patronvideos) matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches) > 0: # A�ade al listado de XBMC if servidor == "Directo": xbmctools.addnewvideo(CHANNELNAME, "play", category, "Directo", title, matches[0], thumbnail, plot) elif servidor == "Veoh": veohurl = servertools.findurl(matches[0], "veoh") logger.info(" veohurl = " + veohurl) if len(veohurl) > 0: if veohurl == "http://./default.asp": advertencia = xbmcgui.Dialog() resultado = advertencia.ok( 'The Documental video', title, 'not exist in Veoh', 'visit the web www.documentariestv.net for report this' ) return logger.info(" newmatches = " + veohurl) xbmctools.addnewvideo(CHANNELNAME, "play", category, "Directo", title, veohurl, thumbnail, plot) else: advertencia = xbmcgui.Dialog() resultado = advertencia.ok('The Documental video', title, 'not exist in Veoh') return elif servidor == "Google": url = "http://www.flashvideodownloader.org/download.php?u=http://video.google.com/videoplay?docid=" + matches[ 0] logger.info(" Url = " + url) data = scrapertools.cachePage(url) newpatron = '</script><div.*?<a href="(.*?)" title="Click to Download">' newmatches = re.compile(newpatron, re.DOTALL).findall(data) if len(newmatches) > 0: logger.info(" newmatches = " + newmatches[0]) xbmctools.addnewvideo(CHANNELNAME, "play", category, "Directo", title, newmatches[0], thumbnail, plot) elif servidor == "Stagevu": url = "http://stagevu.com/video/" + matches[0] url = servertools.findurl(url, servidor) logger.info(" url = " + url) if DEBUG: videotitle = "Video en Stagevu" server = servidor xbmctools.addnewvideo( CHANNELNAME, "play", category, "Directo", title.strip().replace(server, "").replace(" ", " ") + " - " + videotitle, url, thumbnail, plot)
def fulllist(item): # Descarga la página data = scrapertools.downloadpageGzip(item.url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<li><a href="([^"]+)"><span>([^<]+)</span></a></li>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: scrapedtitle = match[1] scrapedurl = urlparse.urljoin(item.url, match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="detail", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot)) return itemlist
def catlist(params, url, category): logger.info("[watchanimeon.py] catlist") # Descarga la página data = scrapertools.cachePage(url) # Extrae las categorias patron = '<a href="(\/\?genre[^"]+)">([^<]+)</a>' matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url, match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "catdetail", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # 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 play(params,url,category): xbmc.output("[argia.py] play") # Page downloading data = scrapertools.cachePage(url) ## ## PARSE VIDEO DATA ## ''' s1.addVariable('file','/multimedia/docs/bideoak/dantzaTradizioa.flv'); ''' #pattern = 'file=(.*?).flv' pattern = "s1\.addVariable\('file','([^']+)'\)" matches = re.compile(pattern,re.DOTALL).findall(data) scrapertools.printMatches(matches) try: url = MAINURL+matches[0] except: url = "" title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) server = "Directo" xbmctools.playvideo(CHANNELCODE,server,url,category,title,thumbnail,plot)
def categorias(params,url,category): logger.info("[documentalesatonline2.py] novedades") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<li class=.cat-item.+?href=\"(.+?)\" .+?>(.+?)</a> \(\d+\)' # '\" url nombre cantidad_entradas matches = re.compile(patronvideos).findall(data) scrapertools.printMatches(matches) for match in matches: # scrapedtitle = match[1]+" "+match[2] # scrapedurl = urlparse.urljoin(url,match[0]) # scrapedthumbnail = "" # scrapedplot = "" # if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "novedades" , category , match[1] , match[0] + "feed?paged=1" , "" , "") # 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 catlist(params,url,category): logger.info("[watchanimeon.py] catlist") # Descarga la página data = scrapertools.cachePage(url) # Extrae las categorias patron = '<a href="(\/\?genre[^"]+)">([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "catdetail" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 performsearch(texto): logger.info("[peliculasyonkis.py] performsearch") url = "http://www.peliculasyonkis.com/buscarPelicula.php?s=" + texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)"' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC resultados.append([ CHANNELNAME, "detailfolder", "buscador", scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot ]) return resultados
def searchresults2(params,url,category): logger.info("[cineadicto.py] SearchResult") # Descarga la p�gina data = scrapertools.cachePage(url) #print data # Extrae las entradas (carpetas) patronvideos = '<div class="poster">[^<]+<a href="([^"]+)"' # URL patronvideos += '><img src="([^"]+)" width=[^\/]+\/>' # TUMBNAIL patronvideos += '</a>[^<]+<[^>]+>[^<]+<[^>]+>[^<]+<a href="[^"]+">([^<]+)</a>' # TITULO matches = re.compile(patronvideos,re.DOTALL).findall(data) matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedurl = match[0] scrapedtitle =match[2] scrapedtitle = scrapedtitle.replace("–","-") scrapedtitle = scrapedtitle.replace(" "," ") scrapedthumbnail = match[1] scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # A�ade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detail" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # Propiedades 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 novedades(item): logger.info("[capitancinema.py] novedades") # Descarga la página data = scrapertools.cachePage(item.url) # Extrae las entradas (carpetas) patronvideos = '<td width="23\%"><a href="([^"]+)"[^>]+><img style="[^"]+" src="([^"]+)" border="0" alt="([^"]+)"[^>]+></a></td>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: # Atributos scrapedtitle = match[2] scrapedtitle = scrapedtitle.replace(""", "") scrapedtitle = scrapertools.entityunescape(scrapedtitle) scrapedurl = urlparse.urljoin(item.url, match[0]) scrapedthumbnail = urlparse.urljoin(item.url, match[1]) scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="mirrors", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, folder=True)) return itemlist
def ListadoTotal(params,url,category): logger.info("[peliculas24h.py] ListadoTotal") # Descarga la p�gina data = scrapertools.cachePage(url) #logger.info(data) # Patron de las entradas patron = "<a dir='ltr' href='([^']+)'>(.*?)</a>" matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # A�ade las entradas encontradas for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # A�ade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detail" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 parsewebcategorias(params, url, category): logger.info("[redestv.py] buscacategorias") data = scrapertools.cachePage( "http://www.redes-tv.com/index.php?option=com_xmap&sitemap=1&Itemid=31" ) #href='http://www.redestv.com/category/arte/' title="ARTE">ARTE</a></li><li><a #href="/index.php?option=com_content&view=category&layout=blog&id=1&Itemid=9" title="Biotecnolog\xc3\xada y Salud" patronvideos = "index.php." + url + '(.*?)</ul>' #patronvideos=patronvideos.replace("&","\&") #patronvideos=patronvideos.replace(";","\;") #patronvideos=patronvideos.replace("=","\=") #patronvideos=patronvideos.replace("_","\_") #logger.info(patronvideos) #logger.info("web"+data) matches = re.compile(patronvideos, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) if len(matches) > 0: #href="/index.php?option=com_content&view=article&id=65:473-farmacos-para-las-emociones&catid=1:biosalud&Itemid=9" title="473: Fármacos para las emociones" patronvideos = 'href="(.+?)" title="(.+?)"' matches1 = re.compile(patronvideos).findall(matches[0]) for i in range(len(matches1)): #xbmctools.addnewvideo( CHANNELNAME , "buscavideos" , category, matches1[i][1] , matches1[i][0] , "thumbnail" , "") xbmctools.addnewvideo(CHANNELNAME, "buscavideos", category, "redestv", matches1[i][1], matches1[i][0], "thumbnail", "") 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 busqueda(params, url, category): logger.info("busqueda") tecleado = "" keyboard = xbmc.Keyboard('') keyboard.doModal() if (keyboard.isConfirmed()): tecleado = keyboard.getText() if len(tecleado) <= 0: return tecleado = tecleado.replace(" ", "+") data = scrapertools.cachePagePost( "http://www.divxonline.info/buscador.html", 'texto=' + tecleado + '&categoria=0&tipobusqueda=1&Buscador=Buscar') #logger.info(data) data = data[data.find('Se han encontrado un total de'):] #<li><a href="/pelicula/306/100-chicas-2000/">100 chicas (2000)</a></li> patronvideos = '<li><a href="(.+?)">(.+?)</a></li>' matches = re.compile(patronvideos, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: xbmctools.addnewfolder(CHANNELNAME, "listmirrors", category, match[1], 'http://www.divxonline.info' + match[0], 'scrapedthumbnail', 'scrapedplot') 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 novedades(params, url, category): logger.info("[redestv.py] parseweb") # ------------------------------------------------------ # Descarga la página # ------------------------------------------------------ data = scrapertools.cachePage(url) #logger.info(data) #<div style="text-align: justify;">Cre?amos que el ser humano era el ?nico animal capaz de sentir empat?a. Sin embargo, el altruismo existe en muchos otros animales. Estar conectado con los dem?s, entenderlos y sentir su dolor no es exclusivo del ser humano. El prim?tologo Frans de Waal, gran estudiador de las emociones animales, habla con Punset sobre empat?a y simpat?a, capacidades clave para el ?xito en la vida social.</div><div class="jcomments-links"> <a href="/index.php?option=com_content&view=article&id=161:501-nuestro-cerebro-altruista&catid=2:cermen&Itemid=10#addcomments" class="comment-link">Escribir un comentario</a></div> patronvideos = '<td class="contentheading" width="100%">.+?<a href="(.+?)" class="contentpagetitle">\s+(\d+.+?)</a>' #patronvideos = '<div style="text-align: justify;">.+?</div>.+?<a href="(.+?)#' #logger.info("web"+data) matches = re.compile(patronvideos, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) #xbmctools.addnewfolder( CHANNELNAME , "buscavideos" , category, "redestv" , "http://www.redes-tv.com"+matches[0][0] , "" , "") #scrapertools.printMatches(matches) # patronvideos1 = 'src="http://www.megavideo.com/v/(.{8}).+?".+?></embed>.*?<p>(.+?)</p><div' # matches1 = re.compile(patronvideos1,re.DOTALL).findall(data) # if DEBUG: # scrapertools.printMatches(matches1) for i in range(len(matches)): xbmctools.addnewvideo(CHANNELNAME, "buscavideos", category, "redestv", matches[i][1], matches[i][0], "thumbnail", "") 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 episodelist(item): logger.info("[seriespepito.py] list") # Descarga la página data = scrapertools.cachePage(item.url) #logger.info(data) # Extrae el argumento patron = '<div class="contenido" id="noticia">.*?<span[^>]+>(.*?)</div>' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: scrapedplot = matches[0] scrapedplot = scrapertools.htmlclean(scrapedplot).strip() # Unas series están en utf-8, otras en iso-8859-1. Esta doble conversión funciona :) try: intermedia = unicode(scrapedplot, "utf-8", errors="replace").encode("iso-8859-1") intermedia = unicode(intermedia, "iso-8859-1", errors="replace").encode("utf-8") #print item.title+" encoding 1" scrapedplot = intermedia except: #print item.title+" encoding 2" scrapedplot = unicode(scrapedplot, "iso-8859-1", errors="replace").encode("utf-8") item.plot = scrapedplot else: scrapedplot = "" # Extrae los capítulos patron = "<li class='li_capitulo'><a class='capitulo1' href='([^']+)' title='[^']+'>([^<]+)</a> <img src='([^']+)'[^>]+></li>" matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: scrapedtitle = match[1] + " [" + match[2][49:-4] + "]" scrapedurl = match[0] scrapedthumbnail = item.thumbnail #scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Ajusta el encoding a UTF-8 scrapedtitle = unicode(scrapedtitle, "iso-8859-1", errors="replace").encode("utf-8") itemlist.append( Item(channel=CHANNELNAME, action="findvideos", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, show=item.show)) return itemlist
def paises(params,url,category): xbmc.output("[delicast.py] paises") # -------------------------------------------------------- # Descarga la página # -------------------------------------------------------- data = scrapertools.cachePage(url) #xbmc.output(data) # -------------------------------------------------------- # Extrae los paises # -------------------------------------------------------- patron = '<a class=v href=([^>]+)>([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1].strip() scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELCODE , "videos" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 searchresults(params,Url,category): logger.info("[peliculasyonkis.py] searchresults") buscador.salvar_busquedas(params,Url,category) url = "http://www.peliculasyonkis.com/buscarPelicula.php?s="+Url.replace(" ", "+") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) #<li> <a href="http://www.peliculasyonkis.com/pelicula/las-edades-de-lulu-1990/" title="Las edades de Lulú (1990)"><img width="77" height="110" src="http://images.peliculasyonkis.com/thumbs/las-edades-de-lulu-1990.jpg" alt="Las edades de Lulú (1990)" align="right" /> patronvideos = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot ) # 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 allvideolist(item): logger.info("[documentalesyonkis.py] allvideolist") # Descarga la página data = scrapertools.cachePage(item.url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src=\"([^\"]+)\"[^>]+\/>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: try: scrapedtitle = unicode(match[1], "utf-8").encode("iso-8859-1") except: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="findvideos", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot)) return itemlist
def catlist(item): # Descarga la página data = scrapertools.downloadpageGzip(item.url) #logger.info(data) # Extrae las entradas (carpetas) <a class="accion linkFader" href="../accion-1.html"></a> patronvideos = '<a class="([^"]+)" href="([^"]+)"></a>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: scrapedtitle = match[0].replace("linkFader", "").strip() scrapedurl = urlparse.urljoin(item.url, match[1]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="newlist", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot)) return itemlist
def getmegauploadvideo(code, user): req = urllib2.Request("http://www.megaupload.com/?d=" + code) 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' ) req.add_header('Cookie', 'l=es; user='******'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() #if DEBUG: # xbmc.output("[megaupload.py] data=#"+data+"#") patronvideos = '<div.*?id="downloadlink">[^<]+<a href="([^"]+)"' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) mediaurl = "" if len(matches) > 0: mediaurl = matches[0] return mediaurl
def scrapvideoURL(urlSY): data = scrapertools.cachePage(urlSY) patronvideos = 'href="http://www.seriesyonkis.com/player/visor_([^\.]+).php.*?id=([^"]+)".*?alt="([^"]+)".*?' patronvideos += '<td><div[^>]+><[^>]+>[^<]+</span></div></td>[^<]+<td><div[^>]+><[^>]+>[^<]+</span></div></td>[^<]+' patronvideos += '<td><div[^>]+><[^>]+>(.*?)</tr>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) id="" if len(matches)==0: xbmctools.alertnodisponible() return "" elif len(matches)==1: #print matches[0][1] if matches[0][0] == "svueno": id = matches[0][1] logger.info("[seriesyonkis.py] id="+id) dec = Yonkis.DecryptYonkis() id = dec.decryptALT(dec.charting(dec.unescape(id))) id = "http://stagevu.com/video/" + id elif matches[0][0] in ["pymeno2","pymeno3","pymeno4","pymeno5","pymeno6"]: cortar = matches[0][1].split("&") id = cortar[0] logger.info("[seriesyonkis.py] id="+id) dec = Yonkis.DecryptYonkis() id = dec.decryptID_series(dec.unescape(id)) else:pass print 'codigo :%s' %id return id else: id = choiceOne(matches) if len(id)==0:return "" print 'codigo :%s' %id return id
def recomendadas(params, url, category): logger.info("[descargapelis.py] movielist") logger.info(category) data = scrapertools.cachePage(url) if (category == "descargapelis"): #xbmctools.addnewfolder( CHANNELNAME , "recomendadas" , "todas" , "Todas" , url , "todas", "" ) xbmctools.addnewfolder(CHANNELNAME, "recomendadas", "todas", "Todas", url, "", "") patron = 'PELICULAS DE .+?>(.+?)</a>' #<td align="center" colspan="3" height="25" class="titulo_peli"><a title="megaupload peliculas descarga directa español" href="p408noche-y-dia.php" class="titulo_peli">Noche y dia<br /><br /><img class="foto_prin" src="http://www.bestwebmaker.com/blog/wp-content/uploads/2010/08/Noche-Y-Dia-2010.jpg" width="135" height="195" alt="Noche y dia descarga directa megaupload" title="Noche y dia" /><br /><br /></a></td> #class="titulo_peli"><a href="p404origen-inception.php" class="titulo_peli">Origen Inception</a></td> #xbmc.output(url + "es la url") #url=url[0:url.index(".net/")+5] #patron += '<div class="covershot[^<]+' #patron += '<a href="([^"]+)"[^<]+<img src="([^"]+)"[^<]+</a>[^<]+' #patron += '</div>[^<]+' #patron += '<div class="post-title">[^<]+' #patron += '<h3><a[^<]+>(.*?)</a>' matches = re.compile(patron, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: xbmctools.addnewfolder(CHANNELNAME, "recomendadas", match, match, url, "", "") else: url = url[0:url.index(".net/") + 5] if category != "todas": data = data[data.index(category):data. index("PHP***", data.index(category))] logger.info(data) patron = '<td align=".+?" colspan="\d+" valign="top" height="\d+" width="\d+"><a href="(.+?)" class="titulo_peli"><img class="foto_prin" width="\d+" height="\d+" src="(.+?)" title="(.+?)"' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: for match in matches: #scrapedtitle = match[1] #scrapedtitle = scrapedtitle.replace("<span class=\'smallTitle'>","(") #scrapedtitle = scrapedtitle.replace("</span>",")") #scrapedurl = url + match[0] #scrapedthumbnail = "" #scrapedplot = match[1] #if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "detail", category, match[2], url + match[0], match[1], "") # ------------------------------------------------------ # Extrae la página siguiente # ------------------------------------------------------ # 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 novedades(params,url,category): logger.info("[capitancinema.py] novedades") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<td width="23\%"><a href="([^"]+)"[^>]+><img style="[^"]+" src="([^"]+)" border="0" alt="([^"]+)"[^>]+></a></td>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedtitle = match[2] scrapedtitle = scrapedtitle.replace(""","") scrapedtitle = scrapertools.entityunescape(scrapedtitle) scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = urlparse.urljoin(url,match[1]) scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "mirrors" , 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 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 airinglist(params,url,category): logger.info("[watchanimeon.py] airinglist") # Descarga la página data = scrapertools.cachePage(url) # Extrae las categorias patron = '<div class="btm-sidebar">(.*?)</div>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: data = matches[0] patron = '<li><span class="[^"]+">([^<]+)</span> <a href="([^"]+)">([^<]+)</a></li>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = match[2].strip() + " ("+match[0]+")" scrapedurl = urlparse.urljoin(url,match[1]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detallecapitulo" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 CategoryList(params,url,category): logger.info("[delatv.py] CategoryList") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) patronvideos = '<div class="titulo">Generos</div>(.*?)</div>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Patron de las entradas patronvideos = '<a href="([^"]+)"[^>]+' # URL patronvideos += ">(.+?)<" # TITULO matches = re.compile(patronvideos,re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) # Añade las entradas encontradas for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "novedades" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 newlist(params,url,category): logger.info("[watchanimeon.py] newlist") # Descarga la página data = scrapertools.cachePage(url) # Extrae las categorias #<div class="newpostz"><div class="newposts"><img src="http://www.watchanimeon.com/images/thumbs/75.jpg" alt="series" /><ul><li> #<a href="http://www.watchanimeon.com/naruto-shippuden-episode-126/">Naruto Shippuden Episode 126</a></li></ul> #<span><em>More Episodes:</em> <a href="http://www.watchanimeon.com/anime/naruto-shippuden/">Naruto Shippuden</a></span><span><em>Date Published </em>September 4th, 2009</span></div><div class="clear"></div></div> patron = '<div class="newpostz"><div class="newposts"><img src="([^"]+)"[^>]+><ul><li>' patron += '<a href="([^"]+)">([^<]+)</a></li></ul>' patron += '<span><em>More Episodes.</em> <a href="([^"]+)">([^<]+)</a></span><span><em>Date Published </em>([^<]+)</span></div><div class="clear"></div></div>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = match[2]+" ("+match[5]+")" scrapedurl = urlparse.urljoin(url,match[1]) scrapedthumbnail = urlparse.urljoin(url,match[0]) scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detallecapitulo" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 performsearch(texto): logger.info("[yotix.py] performsearch") url = "http://yotix.tv/?s="+texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<div class="galleryitem">[^<]+' patronvideos += '<h1><a title="([^"]+)"[^<]+</a></h1>[^<]+' patronvideos += '<a href="([^"]+)"><img src="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: # Atributos scrapedtitle = match[0].replace("–","-") scrapedurl = match[1] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC resultados.append( [CHANNELNAME , "listmirrors" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] ) return resultados
def episodios(item): ''' <div class="title"> <a class="bold" href="/series/geronimo-stilton/temporada-1/capitulo-5/">Geronimo Stilton 1x05 </a></div> ''' logger.info("[cinetube.py] episodios") itemlist = [] # Descarga la página data = scrapertools.cachePage(item.url) # Busca los episodios patronvideos = '<div class="title"> <a class="bold" href="([^"]+)">([^<]+)</a></div>' matches = re.compile(patronvideos,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1].strip() scrapedurl = urlparse.urljoin(item.url,match[0]) scrapedthumbnail = item.thumbnail scrapedplot = item.plot if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") itemlist.append( Item(channel=CHANNELNAME, action="findvideos", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail, plot=scrapedplot) ) return itemlist
def LastSearch(params, url, category): logger.info("[nolomires.py] LastSearch") # Descarga la p�gina data = scrapertools.cachePage(url) # logger.info(data) # Patron de las entradas patronvideos = '<li><a href="([^"]+)" ' # URL patronvideos += 'title="([^"]+)" >[^<]+' # TITULO patronvideos += "</a></li>" # Basura matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) # A�ade las entradas encontradas for match in matches: # Atributos scrapedtitle = acentos(match[1]) scrapedtitle = scrapedtitle.replace("online", "").replace("ver ", "") scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if DEBUG: logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # A�ade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME, "listvideos", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot ) # 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 listcategorias(params,url,category): xbmc.output("[yotix.py] listcategorias") # ------------------------------------------------------ # Descarga la página # ------------------------------------------------------ data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------ # Extrae las entradas de la home como carpetas # ------------------------------------------------------ patron = '<a href="(/categoria/[^"]+)">([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "videolist" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 listageneros(params,url,category): xbmc.output("[meristation.py] listaporgenero") # -------------------------------------------------------- # Descarga la página # -------------------------------------------------------- data = scrapertools.cachePage(url) #xbmc.output(data) # -------------------------------------------------------- # Extrae las categorias (carpetas) # -------------------------------------------------------- patron = '<option value="([^"]+)">([^<]+)</option>' matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1].replace(" ","").strip() scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC #addvideo( scrapedtitle , scrapedurl , category ) xbmctools.addnewfolder( CHANNELCODE , "letraresults" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # 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 busqueda(params,url,category): logger.info("busqueda") tecleado = "" keyboard = xbmc.Keyboard('') keyboard.doModal() if (keyboard.isConfirmed()): tecleado = keyboard.getText() if len(tecleado)<=0: return tecleado = tecleado.replace(" ", "+") data=scrapertools.cachePagePost("http://www.divxonline.info/buscador.html",'texto=' + tecleado + '&categoria=0&tipobusqueda=1&Buscador=Buscar') #logger.info(data) data=data[data.find('Se han encontrado un total de'):] #<li><a href="/pelicula/306/100-chicas-2000/">100 chicas (2000)</a></li> patronvideos = '<li><a href="(.+?)">(.+?)</a></li>' matches = re.compile(patronvideos,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: xbmctools.addnewfolder( CHANNELNAME , "listmirrors" , category , match[1] , 'http://www.divxonline.info' + match[0] , 'scrapedthumbnail', 'scrapedplot' ) 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 addvideopage(data,params,url,category): # Pone el enlace para continuar con la siguiente página # La URL tiene el id de vídeo de youtube: http://www.totlol.com/watch/Bxu3jfqpItE/Pocoyo-Dance/0/ patron = '<table id="videoitem[^"]+" class="videoitem basic"><tr>[^<]+' patron += '<td class="thumb">[^<]+' patron += '<div class="videothumb smallthumb">[^<]+' patron += '<a href="([^"]+)"><img.*?src="([^"]+)".*?' patron += '<div class="title"><a.*?>([^<]+)</a></div>[^<]+' patron += '<span class="info">Runtime\:</span>([^<]+)<.*?' patron += '<span class="info">Language\:</span>([^<]+)<' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo scrapedtitle = match[2]+' ('+match[3].strip()+') ('+match[4].strip()+')' # URL scrapedurl = urlparse.urljoin(url,match[0]) # Thumbnail scrapedthumbnail = urlparse.urljoin(url,match[1]) # Argumento scrapedplot = "" # Depuracion if (DEBUG): try: xbmc.output("scrapedtitle="+scrapedtitle) except: xbmc.output("scrapedtitle=<unicode>") xbmc.output("scrapedurl="+scrapedurl) xbmc.output("scrapedthumbnail="+scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewvideo( CHANNELNAME , "play" , category , "youtube" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )
def performsearch(texto): logger.info("[tutvsite.py] performsearch") url = "http://www.tu.tv/buscar/?str="+texto # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<div class="fila clearfix">[^<]+<div.*?</div>[^<]+<a href="([^"]+)"[^<]+<img src="([^"]+)".*?<span id="txtN">(.*?)</span>.*?<span class="tmp">([^<]+)</span.*?<span id="txtN">(.*?)</span>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: # Titulo try: scrapedtitle = unicode( match[2], "utf-8" ).encode("iso-8859-1") except: scrapedtitle = match[2] scrapedtitle = scrapedtitle.replace("<b>","") scrapedtitle = scrapedtitle.replace("</b>","") scrapedtitle = scrapedtitle.strip() scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = urlparse.urljoin(url,match[1]) scrapedplot = match[4].strip() if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC resultados.append( [CHANNELNAME , "playfolder" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] ) return resultados
def play(params,url,category): xbmc.output("[totlolchannel.py] play") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = urllib.unquote_plus( params.get("plot") ) server = urllib.unquote_plus( params.get("server") ) # Abre dialogo dialogWait = xbmcgui.DialogProgress() dialogWait.create( xbmc.getLocalizedString( 30702 ), title , plot ) # Busca el id del vídeo # La URL tiene el id de vídeo de youtube: http://www.totlol.com/watch/Bxu3jfqpItE/Pocoyo-Dance/0/ patron = 'http\:\/\/www.totlol.com\/watch\/([^\/]+)/' matches = re.compile(patron,re.DOTALL).findall(url) scrapertools.printMatches(matches) if len(matches)>0: video_id = matches[0] url = youtube.geturl(video_id) listitem = xbmcgui.ListItem( title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail ) listitem.setInfo( "video", { "Title": title, "Plot": plot } ) # Cierra dialogo dialogWait.close() del dialogWait # Play video with the proper core xbmc.Player().play( url, listitem )
def detail(params,url,category): xbmc.output("[peliculasyonkis.py] detail") 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) #xbmc.output(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ patronvideos = 'href="http://www.peliculasyonkis.com/player/visor_pymeno2.*?id=([^&]+)&al=[^"]+"' matches = re.compile(patronvideos,re.DOTALL).findall(data) if len(matches)>0: scrapertools.printMatches(matches) id = matches[0] xbmc.output("[peliculasyonkis.py] id="+id) dec = Yonkis.DecryptYonkis() url = dec.decryptID(dec.unescape(id)) if ":" in url: match = url.split(":") url = choiceOne(match) if url == "": return print 'codigo :%s' %url else: xbmctools.alertnodisponible() return xbmctools.playvideo(CHANNELNAME,"Megavideo",url,category,title,thumbnail,plot)
def peliscat(item): logger.info("[cine15.py] peliscat") # Descarga la página data = scrapertools.cachePage(item.url) # Extrae las entradas (carpetas) patronvideos = '<li class="cat-item cat-item[^"]+"><a href="([^"]+)" title="[^"]+">([^<]+)</a>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) itemlist = [] for match in matches: scrapedtitle = match[1] scrapedurl = urlparse.urljoin(item.url, match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") itemlist.append( Item(channel=CHANNELNAME, action="listvideos", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, folder=True)) return itemlist
def searchresults(params,url,category): xbmc.output("[peliculasyonkis.py] searchresults") if xbmctools.getPluginSetting("forceview")=="true": xbmc.executebuiltin("Container.SetViewMode(53)") #53=icons # Descarga la página data = scrapertools.cachePage(url) #xbmc.output(data) # Extrae las entradas (carpetas) #<li> <a href="http://www.peliculasyonkis.com/pelicula/las-edades-de-lulu-1990/" title="Las edades de Lulú (1990)"><img width="77" height="110" src="http://images.peliculasyonkis.com/thumbs/las-edades-de-lulu-1990.jpg" alt="Las edades de Lulú (1990)" align="right" /> patronvideos = '<li> <a href="([^"]+)" title="([^"]+)"><img.*?src="([^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = match[2] scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") xbmctools.addnewvideo( CHANNELNAME , "detail" , category , "Megavideo" , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot ) # 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 peliscat(params, url, category): logger.info("[cine15.py] peliscat") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<li class="cat-item cat-item[^"]+"><a href="([^"]+)" title="[^"]+">([^<]+)</a>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url, match[0]) scrapedthumbnail = "" scrapedplot = "" if DEBUG: logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME, "listvideos", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot ) # Propiedades 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 peliscat(item): logger.info("[cinegratis.py] peliscat") url = item.url itemlist = [] itemlist.append( Item(channel=CHANNELNAME, action="listsimple" , title="Versión original" , url="http://www.cinegratis.net/index.php?module=search&title=subtitulado")) itemlist.append( Item(channel=CHANNELNAME, action="listsimple" , title="Versión latina" , url="http://www.cinegratis.net/index.php?module=search&title=latino")) # Descarga la página data = scrapertools.cachePage(url) # Extrae los items patronvideos = "<td align='left'><a href='([^']+)'><img src='([^']+)' border='0'></a></td>" matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos patron2 = "genero/([A-Za-z\-]+)/" matches2 = re.compile(patron2,re.DOTALL).findall(match[0]) scrapertools.printMatches(matches2) scrapedtitle = matches2[0] scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = urlparse.urljoin(url,match[1]) scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") itemlist.append( Item(channel=CHANNELNAME, action="listvideos" , title=scrapedtitle , url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot)) return itemlist
def mainlist(params,url,category): logger.info("[ovasid.py] mainlist") if url=="": url="http://www.ovasid.com/" # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patron = '<div class="item">[^<]+' patron += '<div class="background"></div>[^<]+' patron += '<a href="([^"]+)" ><img class="imgl" src="([^"]+)"/></a>[^<]+' patron += '<div class="content">[^<]+' patron += '<h1>([^<]+)</h1>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[2] scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = urlparse.urljoin(url,match[1]) scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detail" , 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 performsearch(texto): logger.info("[cinegratis.py] performsearch") url = "http://www.cinegratis.net/index.php?module=search&title="+texto # Descarga la página data = scrapertools.cachePage(url) # Extrae los items patronvideos = "<a href='(index.php\?module\=player[^']+)'[^>]*>(.*?)</a>" matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) resultados = [] for match in matches: # Atributos scrapedtitle = match[1] scrapedtitle = scrapedtitle.replace("<span class='style4'>","") scrapedtitle = scrapedtitle.replace("</span>","") scrapedurl = urlparse.urljoin(url,match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC resultados.append( [CHANNELNAME , "findvideos" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] ) return resultados
def fulllist(params, url, category): logger.info("[veranime.py] fulllist") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Patron de las entradas #<li><a href="http://ver-anime.net/07-ghost/"><span>07 Ghost</span></a></li> #patron = '<li><a title="[^"]+" href="([^"]+)">([^<]+)</a></li>' patron = '<li><a href="(http://ver-anime.net/[^"]+)"><span>([^<]+)</span></a></li>' matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) # Añade las entradas encontradas for match in matches: # Atributos scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url, match[0]) scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "listmirrors", category, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # 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)