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 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 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 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 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("&#8211;","-")
		scrapedtitle = scrapedtitle.replace("&nbsp;"," ")
		scrapedthumbnail = match[1]
		scrapedplot = ""
		if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")

		# A�ade al listado de XBMC
		xbmctools.addnewfolder( CHANNELNAME , "detail" , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )

	# Propiedades
	xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
	xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
	xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
def novedades(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("&quot;","")
		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 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("&#8211;","-")
		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 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("&#8211;","-")
		scrapedtitle = scrapedtitle.replace("&nbsp;"," ")
		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 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 )
Exemple #10
0
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 )
Exemple #11
0
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 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 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 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 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)
Exemple #16
0
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 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 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 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 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 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 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("&nbsp;","").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 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 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 )
Exemple #25
0
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 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$Script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Vwb3I3IEVzcGVjaWFsIFJlc3VtZW4gQW51YWwSUmVwb3I3IEVzcGVjaWFsLi4uDEluZm9ybWF0aXZvcyIvcnNzL3RlbGV2aXNpb24vcHJvZ3JhbWEvODg0MC5hc3B4ZAIzD2QWAgIBDxUFRi90ZWxldmlzaW9uL2VtaXNpb24vdmlzaXRhcy1lc2NvbGFyZXMtY2VudHJvcy1kZS1wcm9kdWNjacOzbi04ODQ4LmFzcHgoVmlzaXRhcyBlc2NvbGFyZXMgY2VudHJvcyBkZSBwcm9kdWNjacOzbhRWaXNpdGFzIGVzY29sYXJlcy4uLgVPdHJvcyIvcnNzL3RlbGV2aXNpb24vcHJvZ3JhbWEvODg0OC5hc3B4ZAI0D2QWAgIBDxUFKy90ZWxldmlzaW9uL2VtaXNpb24vem9uYS1tb3Rvci10di04NDUzLmFzcHgNWm9uYSBNb3RvciBUVg1ab25hIE1vdG9yIFRWCERlcG9ydGVzIi9yc3MvdGVsZXZpc2lvbi9wcm9ncmFtYS84NDUzLmFzcHhkAjUPZBYCAgEPFQUkL3RlbGV2aXNpb24vZW1pc2lvbi9wcm9tb3MtODQzNi5hc3B4BlByb21vcwZQcm9tb3MFT3Ryb3MiL3Jzcy90ZWxldmlzaW9uL3Byb2dyYW1hLzg0MzYuYXNweGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgcFHGN0bDAwJGxvZ2luYnV0dG9ucyRidG5FbnZpYXIFHmN0bDAwJGxvZ2luYnV0dG9ucyRjaGJSZWNvcmRhcgUVY3RsMDAkY29udGVudCRpbWdUb2RvBRdjdGwwMCRjb250ZW50JGltZ1ZpZGVvcwUWY3RsMDAkY29udGVudCRpbWdBdWRpbwUWY3RsMDAkY29udGVudCRpbWdGb3RvcwUUY3RsMDAkY29udGVudCRpbWdQREY%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 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)
Exemple #28
0
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 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 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 &raquo;</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("&#39;","'").strip()
		scrapedurl = match[0].replace("&amp;","&")
		scrapedthumbnail = match[1].replace("&amp;","&")
		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 )