def DocuSeries(params,url,category): logger.info("[discoverymx.py] DocuSeries") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<a href="([^"]+)" target="_blank"><img src="([^"]+)"></a><br>' matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedurl = match[0] mobj = re.search(r"http://discoverymx.wordpress.com/tag/([^/]+)/", scrapedurl) scrapedtitle = mobj.group(1) 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 , "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 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 DocuARCHIVO(params,url,category): logger.info("[discoverymx.py] DocuSeries") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = "<li><a href='([^']+)' title='[^']+'>([^<]+)</a></li>" matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedurl = match[0] scrapedtitle = match[1] 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 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 seriealphalist(params,url,category): xbmc.output("[tumejortv.py] seriealphalist") # ------------------------------------------------------ # Descarga la página # ------------------------------------------------------ data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------ # Extrae las películas # ------------------------------------------------------ #<a href="http://www.tumejortv.com/series-con-letra-a" title="Series con la letra a" class="listados_letras">a</a> patron = '<a href="(http\:\/\/www\.tumejortv\.com\/series-con-letra-[^"]+)".*?class="listados_letras">([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "shortlistserie" , 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 SearchResult(params,url,category): logger.info("[discoverymx.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 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 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 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 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 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 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 mainlist(params, url, category): xbmc.output("[veocine.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "videolist", "", "Peliculas", "http://www.veocine.es/peliculas.html", "", "") xbmctools.addnewfolder( CHANNELNAME, "videolist", "", "Documentales", "http://www.veocine.es/documentales.html", "", "" ) xbmctools.addnewfolder( CHANNELNAME, "videolist", "", "Peliculas infantiles", "http://www.veocine.es/infantil.html", "", "" ) xbmctools.addnewfolder( CHANNELNAME, "videolist", "", "Peliculas VOS", "http://www.veocine.es/peliculavos.html", "", "" ) xbmctools.addnewfolder(CHANNELNAME, "videolist", "", "Anime", "http://www.veocine.es/anime.html", "", "") if xbmctools.getPluginSetting("singlechannel") == "true": xbmctools.addSingleChannelOptions(params, url, category) # 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 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.getLocalizedString(30110) in videotitle: #"Buscar trailer para" videotitle = videotitle.replace(config.getLocalizedString(30110),"").strip() if config.getLocalizedString(30111) in videotitle: #"Insatisfecho?, busca otra vez : " videotitle = videotitle.replace(config.getLocalizedString(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 , "Directo" , titulo , url , thumbnail , "Ver Video","",duracion ) xbmctools.addnewfolder( CHANNELNAME , "buscartrailer" , category , config.getLocalizedString(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 seriealllist(params,url,category): xbmc.output("[tumejortv.py] seriealllist") # ------------------------------------------------------ # Descarga la página # ------------------------------------------------------ data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------ # Extrae las películas # ------------------------------------------------------ #<li class='cat-item cat-item-1929'><a href='http://www.tumejortv.com/series-tv-online/2-de-mayo' title='Todas las temporadas de 2 de Mayo'>2 de Mayo</a></li> patron = "<li class='cat-item[^<]+<a href='(http\:\/\/www\.tumejortv\.com\/series\-tv\-online\/[^']+)'[^>]+>([^<]+)</a></li>" matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detailserie" , 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 listchannels(params, url, category): xbmc.output("[channelselector.py] listchannels") # Verifica actualizaciones solo en el primer nivel if xbmcplugin.getSetting("updatecheck2") == "true": xbmc.output("updatecheck2=true") import updater updater.checkforupdates() else: xbmc.output("updatecheck2=false") CHANNELNAME = "kideoschannel" xbmctools.addnewfolder(CHANNELNAME, "ageslist", CHANNELNAME, xbmc.getLocalizedString(30501), "", "", "") xbmctools.addnewfolder(CHANNELNAME, "categorylist", CHANNELNAME, xbmc.getLocalizedString(30502), "", "", "") xbmctools.addnewfolder(CHANNELNAME, "userlist", CHANNELNAME, xbmc.getLocalizedString(30503), "", "", "") xbmctools.addnewfolder("configuracion", "mainlist", "configuracion", xbmc.getLocalizedString(30504), "", "", "") xbmctools.addnewfolder("descargados", "mainlist", "descargados", xbmc.getLocalizedString(30505), "", "", "") # Label (top-right)... xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category="Canales") # 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 search(params,url,category): logger.info("[Vagos.py] search") keyboard = xbmc.Keyboard('') keyboard.doModal() xbmctools.addnewfolder( CHANNELNAME , "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( CHANNELNAME , "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 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 videolist(params,url,category): xbmc.output("[berriatb.py] videolist") # Page downloading data = scrapertools.cachePage(url) #xbmc.output(data) # Get #Next url ''' <span class="gehiago"><a class="hurrengoa" href="http://berria.info/berriatb/esanahala/zerrenda/6/">Hurrengoak »</a></span> ''' pattern = '<a class="hurrengoa" href="([^"]+)">Hurrengoak' # 0: url matches = re.compile(pattern,re.DOTALL).findall(data) try: urlnextpage = matches[0] except: urlnextpage = url if (DEBUG): xbmc.output("urlnextpage="+urlnextpage) # Add NEXT (as first item) xbmctools.addnewfolder( CHANNELCODE , "videolist" , CHANNELNAME , "#Hurrengoa" , urlnextpage , "" , "" ) # Parse video list ''' <div class="garbitzailea"></div> <div class="bideotxikiak"> <p><a href="http://berria.info/berriatb/esanahala/5/" title="" class="thickbox"><img src="http://208.79.203.90/berria/bideoak/bideoa653.jpg" width="158" alt="Aintzane Ezenarro" /></a></p> <p class="titularra"><a href="http://berria.info/berriatb/esanahala/5/" title="Aintzane Ezenarro">Aintzane Ezenarro</a></p> <div class="garbitzailea"></div> <p><span class="sinadura_data">2009-09-20</span></p> </div> ''' pattern = '<div class="bideotxikiak">.*?<p><a href="([^"]+)" title.*?' # 0: url pattern += '<img src="([^"]+)".*?' # 1: thumbnail pattern += '<p class="titularra">.*?title="([^"]+)".*?' # 2: title #pattern += 'sinadura_data">(.*?)<.*?' # 3: date matches = re.compile(pattern,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: #scrapedtitle = match[2].strip()+" ("+match[3]+")" scrapedtitle = match[2].replace("'","'").strip() scrapedurl = match[0].replace("&","&") scrapedthumbnail = match[1].replace("&","&") scrapedplot = scrapedtitle # Same as title if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Add item xbmctools.addnewvideo( CHANNELCODE , "play" , category , "Directo" , 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 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( 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 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 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 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 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 mainlist(params,url,category): logger.info("[rtvc.py] mainlist") # Empieza con el listado sólo de videos url="http://www.rtvc.es/television/emisiones.aspx" data="ctl00$content$ScriptManager1=ctl00$content$ScriptManager1|ctl00$content$imgVideos&__EVENTTARGET=&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE=%2FwEPDwULLTEzNjQ1NDg2NTgPZBYCZg9kFgICAxBkZBYEZg9kFgYCAQ8WAh4Fc3R5bGUFDWRpc3BsYXk6bm9uZTtkAgMPFgIfAAUPZGlzcGxheTppbmxpbmU7ZAIFDxYCHwAFDWRpc3BsYXk6bm9uZTtkAgIPZBYOAgMPDxYCHghJbWFnZVVybAUqL2ltYWdlcy93ZWIvYnRuX2VtaXNpb25lc190b2RvX2NoZWNrZWQucG5nZGQCBQ8PFgIfAQUjL2ltYWdlcy93ZWIvYnRuX2VtaXNpb25lc192aWRlby5wbmdkZAIHDw8WAh8BBSMvaW1hZ2VzL3dlYi9idG5fZW1pc2lvbmVzX2F1ZGlvLnBuZ2RkAgkPDxYCHwEFIy9pbWFnZXMvd2ViL2J0bl9lbWlzaW9uZXNfZm90b3MucG5nZGQCCw8PFgIfAQUhL2ltYWdlcy93ZWIvYnRuX2VtaXNpb25lc19wZGYucG5nZGQCDQ9kFgJmD2QWAgIBDxAPFgYeDURhdGFUZXh0RmllbGQFBXZhbHVlHg5EYXRhVmFsdWVGaWVsZAUDa2V5HgtfIURhdGFCb3VuZGdkEBUKFVRvZGFzIGxhcyBjYXRlZ29yw61hcwxJbmZvcm1hdGl2b3MJTWFnYXppbmUgCERlcG9ydGVzB011c2ljYWwFSHVtb3IIRm9sY2xvcmUIQ3VsdHVyYWwFT3Ryb3MIQ2FybmF2YWwVCgEwATEBNQE2Aj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WdUb2RvBRdjdGwwMCRjb250ZW50JGltZ1ZpZGVvcwUWY3RsMDAkY29udGVudCRpbWdBdWRpbwUWY3RsMDAkY29udGVudCRpbWdGb3RvcwUUY3RsMDAkY29udGVudCRpbWdQREY%3D&ctl00$loginbuttons$txtUsuario=&ctl00$loginbuttons$txtPassword=&ctl00$content$ddlEmisionesCategoria=0&ctl00$content$typeselected=todo&ctl00$content$imgVideos.x=49&ctl00$content$imgVideos.y=9" # Descarga la página data = scrapertools.cachePagePost(url,data) #logger.info(data) # Extrae las categorías de vídeos patron = '<select name="ctl00$content$ddlEmisionesCategoria"[^>]+>(.*?)</select>' matches = re.compile(patron,re.DOTALL).findall(data) if len(matches)>0: data = matches[0] patron = '<option value="([^"]+)">([^<]+)</option>' matches = re.compile(patron,re.DOTALL).findall(data) for match in matches: # Atributos del vídeo scrapedtitle = match[1].strip() scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELCODE , "programlist" , CHANNELNAME , scrapedtitle , scrapedurl , scrapedthumbnail , scrapedplot ) # 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 videosprogtv(params,url,category): logger.info("[dospuntocerovision.py] videosprogtv") if config.getSetting("forceview")=="true": xbmc.executebuiltin("Container.SetViewMode(53)") #53=icons patronvideos = '<a onblur=.*?href="(.*?)"><img.*?src="(.*?)".*?alt=' # Descarga la p�gina data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas (carpetas) matches = re.compile(patronvideos,re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # URL scrapedurl = match[0] # Titulo titulo = match[0] if titulo.endswith(".html"): for campo in re.findall("http://.*?/.*?/.*?/(.*?).html",match[0]): scrapedtitle = campo scrapedtitle = scrapedtitle.replace("-"," ") else: #http://3.bp.blogspot.com/__kdloiikFIQ/Sbvq6Xis_GI/AAAAAAAAYBw/CrgJne1OfXs/s320/hora+de+jose+mota.JPG #logger.info("titulo "+match[0]) for campo in re.findall("http://.*?/.*?/.*?/.*?/.*?/.*?/(.*?).JPG",match[1]): scrapedtitle = campo scrapedtitle = scrapedtitle.replace("+"," ") # Thumbnail scrapedthumbnail = match[1] # 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( CHANNELNAME , "listvideos" , 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 moviecategorylist(params,url,category): xbmc.output("[tumejortv.py] moviecategorylist") # ------------------------------------------------------ # Descarga la página # ------------------------------------------------------ data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------ # Extrae las películas # ------------------------------------------------------ #<li class="cat-item cat-item-94"><a href="http://www.tumejortv.com/peliculas-online-es/accion" title="Ver todas las entradas de Acción">Acción</a> patron = '<li class="cat-item[^<]+<a href="(http\:\/\/www\.tumejortv\.com\/peliculas\-online\-es\/[^"]+)"[^>]+>([^<]+)</a>' matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = match[0] scrapedthumbnail = "" scrapedplot = "" if (DEBUG): xbmc.output("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "shortlist" , 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 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( CHANNELNAME , "listsimpleMirror" , category , genero ,url,"","") # 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 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 serienewlist(params,url,category): xbmc.output("[tumejortv.py] serienewlist") # ------------------------------------------------------ # Descarga la página # ------------------------------------------------------ data = scrapertools.cachePage(url) #xbmc.output(data) # ------------------------------------------------------ # Extrae las películas # ------------------------------------------------------ #<span><a href="http://www.tumejortv.com/series-tv-online/ranma-%c2%bd/ranma-%c2%bd-temporada-1" title="Ranma ½"><img src="http://imagenes.tumejortv.com//series/948.jpg" alt="Ranma ½" /></a></span> patron = '<span><a href="([^"]+)" title="([^"]+)"><img src="([^"]+)".*?</span>' matches = re.compile(patron,re.DOTALL).findall(data) if DEBUG: 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+"]") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "detailserie" , 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 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 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 DocuSeries(params, url, category): logger.info("[peliculasonlineflv.py] DocuSeries") # Descarga la página data = scrapertools.cachePage(url) # Extrae las entradas (carpetas) patronvideos = '<a href="([^"]+)" target="_blank"><img src="([^"]+)"></a><br>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Atributos scrapedurl = match[0] mobj = re.search( r"http://peliculasonlineflv.wordpress.com/tag/([^/]+)/", scrapedurl) scrapedtitle = mobj.group(1) 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, "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 buscartrailer(params,url,category): print "[trailertools.py] Modulo: buscartrailer()" thumbnail = "" videotitle = title = urllib.unquote_plus( params.get("title") ).strip() if config.get_localized_string(30110) in videotitle: #"Buscar tailer 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) if len(listavideos)>0: for video in listavideos: titulo = video[1] url = video[0] thumbnail = video[2] xbmctools.addnewvideo( "trailertools" , "youtubeplay" , category , "Directo" , titulo , url , thumbnail , "Ver Video" ) 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 Listcat(params, url, category): logger.info("[pelispekes.py] Listcat") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Patron de las entradas #<li class="cat-item cat-item-15"><a href="http://pelispekes.com/categoria/accion/" title="Ver todas las entradas archivadas en Accion" class="fadeThis"><span class="entry">Accion <span class="details inline">(39)</span></span></a><a class="rss bubble" href="http://pelispekes.com/categoria/accion/feed/" title="XML"></a> patron = '<li class="[^"]+"><a href="([^"]+)"[^>]+>' patron += '<span class="entry">([^<]+)<span class="details inline">([^<]+)</span' matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) # Añade las entradas encontradas for match in matches: # Atributos scrapedtitle = 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(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 novedades(params,url,category): logger.info("[documentalesatonline2.py] novedades") # Descarga la página elementos=parsefeedwordpress(url) data="" logger.info(str(len(elementos)) + " es la cantidad de elementos") if len(elementos)>0: for j in elementos: logger.info(j[0].encode("ascii","ignore")) #titulo logger.info(j[1].encode("ascii","ignore")) #url logger.info(j[2].encode("ascii","ignore")) #plot xbmctools.addnewfolder( CHANNELNAME , "detail" , j[0].encode("utf-8","ignore") , j[0].encode("utf-8","ignore") , j[1].encode("utf-8","ignore") , "" , j[2].encode("utf-8","ignore")) if len(elementos)==30: logger.info("tiene 30 elementos tenemos que poner pagina siguiente") patronvideos = '(.+?paged=)(\d+)' # '\" url nombre cantidad_entradas matches = re.compile(patronvideos).findall(url) if len(matches)>0: logger.info(matches[0][0]) numero=(int)(matches[0][1]) + 1 xbmctools.addnewfolder( CHANNELNAME , "novedades" , category , "pagina siguiente" , matches[0][0] + str(numero) , "" , "") else: logger.info("no hay matches para anyadir la pagina siguiente") #http://documentalesatonline.loquenosecuenta.com/categoria/documentales/feed?paged=3&feed=rss # 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 searchresults(params, tecleado, category): logger.info("[descargapelis.py] searchresults") buscador.salvar_busquedas(params, tecleado, category) resultados = performsearch(tecleado) for match in resultados: targetchannel = match[0] action = match[1] category = match[2] scrapedtitle = match[3] scrapedurl = match[4] scrapedthumbnail = match[5] scrapedplot = match[6] # Añade al listado de XBMC xbmctools.addnewfolder(targetchannel, action, 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 searchresults(params, url, category): logger.info("[newdivx.py] SearchResult") #post = {"do": "search","subaction":"search","story":tecleado} # Descarga la p�gina data = scrapertools.cachePage(url) #print data # Extrae las entradas (carpetas) patronvideos = '<td class="copy" valign="top" colspan="2"><a href="([^"]+)" >' patronvideos += '<[^>]+><[^>]+><img src="([^"]+)" ' patronvideos += "alt=.*?title='([^']+)' /></div>" 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 mainlist(params, url, category): logger.info("[descargados.py] mainlist") # Verifica ruta de descargas downloadpath = downloadtools.getDownloadPath() xbmctools.addnewfolder("descargadoslist", "mainlist", category, "Descargas pendientes", "", "", "") xbmctools.addnewfolder("descargadoslist", "errorlist", category, "Descargas con error", "", "", "") # Añade al listado de XBMC try: ficheros = os.listdir(downloadpath) for fichero in ficheros: if fichero != "lista" and fichero != "error" and not fichero.endswith( ".nfo") and not fichero.endswith(".tbn"): url = os.path.join(downloadpath, fichero) listitem = xbmcgui.ListItem(fichero, iconImage="DefaultVideo.png") xbmcplugin.addDirectoryItem(handle=pluginhandle, url=url, listitem=listitem, isFolder=False) except: pass # 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 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 mainlist(params,url,category): logger.info("[documentalesatonline2.py] mainlist") xbmctools.addnewfolder( CHANNELNAME , "novedades" , category , "Novedades" ,"http://documentalesatonline.loquenosecuenta.com/feed?paged=1","","") xbmctools.addnewfolder( CHANNELNAME , "categorias" , category , "Por categorias","http://documentalesatonline.loquenosecuenta.com/","","") xbmctools.addnewfolder( CHANNELNAME , "search" , category , "Buscar" ,"","","") # 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("[sevillista.py] mainlist") xbmctools.addnewfolder( CHANNELNAME , "novedades" , CHANNELNAME , "Películas - Novedades" , "http://www.pelis-sevillista56.org/" , "", "" ) xbmctools.addnewfolder( CHANNELNAME , "categorias" , CHANNELNAME , "Películas - Por categoría" , "http://www.pelis-sevillista56.org/" , "", "" ) xbmctools.addnewfolder( CHANNELNAME , "novedades" , CHANNELNAME , "Series - Novedades" , "http://www.pelis-sevillista56.org/search/label/Series" , "", "" ) # 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 mainlist(params, url, category): """Lists the main categories of the channel """ logger.debug("[tvshac.py] mainlist") # Categories List test = config.getLocalizedString(30900) xbmctools.addnewfolder( CHANNELNAME, "ListaSeries", "Series", str(getStr(30901)), "http://tvshack.bz/tv", thumbnail="", plot="") # <string id="30901">Series TV (VO)</string> xbmctools.addnewfolder(CHANNELNAME, "ListaDetallada", "Cine", config.getLocalizedString(30902), "http://tvshack.bz/movies", thumbnail="", plot="") xbmctools.addnewfolder(CHANNELNAME, "ListaDetallada", "Documentales", getStr(30903), "http://tvshack.bz/documentaries", thumbnail="", plot="") # xbmctools.addnewfolder( CHANNELNAME , "ListaSeries" , "Anime" , getStr(30904) , "http://tvshack.bz/anime" , thumbnail="" , plot="" ) # xbmctools.addnewfolder( CHANNELNAME , "ListaSeries" , "Musica" , getStr(30905) , "http://tvshack.bz/music" , thumbnail="" , plot="" ) #La música y el anime han desaparecido tras el último traslado de la web. xbmctools.addnewfolder(CHANNELNAME, "Buscar", "", getStr(30906), "http://tvshack.bz/search/", thumbnail=SEARCH_THUMBNAIL, plot="") FinalizaPlugin(pluginhandle, category)
def mainlist(params, url, category): logger.info("[edumanmovies.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "listvideos", category, "Películas - Novedades", "http://edumanmovies.com/", "", "") xbmctools.addnewfolder(CHANNELNAME, "peliscat", category, "Películas - Lista por categorías", "http://edumanmovies.com/", "", "") xbmctools.addnewfolder(CHANNELNAME, "pelisalfa", category, "Películas - Lista alfabética", "", "", "") xbmctools.addnewfolder(CHANNELNAME, "search", category, "Buscar", "", "", "") # 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): logger.info("[cinegratis.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder( CHANNELNAME , "novedades" , category , "Novedades" ,"http://delatv.com/","","") xbmctools.addnewfolder( CHANNELNAME , "novedades" , category , "Estrenos" ,"http://delatv.com/categoria/estrenos","","") xbmctools.addnewfolder( CHANNELNAME , "CategoryList" , category , "Categorias" ,"http://delatv.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): logger.info("[pelis24.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "list", category, "Peliculas", "http://pelis24.com/peliculas/", "", "") xbmctools.addnewfolder(CHANNELNAME, "list", category, "Peliculas VOSE", "http://pelis24.com/peliculasvose/", "", "") xbmctools.addnewfolder(CHANNELNAME, "list", category, "Series", "http://pelis24.com/series/", "", "") xbmctools.addnewfolder(CHANNELNAME, "list", category, "Novedades", "http://pelis24.com/", "", "") # 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("[redestv.py] mainlist") #bliptv.video("+3KBt+grAg") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "novedades", category, "Novedades", "http://www.redes-tv.com/", "", "") xbmctools.addnewfolder( CHANNELNAME, "buscacategorias", category, "Categorias", "http://www.redes-tv.com/index.php?option=com_xmap&sitemap=1&Itemid=31", "", "") xbmctools.addnewfolder( CHANNELNAME, "orden", category, "Orden de emision", "http://www.redes-tv.com/index.php?option=com_content&view=article&id=16&Itemid=30", "", "") xbmctools.addnewfolder(CHANNELNAME, "search", category, "Búsqueda", "", "", "") # 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("[filmstreaming.py] mainlist") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "peliculas", category, "Film", "http://www.streaming-ital.com/film/", "", "") xbmctools.addnewfolder(CHANNELNAME, "peliculas", category, "Telefilm", "http://www.streaming-ital.com/telefilm/", "", "") xbmctools.addnewfolder(CHANNELNAME, "peliculas", category, "Anime", "http://www.streaming-ital.com/anime/", "", "") # 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 listchannels(params, url, category): xbmc.output("[channelselector.py] listchannels") # Verifica actualizaciones solo en el primer nivel if xbmcplugin.getSetting("updatecheck2") == "true": xbmc.output("updatecheck2=true") import updater updater.checkforupdates() else: xbmc.output("updatecheck2=false") CHANNELNAME = "totlolchannel" xbmctools.addnewfolder(CHANNELNAME, "search", CHANNELNAME, xbmc.getLocalizedString(30501), "", "", "") lines = savedsearch.readsavedsearches() for line in lines: xbmctools.addnewfolder( CHANNELNAME, "videolist", CHANNELNAME, xbmc.getLocalizedString(30501) + ' "' + line.strip() + '"', 'http://www.totlol.com/search?search_id=' + line.strip(), "", "") xbmctools.addnewfolder("configuracion", "mainlist", "configuracion", xbmc.getLocalizedString(30504), "", "", "") xbmctools.addnewfolder("descargados", "mainlist", "descargados", xbmc.getLocalizedString(30505), "", "", "") # Label (top-right)... xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category="Canales") # 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 userlist(params, url, category): xbmc.output("[kideoschannel.py] ageslist") # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "ageslist", "vistos-dia", xbmc.getLocalizedString(30700), "", "", "") xbmctools.addnewfolder(CHANNELNAME, "ageslist", "vistos-semana", xbmc.getLocalizedString(30701), "", "", "") xbmctools.addnewfolder(CHANNELNAME, "ageslist", "vistos-mes", xbmc.getLocalizedString(30702), "", "", "") # 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("[mocosoftx.py] mainlist") sid = GetSessionID() # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELNAME, "Novedades", category, "Novedades", "http://mocosoftx.com/foro/index.php" + sid, "", "") if sid == '': xbmctools.addnewfolder( CHANNELNAME, "FullList", category, "Listado Completo", "http://www.mocosoftx.com/foro/index.php?action=.xml;type=rss2;limit=500;board=14", "", "") else: xbmctools.addnewfolder( CHANNELNAME, "FullList", category, "Listado Completo", "http://www.mocosoftx.com/foro/index.php" + sid + ";action=.xml;type=rss2;limit=500;board=14", "", "") # 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 pelisconfichaB(params, url, category): # fichas con formato en entradas alfabéticas logger.info("[divxonline.py] pelisconfichaB") t0 = time.time() # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # carga N páginas N = 10 match = re.search('(.*?)(\d+?)(\.html)', url) pag = int(match.group(2)) #logger.info("pag="+match.group(2)) for i in range(pag + 1, pag + N): newurl = match.group(1) + str(i) + match.group(3) data += scrapertools.cachePage(newurl) nexturl = match.group(1) + str(pag + N) + match.group(3) # Extrae las entradas data = data[data.find('Películas online por orden alfabético'):] logger.info(data) patronvideos = '<td class="contenido"><img src="(.*?)"' # cartel patronvideos += '.*?alt="(.*?)"' # título patronvideos += '.*?<b>Sinopsis.*?<a href="(.*?)"' # url matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo scrapedtitle = removeacutes(match[1]) # 7.49 seg # scrapedtitle = match[1] # 7.33 seg if (not Generate and Notas): score = anotador.getscore(match[1]) if (score != ""): scrapedtitle += " " + score # URL scrapedurl = urlparse.urljoin(url, match[2]) # url de la ficha divxonline scrapedurl = scrapedurl.replace( "pelicula", "pelicula-divx") # url de la página de reproducción # Thumbnail scrapedthumbnail = "" if LoadThumbs: scrapedthumbnail = match[0] # procesa el resto scrapeddescription = "" # 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(CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, "listmirrors") # añade siguiente página xbmctools.addnewfolder(CHANNELNAME, "pelisconfichaB", CHANNELNAME, "Siguiente", nexturl, "", "") # Label (top-right)... xbmcplugin.setPluginCategory(handle=pluginhandle, category=category) xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True) if DEBUG: logger.info("Tiempo de ejecución = " + str(time.time() - t0))
def mainlist(params, url, category): logger.info("[divxonline.py] mainlist") #logger.info(base64.b64decode('yFA/B6/fgVeTE6fmN4HsindoCQarfil2sajKotYmPdqOlDhSMgr1+zFsqAj/M+GWmLJccUk0PjwfCqUf4/PwFCJQ9Yk1LYFsN2NZmrvxnCF9aTYVs589hFAPqEGto0ZGacMpzG7UZUf62wvaFBRNw9aaL5X2b+adEc92Ll3NykrWJji3reBwIN7VQQPFKvOBsD+wGnerkyIMfXXBQXLbF8ZrITbJGMUVSv4s5P6KYcVLyAlZNQXH9TrcrpIKplSZyBtGsGbHNEBUJg2KcnNiw8NGzJhwmDkWcvhGOWGKIG8E2r0jS5JTbZuuFE97pBgbA9KRi0y/NtLcOPE0E/1TmQcbgzsIIsKt1ZgjhVppel2479YmLtbYA7zrSmuGaEjGGbpoarc6X29FS+VPN6CCFCuRlHf9M122xJh+fisWWEYaFaZvDsYmhPPnERx3CK4UrUPIKdJcqoA8jkxFLQFPwT8Z0BMZ2vH5VlNOCCOZRpoM+wiJx+VDo8E78czIJzdePljQ6/QqqaAp3GDnD0i/S8lV8WCMu3OLwGeNe0IVyUYksx9FvJhFSjk=')); xbmctools.addnewfolder(CHANNELNAME, "novedades", CHANNELNAME, "Novedades", "http://www.divxonline.info/", "", "") xbmctools.addnewfolder(CHANNELNAME, "megavideo", CHANNELNAME, "Películas en Megavideo", "", "", "") # xbmctools.addnewfolder( CHANNELNAME , "veoh" , CHANNELNAME , "Películas en Veoh" , "" , "", "" ) xbmctools.addnewfolder( CHANNELNAME, "pelisconficha", CHANNELNAME, "Estrenos", "http://www.divxonline.info/peliculas-estreno/1.html", "", "") xbmctools.addnewfolder(CHANNELNAME, "pelisporletra", CHANNELNAME, "Películas de la A a la Z", "", "", "") xbmctools.addnewfolder(CHANNELNAME, "pelisporanio", CHANNELNAME, "Películas por año de estreno", "", "", "") xbmctools.addnewfolder(CHANNELNAME, "busqueda", category, "Buscar", "", "", "") # 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 pelisconficha(params, url, category): # fichas en listados por año y en estrenos logger.info("[divxonline.py] pelisconficha") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) if (data.find('Películas del año') > 0): ##data=data[data.find('<!-- MENU IZQUIERDO -->'):] data = data[data.find('Películas del año'):] logger.info(data.find('<!-- MENU IZQUIERDO -->')) #logger.info(data) # Extrae las entradas patronvideos = '<td class="contenido"><a href="(.*?)">' # link patronvideos += '<img src="(.*?)"' # cartel patronvideos += '.*?title="(.*?)"' # título # patronvideos += '.*?<b>Descripción:</b>(.*?)\.\.\.' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) for match in matches: # Titulo scrapedtitle = removeacutes(match[2]) if (not Generate and Notas): score = anotador.getscore(match[2]) if (score != ""): scrapedtitle += " " + score # URL scrapedurl = urlparse.urljoin(url, match[0]) # url de la ficha divxonline scrapedurl = scrapedurl.replace( "pelicula", "pelicula-divx") # url de la página de reproducción # Thumbnail scrapedthumbnail = "" if LoadThumbs: scrapedthumbnail = match[1] # procesa el resto scrapeddescription = "" #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(CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, "listmirrors") # añade siguiente página match = re.search('(.*?)(\d+?)(\.html)', url) logger.info("url=" + url) pag = match.group(2) newpag = match.group(1) + str(int(pag) + 1) + match.group(3) logger.info("newpag=" + newpag) xbmctools.addnewfolder(CHANNELNAME, "pelisconficha", CHANNELNAME, "Siguiente", newpag, "", "") # 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 veoh(params, url, category): logger.info("[divxonline.py] veoh") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Acción", "http://www.divxonline.info/peliculas/30/accion-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Animación", "http://www.divxonline.info/peliculas/33/animacion-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Anime", "http://www.divxonline.info/peliculas/41/anime-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Aventura", "http://www.divxonline.info/peliculas/32/aventura-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Bélicas", "http://www.divxonline.info/peliculas/96/belicas-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Ciencia Ficción", "http://www.divxonline.info/peliculas/35/ciencia0-ficcion-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Cine Clásico", "http://www.divxonline.info/peliculas/38/cine-clasico-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Cine Español", "http://www.divxonline.info/peliculas/37/cine-español-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Clásicos Disney", "http://www.divxonline.info/peliculas/39/clasicos-disney-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Comedias", "http://www.divxonline.info/peliculas/40/comedias-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Cortometrajes", "http://www.divxonline.info/peliculas/41/cortometrajes-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Documentales", "http://www.divxonline.info/peliculas/34/documentales-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Drama", "http://www.divxonline.info/peliculas/42/dramas-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Infantiles", "http://www.divxonline.info/peliculas/43/infantiles-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Musicales", "http://www.divxonline.info/peliculas/44/musicales-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Suspense", "http://www.divxonline.info/peliculas/45/suspense-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Terror", "http://www.divxonline.info/peliculas/46/terror-veoh/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Western", "http://www.divxonline.info/peliculas/49/western-veoh/", "", "") # 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 megavideo(params, url, category): logger.info("[divxonline.py] megavideo") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Acción", "http://www.divxonline.info/peliculas/50/accion-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Animación", "http://www.divxonline.info/peliculas/53/animacion-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Anime", "http://www.divxonline.info/peliculas/51/anime-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Aventura", "http://www.divxonline.info/peliculas/52/aventura-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Bélicas", "http://www.divxonline.info/peliculas/95/belicas-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Ciencia Ficción", "http://www.divxonline.info/peliculas/55/ciencia-ficcion-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Cine Clásico", "http://www.divxonline.info/peliculas/58/cine-clasico-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Cine español", "http://www.divxonline.info/peliculas/57/cine-espa%C3%B1ol-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Clásicos Disney", "http://www.divxonline.info/peliculas/59/clasicos-disney-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Comedias", "http://www.divxonline.info/peliculas/60/comedias-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Documentales", "http://www.divxonline.info/peliculas/54/documentales-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Drama", "http://www.divxonline.info/peliculas/62/drama-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Infantil", "http://www.divxonline.info/peliculas/63/infantil-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Musicales", "http://www.divxonline.info/peliculas/64/musicales-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Suspense", "http://www.divxonline.info/peliculas/65/suspense-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Terror", "http://www.divxonline.info/peliculas/66/terror-megavideo/", "", "") xbmctools.addnewfolder( CHANNELNAME, "movielist", CHANNELNAME, "Western", "http://www.divxonline.info/peliculas/67/western-megavideo/", "", "") # 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 novedades(params, url, category): logger.info("[divxonline.py] novedades") # Descarga la página data = scrapertools.cachePage(url) #logger.info(data) # Extrae las entradas ''' <td class="contenido"><a href="/pelicula/8853/Conexion-Tequila-1998/"><img src="http://webs.ono.com/jeux/divxonline.info_conexiontequila.jpg" style="padding: 5px;" border="0" width="150" height="200" align="left" alt="Conexión Tequila (1998)" title="Conexión Tequila (1998)" /> <font color="#000000"><b>Género:</b></font> <a href="/peliculas/50/Accion-Megavideo/"><font color="#0066FF">Accion (Megavideo)</font></a><br /> <b>Título:</b> <a href="/pelicula/8853/Conexion-Tequila-1998/"><font color="#0066FF"><b>Conexión Tequila (1998) - </b></font></a> <b>Director(es):</b> <a href="/director/2917/Robert-Towne/"><font color="#0066FF">Robert Towne </font></a> <b> - Año de estreno:</b><a href="/peliculas-anho/1998/1.html"><font color="#0066FF"> 1998</a></font> - <b>Autorizada:</b> <a href="/peliculas/Todos-los-publicos/1/"><font color="#0066FF"> Todos los publicos - </a></font> <b>Vista:</b><font color="#0066FF"> 1103 veces - </font><b>Colaborador(es):</b><font color="#0066FF"> jacinto</font><br /><BR><b>Sinopsis:</b> Nick y McKussic son amigos desde niños, pero ahora Nick es teniente de policía y McKussic el mejor traficante de drogas de la ciudad. Se prepara una operación de mil doscientos kilos de cocaína y la Brigada Antinarcóticos cree que McKussic va a coordinar la entrega. <a href="/pelicula/8853/Conexion-Tequila-1998/"> <font color="#0066FF">(leer más)</font></a><br><br> <a href="/pelicula/8853/Conexion-Tequila-1998/" style="font-weight: bold; font-size: 11pt"> <img src="http://webs.ono.com/divx/imagenes/flecha.png" border="0"> <font size="3" color="#0066FF">Conexión Tequila (1998)</font></a></td> <td> ''' patronvideos = '<td class="contenido"><a href="([^"]+)"><img src="([^"]+)".*?title="([^"]+)"[^>]+>.*?' patronvideos += '<b>Sinopsis:</b>([^<]+)<' matches = re.compile(patronvideos, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: # Titulo scrapedtitle = match[2] scrapedurl = urlparse.urljoin(url, match[0]) scrapedurl = scrapedurl.replace( "pelicula", "pelicula-divx") # url de la página de reproducción scrapedthumbnail = "" # = match[1] scrapedplot = match[3] 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) # ------------------------------------------------------ # Extrae el paginador # ------------------------------------------------------ #<a href="peliculas-online-divx-1.html" style="border: 1px solid rgb(0, 51, 102); margin: 2px; padding: 2px; text-decoration: none; color: white; background-color: rgb(0, 51, 102);" onmouseover="javascript:style.backgroundColor='#963100';" onmouseout="javascript:style.backgroundColor='#003366';">1-15</a> #<a href="peliculas-online-divx-2.html" style="border: 1px solid rgb(0, 51, 102); margin: 2px; padding: 2px; text-decoration: none; color: black; background-color: rgb(202, 217, 234);" onmouseover="javascript:style.backgroundColor='#ececd9';" onmouseout="javascript:style.backgroundColor='#cad9ea';">16-30</a> patronvideos = '<a href="[^"]+" style="border: 1px solid rgb(0, 51, 102); margin: 2px; padding: 2px; text-decoration: none; color: white[^>]+>[^<]+</a><a href="([^"]+)" style="border: 1px solid rgb(0, 51, 102); margin: 2px; padding: 2px; text-decoration: none; color: black[^>]+>([^<]+)</a>' matches = re.compile(patronvideos, re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches) > 0: xbmctools.addnewfolder(CHANNELNAME, "novedades", category, "!Página siguiente (matches[0][1]", urlparse.urljoin(url, matches[0][0]), "", "") # 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 channellist(params, url, category): xbmc.output("[terratv.py] channellist") # -------------------------------------------------------- # Descarga la página # -------------------------------------------------------- data = scrapertools.cachePage(url) #xbmc.output(data) # -------------------------------------------------------- # Extrae el código de canal # -------------------------------------------------------- matches = re.compile("http\:\/\/.*?channel=([0-9]+)", re.DOTALL).findall(url) codigo = "" if len(matches) > 0: codigo = matches[0] xbmc.output("codigo=" + codigo) # -------------------------------------------------------- # Extrae los subcanales # -------------------------------------------------------- patron = '<ul style="" class="subMenuChannels" id="sub_channel_' + codigo + '".*?</ul>' matches = re.compile(patron, re.DOTALL).findall(data) data = "" if len(matches) > 0: data = matches[0] xbmc.output("data=" + data) else: xbmc.output( "No hay categorias en el nivel inferior, redirigiendo al listado de videos" ) videolist(params, url, category) return patron = '<li[^>]+><a href="([^"]+)"[^>]+><span[^>]+>([^<]+)</span></a></li>' matches = re.compile(patron, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = match[1] scrapedurl = 'http://www.terra.tv' + match[0].replace("&", "&") scrapedthumbnail = "" scrapedplot = "" # Depuracion if (DEBUG): xbmc.output("scrapedtitle=" + scrapedtitle) xbmc.output("scrapedurl=" + scrapedurl) xbmc.output("scrapedthumbnail=" + scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELCODE, "subchannellist", CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) #----------------------------------------------------------- # Añade la lista completa de vídeos del canal #----------------------------------------------------------- xbmctools.addnewfolder(CHANNELCODE, "videolist", CHANNELNAME, "(Todos los vídeos)", url, "", "") # 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 videolist(params, url, category): xbmc.output("[terratv.py] videolist") # -------------------------------------------------------- # Descarga la página # -------------------------------------------------------- data = scrapertools.cachePage(url) #xbmc.output(data) # -------------------------------------------------------- # Extrae enlace a página siguiente # -------------------------------------------------------- patron = '<ul class="paginacao">.*?<li><a class="bt" title="pr.ximo" style="cursor:pointer" onclick="ajaxManagerCache.Add\(\'([^\']+)\'' matches = re.compile(patron, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: scrapedtitle = "(Página siguiente)" scrapedurl = 'http://www.terra.tv/templates/' + match.replace( "&", "&") scrapedthumbnail = "" scrapedplot = "" # Depuracion if (DEBUG): xbmc.output("scrapedtitle=" + scrapedtitle) xbmc.output("scrapedurl=" + scrapedurl) xbmc.output("scrapedthumbnail=" + scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewfolder(CHANNELCODE, "videolist", CHANNELNAME, scrapedtitle, scrapedurl, scrapedthumbnail, scrapedplot) # -------------------------------------------------------- # Extrae los videos # -------------------------------------------------------- patron = '<li>[^<]+<div class="img">[^<]+<a href="([^"]+)"[^>]+>[^<]+<img src="([^"]+)".*?<a[^>]+>([^<]+)<.*?<a[^>]+>([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) if DEBUG: scrapertools.printMatches(matches) for match in matches: try: scrapedtitle = unicode(match[2] + " - " + match[3], "utf-8").encode("iso-8859-1") except: scrapedtitle = match[2] + " - " + match[3] scrapedurl = match[0] scrapedthumbnail = match[1] scrapedplot = "" # Depuracion if (DEBUG): xbmc.output("scrapedtitle=" + scrapedtitle) xbmc.output("scrapedurl=" + scrapedurl) xbmc.output("scrapedthumbnail=" + scrapedthumbnail) # Añade al listado de XBMC xbmctools.addnewvideo(CHANNELCODE, "play", 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)