Пример #1
0
def searchresults(params, url, category):
    salvar_busquedas(params, url, category)
    tecleado = url
    tecleado = tecleado.replace(" ", "+")

    # Lanza las búsquedas

    # Cinegratis
    matches = []
    itemlist = []
    try:
        itemlist.extend(cinetube.getsearchresults(params, tecleado, category))
    except:
        pass
    try:
        matches.extend(cinegratis.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(peliculasyonkis.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(tumejortv.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(cine15.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(peliculas21.performsearch(tecleado))
    except:
        pass
    #matches.extend( sesionvip.performsearch(tecleado) )
    try:
        matches.extend(seriesyonkis.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(documaniatv.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(discoverymx.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(yotix.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(stagevusite.performsearch(tecleado))
    except:
        pass
    try:
        matches.extend(tutvsite.performsearch(tecleado))
    except:
        pass

    for item in itemlist:
        targetchannel = item.channel
        action = item.action
        category = category
        scrapedtitle = item.title + " [" + item.channel + "]"
        scrapedurl = item.url
        scrapedthumbnail = item.thumbnail
        scrapedplot = item.plot

        xbmctools.addnewfolder(targetchannel, action, category, scrapedtitle,
                               scrapedurl, scrapedthumbnail, scrapedplot)

    # Construye los resultados
    for match in matches:
        targetchannel = match[0]
        action = match[1]
        category = match[2]
        scrapedtitle = match[3] + " [" + targetchannel + "]"
        scrapedurl = match[4]
        scrapedthumbnail = match[5]
        scrapedplot = match[6]

        xbmctools.addnewfolder(targetchannel, action, category, scrapedtitle,
                               scrapedurl, scrapedthumbnail, scrapedplot)

    # Cierra el directorio
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)
    xbmcplugin.addSortMethod(handle=pluginhandle,
                             sortMethod=xbmcplugin.SORT_METHOD_TITLE)
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
def searchresults(params,url,category):
	salvar_busquedas(params,url,category)
	tecleado = url
	tecleado = tecleado.replace(" ", "+")
	
	# Lanza las búsquedas
	
	# Cinegratis
	matches = []
	itemlist = []
	try:
		itemlist.extend( cinetube.getsearchresults(params,tecleado,category) )
	except:
		pass
	try:
		matches.extend( cinegratis.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( peliculasyonkis.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( tumejortv.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( cine15.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( peliculas21.performsearch(tecleado) )
	except:
		pass
	#matches.extend( sesionvip.performsearch(tecleado) )
	try:
		matches.extend( seriesyonkis.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( documaniatv.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( discoverymx.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( yotix.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( stagevusite.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( tutvsite.performsearch(tecleado) )
	except:
		pass
	
	for item in itemlist:
		targetchannel = item.channel
		action = item.action
		category = category
		scrapedtitle = item.title+" ["+item.channel+"]"
		scrapedurl = item.url
		scrapedthumbnail = item.thumbnail
		scrapedplot = item.plot
		
		xbmctools.addnewfolder( targetchannel , action , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )
	
	# Construye los resultados
	for match in matches:
		targetchannel = match[0]
		action = match[1]
		category = match[2]
		scrapedtitle = match[3]+" ["+targetchannel+"]"
		scrapedurl = match[4]
		scrapedthumbnail = match[5]
		scrapedplot = match[6]
		
		xbmctools.addnewfolder( targetchannel , action , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_TITLE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
def mainlist(params,url,category):
	xbmc.output("[buscador.py] mainlist")

	keyboard = xbmc.Keyboard('')
	keyboard.doModal()
	if (keyboard.isConfirmed()):
		tecleado = keyboard.getText()
		if len(tecleado)<=0:
			return
	
	tecleado = tecleado.replace(" ", "+")
	
	# Lanza las búsquedas
	
	# Cinegratis
	matches = []
	try:
		matches.extend( cinegratis.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( peliculasyonkis.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( tumejortv.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( cine15.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( peliculas21.performsearch(tecleado) )
	except:
		pass
	#matches.extend( sesionvip.performsearch(tecleado) )
	try:
		matches.extend( seriesyonkis.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( stagevusite.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( tutvsite.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( documaniatv.performsearch(tecleado) )
	except:
		pass
	try:
		matches.extend( yotix.performsearch(tecleado) )
	except:
		pass
	
	# Construye los resultados
	for match in matches:
		targetchannel = match[0]
		action = match[1]
		category = match[2]
		scrapedtitle = match[3]+" ["+targetchannel+"]"
		scrapedurl = match[4]
		scrapedthumbnail = match[5]
		scrapedplot = match[6]
		
		xbmctools.addnewfolder( targetchannel , action , category , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot )

	# Cierra el directorio
	xbmcplugin.setPluginCategory( handle=pluginhandle, category=category )
	xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_TITLE )
	xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )