def channel(params,url,category):
	xbmc.output("[euronews.py] channel")

	# Parametros
	channelname = url
	startindex = int(params.get("startindex"))
	maxresults = int(params.get("maxresults"))

	# Anade al listado de XBMC
	if startindex==1: 
		addnewfolder( CHANNELCODE , "novedades" , CHANNELNAME , "Novedades" , channelname , "" , "" , 1 , 13 )

	itemlist = youtube.getplaylists(channelname,startindex,maxresults)
	for item in itemlist:
		print item.title
		print item.url
		print item.thumbnail
		print item.plot
		addnewfolder( CHANNELCODE , "playlist" , CHANNELNAME , item.title , item.url , item.thumbnail , item.plot , startindex, maxresults )

	if len(itemlist)>=13:
		addnewfolder( CHANNELCODE , "channel" , CHANNELNAME , "!Siguiente pagina" , channelname , "" , "" , startindex+maxresults, maxresults )		

	# 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("[earthtv.py] mainlist")

	# Añade al listado de XBMC
	xbmctools.addnewfolder( CHANNELCODE , "novedades" , CHANNELNAME , "Novedades" , "" , "" , "" )

	# Playlists
	itemlist = youtube.getplaylists("earthTV",1,13)
	for item in itemlist:
		xbmctools.addnewfolder( CHANNELCODE , "playlist" , CHANNELNAME , item.title , item.url , item.thumbnail , item.plot )

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