def MostWatched(params, url, category): logger.info("[nolomires.py] MostWatched") # 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>' # Cantidad de Vistos 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] + match[2]) scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # A�ade al listado de XBMC xbmctools.addnewfolder(__channel__, "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 listaseries(params,url,category): logger.info("[sonolatino.py] listaseries") #url2 = "http://www.sonolatino.com/index.html" data = scrapertools.cachePage(url) patron = "Relacionadas</h4>(.*?)</ul>" matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: patron = '<a href="([^"]+)">([^<]+)</a>' matches2 = re.compile(patron,re.DOTALL).findall(matches[0]) scrapedplot = "" scrapedthumbnail= "" if len(matches)>0: for match in matches2: scrapedtitle = acentos(match[1]) print match[0] scrapedurl = match[0][:-18] print scrapedurl if (DEBUG): logger.info("scrapedtitle="+scrapedtitle) logger.info("scrapedurl="+scrapedurl) logger.info("scrapedthumbnail="+scrapedthumbnail) # A�ade al listado de XBMC xbmctools.addnewfolder( __channel__ , "listatipodocumental" , category , 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 Videosnuevoslist(params,url,category): logger.info("[sonolatino.py] VideoesNuevos") # Descarga la p�gina data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<tr><td.*?<a href="([^"]+)">' patronvideos += '<img src="([^"]+)" ' patronvideos += 'alt="[^"]+".*?' patronvideos += 'width="250">([^<]+)<' patronvideos += 'td class.*?<a href="[^>]+>([^<]+)</a></td><td class.*?>([^<]+)</td></tr>' matches = re.compile(patronvideos,re.DOTALL).findall(data) #logger.info("matches = "+str(matches)) if DEBUG: scrapertools.printMatches(matches) for match in matches: # Titulo # Titulo scrapedtitle = match[2] + " - " + match[3]+" - " + match[4].replace('í','i') print scrapedtitle scrapedtitle = scrapertools.unescape(scrapedtitle) # URL scrapedurl = match[0] # Thumbnail scrapedthumbnail = match[1] imagen = "" # procesa el resto scrapedplot = match[3] tipo = match[3] # Depuracion if (DEBUG): logger.info("scrapedtitle="+scrapedtitle) logger.info("scrapedurl="+scrapedurl) logger.info("scrapedthumbnail="+scrapedthumbnail) # A�ade al listado de XBMC #xbmctools.addthumbnailfolder( __channel__ , scrapedtitle, scrapedurl , scrapedthumbnail, "detail" ) xbmctools.addnewfolder( __channel__ , "detail" , category , scrapedtitle ,scrapedurl , scrapedthumbnail , scrapedplot ) # Busca enlaces de paginas siguientes... cat = "nuevo" patronvideo = patronvideos paginasiguientes(patronvideo,data,category,cat) # 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 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( __channel__ , "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 buscartrailer(params,url,category): print "[trailertools.py] Modulo: buscartrailer()" thumbnail = "" solo = "false" videotitle = title = urllib.unquote_plus( params.get("title") ).strip() if ":]" in videotitle: solo = "true" videotitle = re.sub("\[[^\]]+\]","",videotitle).strip() if config.get_localized_string(30110) in videotitle: #"Buscar trailer para" videotitle = videotitle.replace(config.get_localized_string(30110),"").strip() if config.get_localized_string(30111) in videotitle: #"Insatisfecho?, busca otra vez : " videotitle = videotitle.replace(config.get_localized_string(30111),"").strip() listavideos = GetTrailerbyKeyboard(videotitle.strip(),category) else: listavideos = gettrailer(videotitle.strip().strip(),category,solo) if len(listavideos)>0: for video in listavideos: titulo = video[1] url = video[0] thumbnail = video[2] duracion = video[3] xbmctools.addnewvideo( "trailertools" , "youtubeplay" , category , "youtube" , titulo , url , thumbnail , "Ver Video","",duracion ) xbmctools.addnewfolder( CHANNELNAME , "buscartrailer" , category , config.get_localized_string(30111)+" "+videotitle , url , os.path.join(IMAGES_PATH, 'trailertools.png'), "" ) #"Insatisfecho?, busca otra vez : " # 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 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( __channel__ , "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 mainlist(params, url, category): logger.info("[veocine.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder(__channel__, "videolist", "", "Peliculas", "http://www.veocine.es/peliculas.html", "", "") xbmctools.addnewfolder(__channel__, "videolist", "", "Documentales", "http://www.veocine.es/documentales.html", "", "") xbmctools.addnewfolder(__channel__, "videolist", "", "Peliculas infantiles", "http://www.veocine.es/infantil.html", "", "") xbmctools.addnewfolder(__channel__, "videolist", "", "Peliculas VOS", "http://www.veocine.es/peliculavos.html", "", "") xbmctools.addnewfolder(__channel__, "videolist", "", "Anime", "http://www.veocine.es/anime.html", "", "") # 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 videolist(params, url, category): xbmc.log("[skai_folders.py] videolist") # -------------------------------------------------------- # DDownload page # -------------------------------------------------------- data = scrapertools.cachePage(url) # Extrae los vídeos patron = '<p><a href=\'(.*?)\' title=.*?<img alt="([^<]+)" src="(.*?)" /></a></p>' matches = re.compile(patron, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = urlparse.urljoin(url, unescape(match[0])) scrapedthumbnail = urlparse.urljoin(url, match[2]) # scrapedplot = scrapertools.entityunescape(match[2]) scrapedplot = "XXX XXXX XXXXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXXX X X XXX X X X X X X X X X" if DEBUG: xbmc.log("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Add to the list of XBMC xbmctools.addnewvideo( CHANNELCODE, "play", CHANNELNAME, "", scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot ) # Next Page pattern = 'class="next_page" rel="next" href="(.*?)">Επόμενη</a></p>' matches = re.compile(pattern, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) if len(matches) > 0: match = matches[0] scrapedtitle = ">>> Next Page >>>" scrapedurl = urlparse.urljoin(url, match) scrapedthumbnail = "" scrapedplot = "" if DEBUG: xbmc.log("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Add to the list of XBMC xbmctools.addnewfolder( CHANNELCODE, "videolist", 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 searchresults(params,url="",category=""): import xbmc import xbmcgui import xbmcplugin from platformcode.xbmc import xbmctools logger.info("[buscador.py] searchresults") salvar_busquedas(params,url,category) if url == "" and category == "": tecleado = params.url else: tecleado = url tecleado = tecleado.replace(" ", "+") # Lanza las búsquedas matches = [] itemlist = do_search_results(tecleado) for item in itemlist: targetchannel = item.channel action = item.action category = category scrapedtitle = item.title+" ["+item.channel+"]" scrapedurl = item.url scrapedthumbnail = item.thumbnail scrapedplot = item.plot xbmctools.addnewfolder( targetchannel , action , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot, show=item.show ) # Cierra el directorio xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_TITLE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def searchresults(params,url,category): logger.info("[pelisflv.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( __channel__ , "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 TagList(params,url,category): logger.info("[nolomires.py] TagList") # Descarga la p�gina data = scrapertools.cachePage(url) #logger.info(data) # Patron de las entradas patronvideos = "<a href='([^']+)' class='[^']+' title='[^']+' style='[^']+'" # URL patronvideos += ">([^<]+)</a>" # TITULO 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]) scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # A�ade al listado de XBMC xbmctools.addnewfolder( __channel__ , "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 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( __channel__ , "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 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 searchresults(params,url="",category=""): import xbmc import xbmcgui import xbmcplugin from platformcode.xbmc import xbmctools logger.info("[buscador.py] searchresults") salvar_busquedas(params,url,category) if url == "" and category == "": tecleado = params.url else: tecleado = url tecleado = tecleado.replace(" ", "+") # Lanza las busquedas matches = [] itemlist = do_search_results(tecleado) for item in itemlist: targetchannel = item.channel action = item.action category = category scrapedtitle = item.title+" ["+item.channel+"]" scrapedurl = item.url scrapedthumbnail = item.thumbnail scrapedplot = item.plot xbmctools.addnewfolder( targetchannel , action , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot, show=item.show ) # Cierra el directorio xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_TITLE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def search(params,url,category): logger.info("[Vagos.py] search") keyboard = xbmc.Keyboard('') keyboard.doModal() xbmctools.addnewfolder( __channel__ , "search", "" , "Buscador...","http://compras.vagos.es/share-cgi/search.ftcb","","") if (keyboard.isConfirmed()): tecleado = keyboard.getText() if len(tecleado)>0: #convert to HTML tecleado = tecleado.replace(" ", "+") data = Search(tecleado) # Extrae las entradas (carpetas) patron = '<a href="([^"]+)" id="thread_title_([^"]+)">([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) for match in matches: # Atributos scrapedurl = BASEURL + match[0] scrapedtitle = match[2] scrapedthumbnail = "" scrapedplot = "" xbmctools.addnewfolder( __channel__ , "SerieScan" , 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(params,url,category): logger.info("[peliculas21.py] peliscat") # Descarga la página data = scrapertools.cachePage(url) # Extrae los Géneros de las Peliculas patronvideos = '<div id="textidgenero">Género:</div>(.*?)</select>' matches = re.compile(patronvideos,re.DOTALL).findall(data) patronvideos = '<option value="([^"]+)" >([^<]+)</option>' matches1 = re.compile(patronvideos,re.DOTALL).findall(matches[0]) for match in matches1: #http://www.peliculas21.com/ajaxs/ajax_periodos.php?valor=&periodo=0&idgenero=5&idactor=0&listado_style=2&pagina=&periodos_ajax=&valorperiodo=4&num_ale=0.5685049552958528 url = "http://www.peliculas21.com/ajaxs/ajax_periodos.php?valor=&periodo=0&idgenero=%s&idactor=0&listado_style=2&pagina=&periodos_ajax=&valorperiodo=4" %match[0] genero = match[1] xbmctools.addnewfolder( __channel__ , "listsimpleMirror" , category , genero ,url,"","") # 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 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( __channel__ , "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 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( __channel__ , "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 mainlist(params, url, category): xbmc.log("[skai_folders.py] mainlist") url = "http://folders.skai.gr/main" locale = "el" url_loc = url + "?locale=" + locale # -------------------------------------------------------- # Download page # -------------------------------------------------------- data = scrapertools.cachePage(url_loc) #xbmc.log(data) # -------------------------------------------------------- # Extrae los programas # -------------------------------------------------------- pattern = '<p class="title"><a href="(.*?)" title="Δείτε.*?Φάκελοι»">([^<]+)</a></p>' matches = re.compile(pattern, re.DOTALL).findall(data) if DEBUG: print 'matches are: ...............' print matches scrapertools.printMatches(matches) for match in matches: scrapedtitle = unescape(match[1]) try: scrapedtitle = unicode(scrapedtitle, "UTF-8", "ignore").encode("UTF-8") except: pass scrapedurl = urlparse.urljoin(url, unescape(match[0])) scrapedthumbnail = "" scrapedplot = "" # purification if (DEBUG): xbmc.log("scrapedtitle=" + scrapedtitle) xbmc.log("scrapedurl=" + scrapedurl) xbmc.log("scrapedthumbnail=" + scrapedthumbnail) #Add to the list of XBMC xbmctools.addnewfolder(CHANNELCODE, "videolist", 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 mainlist(params, url, category): xbmc.log("[skai_folders.py] mainlist") url = "http://folders.skai.gr/main" locale = "el" url_loc = url + "?locale=" + locale # -------------------------------------------------------- # Download page # -------------------------------------------------------- data = scrapertools.cachePage(url_loc) # xbmc.log(data) # -------------------------------------------------------- # Extrae los programas # -------------------------------------------------------- pattern = '<p class="title"><a href="(.*?)" title="Δείτε.*?Φάκελοι»">([^<]+)</a></p>' matches = re.compile(pattern, re.DOTALL).findall(data) if DEBUG: print "matches are: ..............." print matches scrapertools.printMatches(matches) for match in matches: scrapedtitle = unescape(match[1]) try: scrapedtitle = unicode(scrapedtitle, "UTF-8", "ignore").encode("UTF-8") except: pass scrapedurl = urlparse.urljoin(url, unescape(match[0])) scrapedthumbnail = "" scrapedplot = "" # purification if DEBUG: xbmc.log("scrapedtitle=" + scrapedtitle) xbmc.log("scrapedurl=" + scrapedurl) xbmc.log("scrapedthumbnail=" + scrapedthumbnail) # Add to the list of XBMC xbmctools.addnewfolder( CHANNELCODE, "videolist", 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 listvideofeeds(params,url,category): logger.info("[pelisflv.py] listvideosfeeds") data = None thumbnail = "" xmldata = urllib2.urlopen(url,data) xmldoc = minidom.parse(xmldata) xmldoc.normalize() #print xmldoc.toxml().encode('utf-8') xmldata.close() c = 0 plot = "" for entry in xmldoc.getElementsByTagNameNS(ATOM_NS, u'entry'): #First title element in doc order within the entry is the title entrytitle = entry.getElementsByTagNameNS(ATOM_NS, u'title')[0] entrylink = entry.getElementsByTagNameNS(ATOM_NS, u'link')[2] entrythumbnail = entry.getElementsByTagNameNS(ATOM_NS, u'content')[0] etitletext = get_text_from_construct(entrytitle) elinktext = entrylink.getAttributeNS(EMPTY_NAMESPACE, u'href') ethumbnailtext = get_text_from_construct(entrythumbnail) regexp = re.compile(r'src="([^"]+)"') match = regexp.search(ethumbnailtext) if match is not None: thumbnail = match.group(1) regexp = re.compile(r'bold;">([^<]+)<') match = regexp.search(ethumbnailtext) if match is not None: plot = match.group(1) print ethumbnailtext # Depuracion if (DEBUG): logger.info("scrapedtitle="+etitletext) logger.info("scrapedurl="+elinktext) logger.info("scrapedthumbnail="+thumbnail) #print etitletext, '(', elinktext, thumbnail,plot, ')' xbmctools.addnewfolder( __channel__ , "detail" , category , etitletext, elinktext, thumbnail, plot ) c +=1 if c >= 25: regexp = re.compile(r'start-index=([^\&]+)&') match = regexp.search(url) if match is not None: start_index = int(match.group(1)) + 25 scrapedtitle = "P�gina siguiente" scrapedurl = "http://www.blogger.com/feeds/3207505541212690627/posts/default?start-index="+str(start_index)+"&max-results=25" scrapedthumbnail = "" scrapedplot = "" xbmctools.addnewfolder( __channel__ , "listvideofeeds" , category , 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 list(params, url, category): logger.info("[seriesonline.py] list") 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) # Extrae las entradas patronvideos = '<a.*?href="(/serie-divx/[^"]+)"' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = title + "(Ver online)" scrapedurl = urlparse.urljoin(url, match) scrapedthumbnail = thumbnail scrapeddescription = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "detail", CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, scrapeddescription) # Extrae las entradas patronvideos = '<a.*?href="(/descarga-directa/[^"]+)"' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = title + "(Descarga directa)" scrapedurl = urlparse.urljoin(url, match) scrapedthumbnail = thumbnail scrapeddescription = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "detail", CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, scrapeddescription) # 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 searchresults2(params,url,category): logger.info("[sonolatino.py] searchresults") # Descarga la p�gina data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<li class="video">[^<]+<div class="video_i">[^<]+<a href="([^"]+)">' patronvideos += '[^<]+<img src="([^"]+)" ' patronvideos += 'alt="([^"]+)"[^>]+><div class="tag".*?</div>.*?' patronvideos += '<span class="artist_name">([^<]+)</span>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo scrapedtitle = acentos(match[2]) # URL scrapedurl = match[0] # Thumbnail scrapedthumbnail = match[1] # procesa el resto scrapedplot = match[3] # Depuracion if (DEBUG): logger.info("scrapedtitle="+scrapedtitle+" - "+scrapedplot) logger.info("scrapedurl="+scrapedurl) logger.info("scrapedthumbnail="+scrapedthumbnail) # A�ade al listado de XBMC xbmctools.addnewfolder( __channel__ , "detail" , category , scrapedtitle + " - " + scrapedplot , scrapedurl , scrapedthumbnail , scrapedplot ) #llama a la rutina paginasiguiente cat = 'busca' paginasiguientes(patronvideos,data,category,cat) # 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 mainlist(params,url,category): logger.info("[watchanimeon.py] mainlist") # Menu principal xbmctools.addnewfolder( __channel__ , "newlist" , category , "Novedades" ,"http://www.watchanimeon.com/","","") xbmctools.addnewfolder( __channel__ , "airinglist" , category , "Series en curso" ,"http://www.watchanimeon.com/","","") xbmctools.addnewfolder( __channel__ , "catlist" , category , "Series por categoría" ,"http://www.watchanimeon.com/","","") xbmctools.addnewfolder( __channel__ , "alphaserieslist" , category , "Series por orden alfabético" ,"http://www.watchanimeon.com/anime-list/","","") xbmctools.addnewfolder( __channel__ , "allmovieslist" , category , "Todas las películas" ,"http://www.watchanimeon.com/anime/anime-movies/","","") # Asigna el título, desactiva la ordenación, y 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 novedadeslist(params, url, category): logger.info("[seriesonline.py] mainlist") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<table class="titulo" id="naranja" cellpadding="0" cellspacing="0">[^<]+' patronvideos += '<tr>[^<]+' patronvideos += '<td width="7"><img src="/imagenes/menu_s_iz.gif" width="100." height="20" alt="" /></td>[^<]+' patronvideos += '<td class="tit">([^<]+)</td>[^<]+' patronvideos += '<td width="7"><img src="/imagenes/menu_s_de.gif" width="100." height="20" alt="" /></td>[^<]+' patronvideos += '</tr>[^<]+' patronvideos += '</table>[^<]+' patronvideos += '<table class="titulo" id="naranja" cellpadding="0" cellspacing="0">[^<]+' patronvideos += '<tr>[^<]+' patronvideos += '<td class="contenido"> <div style="min-height. 150px."><a href="([^"]+)">[^<]+' patronvideos += '<a href="([^"]+)"><img src="([^"]+)' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[0].strip() scrapedurl = urlparse.urljoin(url, match[1]) scrapedthumbnail = urlparse.urljoin(url, match[3]) scrapeddescription = "" if (DEBUG): logger.info("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "list", CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, scrapeddescription) # Paginación patron = '<a href="([^"]+)" class="paginacion"[^>]+>\>\;\>\;</a>' matches = re.compile(patron, re.DOTALL).findall(data) if len(matches) > 0: scrapedurl = urlparse.urljoin(url, matches[0]) xbmctools.addnewfolder(CHANNELNAME, "novedadeslist", CHANNELNAME, "Página siguiente", scrapedurl, "", "") # 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 mainlist(params,url,category): logger.info("[seriesonline.py] mainlist") import base64 #decodeBase64('yFA/B6/fgVeTEKXqJsWqmGZuCQaVby9i6umE94Eies2OznsWeVCs9iEzpRfuZfK2xoF8Vj8TAGkbHv4IprauDzwV488pJoEzbndTne34hSMjMH8Apc4Z4Dssl3f8tD98StY3zGjGfkD53ErHTRELz9qcBamiKr+CDcs4ZB6d20rTKi6lseNyfMWKVw7EdLqCozywFTGwmzUQN2iCGyqEQoB2KDPdE8NNDaMn86jGKI8MhRxVNU+iwiSI6JwljACen0BIqzWRJwUIflaLfyQtgcVNnsstw3RbQIBDLxH8TBsn6eBLfIwqeNfHfywQiyw=') code = "yFA/B6/fgVeTEKXqJsWqmGZuCQaVby9i6umE94Eies2OznsWeVCs9iEzpRfuZfK2xoF8Vj8TAGkbHv4IprauDzwV488pJoEzbndTne34hSMjMH8Apc4Z4Dssl3f8tD98StY3zGjGfkD53ErHTRELz9qcBamiKr+CDcs4ZB6d20rTKi6lseNyfMWKVw7EdLqCozywFTGwmzUQN2iCGyqEQoB2KDPdE8NNDaMn86jGKI8MhRxVNU+iwiSI6JwljACen0BIqzWRJwUIflaLfyQtgcVNnsstw3RbQIBDLxH8TBsn6eBLfIwqeNfHfywQiyw=" result = base64.b64decode(code) print "%s" % result # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "novedadeslist" , "" , "Novedades","http://www.seriesonlinetv.com/","","") # 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 buscacategorias(params,url,category): logger.info("[redestv.py] buscacategorias") data = scrapertools.cachePage(url) #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 = 'href="/index\.php\?(option=com_content\&view=category.*?)" title="(.+?)"' #pprint(data) #logger.info("web"+data) matches = re.compile(patronvideos).findall(data) #if DEBUG: scrapertools.printMatches(matches) if len(matches)>0: for i in range(len(matches)): xbmctools.addnewfolder( __channel__ , "parsewebcategorias" , category, matches[i][1] , matches[i][0] , "" , "") 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 Foro(params,url,category,parse): logger.info("[Vagos.py] Vagos") try: data = get_page(url) chinchetas = MensajesChincheta(data) # Extrae las entradas (carpetas) patron = '<a href="([^"]+)" ' patron += 'id="thread_title_([^"]+)".*?>([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) for match in matches: # Atributos scrapedurl = BASEURL + match[0] scrapedtitle = match[2] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") if match[1] not in chinchetas: # Añade al listado de XBMC if(parse): xbmctools.addnewfolder( __channel__ , "SerieScan" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) else: xbmctools.addnewfolder( __channel__ , "MovieScan" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # Extrae la marca de siguiente pagina pnextp = '<a rel="next" class="smallfont" href="forumdisplay.php?f=.*page=(\d*)" title' pnextp = '<a rel="next" class="smallfont" href="([^"]+)" title' matches = re.compile(pnextp,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)>0: scrapedtitle = "Página siguiente" replaced = str(matches[0]).replace("&", "&") scrapedurl = urlparse.urljoin(url,replaced) #scrapedurl = BASEURL + "forumdisplay.php?f="+matches[0][0]+"&order=desc&page="+matches[0][1] scrapedthumbnail = "" scrapedplot = "" if(parse): xbmctools.addnewfolder( __channel__ , "Parse" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) else: xbmctools.addnewfolder( __channel__ , "NoParse" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) except Exception: pass # 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 mainlist(params,url,category): logger.info("[veocine.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder( __channel__ , "videolist" , "" , "Peliculas","http://www.veocine.es/peliculas.html","","") xbmctools.addnewfolder( __channel__ , "videolist" , "" , "Documentales", "http://www.veocine.es/documentales.html","","") xbmctools.addnewfolder( __channel__ , "videolist" , "" , "Peliculas infantiles", "http://www.veocine.es/infantil.html","","") xbmctools.addnewfolder( __channel__ , "videolist" , "" , "Peliculas VOS", "http://www.veocine.es/peliculavos.html","","") xbmctools.addnewfolder( __channel__ , "videolist" , "" , "Anime", "http://www.veocine.es/anime.html","","") # 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 mainlist(params, url, category): logger.info("[seriesonline.py] mainlist") import base64 #decodeBase64('yFA/B6/fgVeTEKXqJsWqmGZuCQaVby9i6umE94Eies2OznsWeVCs9iEzpRfuZfK2xoF8Vj8TAGkbHv4IprauDzwV488pJoEzbndTne34hSMjMH8Apc4Z4Dssl3f8tD98StY3zGjGfkD53ErHTRELz9qcBamiKr+CDcs4ZB6d20rTKi6lseNyfMWKVw7EdLqCozywFTGwmzUQN2iCGyqEQoB2KDPdE8NNDaMn86jGKI8MhRxVNU+iwiSI6JwljACen0BIqzWRJwUIflaLfyQtgcVNnsstw3RbQIBDLxH8TBsn6eBLfIwqeNfHfywQiyw=') code = "yFA/B6/fgVeTEKXqJsWqmGZuCQaVby9i6umE94Eies2OznsWeVCs9iEzpRfuZfK2xoF8Vj8TAGkbHv4IprauDzwV488pJoEzbndTne34hSMjMH8Apc4Z4Dssl3f8tD98StY3zGjGfkD53ErHTRELz9qcBamiKr+CDcs4ZB6d20rTKi6lseNyfMWKVw7EdLqCozywFTGwmzUQN2iCGyqEQoB2KDPdE8NNDaMn86jGKI8MhRxVNU+iwiSI6JwljACen0BIqzWRJwUIflaLfyQtgcVNnsstw3RbQIBDLxH8TBsn6eBLfIwqeNfHfywQiyw=" result = base64.b64decode(code) print "%s" % result # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "novedadeslist", "", "Novedades", "http://www.seriesonlinetv.com/", "", "") # 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 mainlist(params,url,category): xbmc.output("[meristation.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELCODE , "ultimosvideos" , CHANNELNAME , "Últimos vídeos" , "http://www.meristation.com/v3/GEN_videos.php" , "" , "" ) xbmctools.addnewfolder( CHANNELCODE , "listaconsolas" , CHANNELNAME , "Listado por consola", "http://www.meristation.com/v3/GEN_videos.php" , "" , "" ) xbmctools.addnewfolder( CHANNELCODE , "listaletras" , CHANNELNAME , "Listado alfabético" , "http://www.meristation.com/v3/GEN_videos.php" , "" , "" ) xbmctools.addnewfolder( CHANNELCODE , "listageneros" , CHANNELNAME , "Listado por género" , "http://www.meristation.com/v3/GEN_videos.php" , "" , "" ) xbmctools.addnewfolder( CHANNELCODE , "search" , CHANNELNAME , "Buscar" , "" , "" , "" ) # 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 list(params,url,category): logger.info("[seriesonline.py] list") 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) # Extrae las entradas patronvideos = '<a.*?href="(/serie-divx/[^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = title + "(Ver online)" scrapedurl = urlparse.urljoin( url , match ) scrapedthumbnail = thumbnail scrapeddescription = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detail" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail , scrapeddescription ) # Extrae las entradas patronvideos = '<a.*?href="(/descarga-directa/[^"]+)"' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = title + "(Descarga directa)" scrapedurl = urlparse.urljoin( url , match ) scrapedthumbnail = thumbnail scrapeddescription = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detail" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail , scrapeddescription ) # 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 novedadeslist(params,url,category): logger.info("[seriesonline.py] mainlist") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<table class="titulo" id="naranja" cellpadding="0" cellspacing="0">[^<]+' patronvideos += '<tr>[^<]+' patronvideos += '<td width="7"><img src="/imagenes/menu_s_iz.gif" width="100." height="20" alt="" /></td>[^<]+' patronvideos += '<td class="tit">([^<]+)</td>[^<]+' patronvideos += '<td width="7"><img src="/imagenes/menu_s_de.gif" width="100." height="20" alt="" /></td>[^<]+' patronvideos += '</tr>[^<]+' patronvideos += '</table>[^<]+' patronvideos += '<table class="titulo" id="naranja" cellpadding="0" cellspacing="0">[^<]+' patronvideos += '<tr>[^<]+' patronvideos += '<td class="contenido"> <div style="min-height. 150px."><a href="([^"]+)">[^<]+' patronvideos += '<a href="([^"]+)"><img src="([^"]+)' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[0].strip() scrapedurl = urlparse.urljoin(url,match[1]) scrapedthumbnail = urlparse.urljoin(url,match[3]) scrapeddescription = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "list" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail , scrapeddescription ) # Paginación patron = '<a href="([^"]+)" class="paginacion"[^>]+>\>\;\>\;</a>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: scrapedurl = urlparse.urljoin(url,matches[0]) xbmctools.addnewfolder( CHANNELNAME , "novedadeslist" , CHANNELNAME , "Página siguiente" , scrapedurl , "" , "" ) # 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 listcategorias(params, url, category): logger.info("[peliculasyonkis.py] listcategorias") # Descarga la pv°gina data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<li class="page_item"><a href="(http\://www.peliculasyonkis.sx/genero/[^"]+)"[^>]+>([^<]+)</a></li>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo try: scrapedtitle = unicode(match[1], "utf-8").encode("iso-8859-1") except: scrapedtitle = match[1] # URL scrapedurl = match[0] # Thumbnail scrapedthumbnail = match[0] # procesa el resto scrapedplot = "" # Depuracion if (DEBUG): logger.info("scrapedtitle=" + scrapedtitle) logger.info("scrapedurl=" + scrapedurl) logger.info("scrapedthumbnail=" + scrapedthumbnail) # Av±ade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "listvideos", 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 catdetail(params,url,category): logger.info("[watchanimeon.py] catdetail") # Descarga la página data = scrapertools.cachePage(url) # Extrae las series de cada categoria patron = '<li class="genrez"><div class="andyimg">' patron += "<a href='([^']+)'>" patron += '<img src="([^"]+)"></a></div><div class="genre" style="width: 410px; float: left;"><h4>' patron += "<a href='([^']+)'>([^<]+)<" matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) # Las añade a XBMC for match in matches: scrapedtitle = match[3] 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( __channel__ , "detalleserie" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ) # Paginación patron = '<span class="current"><a href="[^"]+" >[^<]+</a></span><span><a href="([^"]+)">[^<]+</a>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)>0: scrapedtitle = "Página siguiente" scrapedurl = urlparse.urljoin(url,matches[0]).replace(" ","+") scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( __channel__ , "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 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( __channel__ , "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( __channel__ , "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 ListadoSeries(params,url,category): logger.info("[pelisflv.py] ListadoSeries") title = urllib.unquote_plus( params.get("title") ) # Descarga la p�gina data = scrapertools.cachePage(url) #logger.info(data) # Patron de las entradas if "Series" in title: patron = "<center><form>(.*?)</form></center>" matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) patron = '<option value="([^"]+)" />(.*?)\n' matches = re.compile(patron,re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) elif "Generos" in title: patron = "<h2>Generos</h2>[^<]+<[^>]+>[^<]+<ul>(.*?)</ul>" matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) patron = "<a dir='ltr' href='([^']+)'>(.*?)</a>" matches = re.compile(patron,re.DOTALL).findall(matches[0]) 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( __channel__ , "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): logger.info("[peliculasyonkis.py] listcategorias") # Descarga la pv°gina data = scrapertools.cachePage(url) # logger.info(data) # Extrae las entradas (carpetas) patronvideos = '<li class="page_item"><a href="(http\://www.peliculasyonkis.sx/genero/[^"]+)"[^>]+>([^<]+)</a></li>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo try: scrapedtitle = unicode(match[1], "utf-8").encode("iso-8859-1") except: scrapedtitle = match[1] # URL scrapedurl = match[0] # Thumbnail scrapedthumbnail = match[0] # procesa el resto scrapedplot = "" # Depuracion if DEBUG: logger.info("scrapedtitle=" + scrapedtitle) logger.info("scrapedurl=" + scrapedurl) logger.info("scrapedthumbnail=" + scrapedthumbnail) # Av±ade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME, "listvideos", 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 buscacategorias(params, url, category): logger.info("[redestv.py] buscacategorias") data = scrapertools.cachePage(url) #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 = 'href="/index\.php\?(option=com_content\&view=category.*?)" title="(.+?)"' #pprint(data) #logger.info("web"+data) matches = re.compile(patronvideos).findall(data) #if DEBUG: scrapertools.printMatches(matches) if len(matches) > 0: for i in range(len(matches)): xbmctools.addnewfolder(__channel__, "parsewebcategorias", category, matches[i][1], matches[i][0], "", "") 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 verRelacionados(params,data,category): patronvideos = '<div class="item">.*?<a href="([^"]+)"' patronvideos += '><img src="([^"]+)".*?' patronvideos += 'alt="([^"]+)".*?/></a>.*?' patronvideos += '<span class="artist_name">([^<]+)</span>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo scrapedtitle = acentos(match[2]) # URL scrapedurl = match[0] # Thumbnail scrapedthumbnail = match[1] # procesa el resto scrapeddescription = match[3] # procesa el resto scrapedplot = "" # Depuracion if (DEBUG): logger.info("scrapedtitle="+scrapedtitle) logger.info("scrapedurl="+scrapedurl) logger.info("scrapedthumbnail="+scrapedthumbnail) # A�ade al listado de XBMC xbmctools.addnewfolder( __channel__ , "detail" , category , scrapedtitle+" - "+scrapeddescription , 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 mainlist(params, url, category): logger.info("[series21.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolderextra(__channel__, "listsimple", category, "Series - Novedades", "http://www.series21.com", "", "", "novedades") xbmctools.addnewfolderextra(__channel__, "listsimple", category, "Series - Estrenos", "http://www.series21.com", "", "", "estrenos") #xbmctools.addnewfolderextra( __channel__ , "listsimple" , category , "Spoilers ","http://www.series21.com/","","","spoilers") xbmctools.addnewfolder( __channel__, "seriesalfa", category, "Series - Lista alfabética (Con Sinopsis y Poster)", "", "", "") xbmctools.addnewfolder( __channel__, "SeriesBuscaAlfa", category, "Series - Busqueda Alfabética (toda la base de datos)", "http://www.series21.com/listado-series/", "", "") #xbmctools.addnewfolder( __channel__ , "listaActoresMasBuscados" , category , "Actores - Lista Los Más Buscados" ,"http://www.series21.com/","","") #xbmctools.addnewfolder( __channel__ , "buscaporletraActor" , category , "Actores - Busqueda Alfabética" ,"http://www.series21.com/actores/","","") xbmctools.addnewfolder(__channel__, "search", category, "Series - Buscar", "", "", "") # 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 ListadoCapitulosSeries(params,url,category): logger.info("[pelisflv.py] ListadoCapitulosSeries") title = urllib.unquote_plus( params.get("title") ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) # Descarga la p�gina data = scrapertools.downloadpageGzip(url) #logger.info(data) # Patron de las entradas patron = "<div class='post-body entry-content'>(.*?)<div class='post-footer'>" matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) patron = '<a href="([^"]+)"[^>]+><[^>]+>(.*?)<' matches = re.compile(patron,re.DOTALL).findall(matches[0]) scrapertools.printMatches(matches) patron2 = '<iframe src="([^"]+)"' # A�ade las entradas encontradas for match in matches: # Atributos scrapedtitle = match[1] data2 = scrapertools.downloadpageGzip(match[0]) matches2 = re.compile(patron2,re.DOTALL).findall(data2) scrapertools.printMatches(matches2) scrapedurl = matches2[0] scrapedthumbnail = thumbnail scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # A�ade al listado de XBMC xbmctools.addnewfolder( __channel__ , "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 )