def play(params,url,category):
    logger.info("[ecarteleratrailers.py] play")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    server = params["server"]
    
    # ------------------------------------------------------
    # Descarga la página
    # ------------------------------------------------------
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # ------------------------------------------------------
    # Extrae las películas
    # ------------------------------------------------------
    patron  = "so\.addVariable\('file','([^']+)'\)"
    #patron  = "s1\.addParam\('flashvars'\,'file\=([^\&]+)\&"
    matches = re.compile(patron,re.DOTALL).findall(data)
    if DEBUG:
        scrapertools.printMatches(matches)

    if len(matches)>0:
        url = urlparse.urljoin(url,matches[0])
        logger.info("[ecarteleratrailers.py] url="+url)
        xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def play(params,url,category):
    logger.info("[sonolatino.py] play")

    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    
    try:
        thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    except:
        thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
    plot = urllib.unquote_plus( params.get("plot") )
    plot = urllib.unquote_plus( params.get("plot") )

    try:
        plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    except:
        plot = xbmc.getInfoLabel( "ListItem.Plot" )

    server = params["server"]
    logger.info("[sonolatino.py] thumbnail="+thumbnail)
    logger.info("[sonolatino.py] server="+server)
    
    if server == "izlesene":
        print server
        data = scrapertools.cachePage(url)
        print data
        patron = 'durl="([^"]+)"'
        matches = re.compile(patron,re.DOTALL).findall(data)
        if len(matches)>0:
            url = matches[0]
            server = "Directo"
    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def play2(item):

    opciones = []
    if item.server in SERVER:
        servidor = SERVER[item.server]
        url = Decrypt_Server(item.url,item.server)
        if url == "":
            from core import xbmctools
            xbmctools.alertUnsopportedServer()
            servidor = "unknown"
            return []
    else:
        servidor = "desconocido ("+item.server+")"
        logger.info("[peliculasyonkis.py] SERVIDOR DESCONOCIDO ["+item.server+"]")
        url = ""
    if "|" in url:
        
        logger.info("1link con dos partes")
        itemPartes = Item (title=title, url=url, server=servidor, action="play",folder=False)
        opciones = choiceOnePart(itemPartes, opciones)
        
    else:
        #opciones.append(Item (channel=CHANNELNAME, title=item.title, server=servidor, url=url, action="play",folder=False) )
        from core import xbmctools
        xbmctools.playvideo(CHANNELNAME,servidor,url,item.category,item.title,item.thumbnail,item.plot,subtitle=item.subtitle)
    return opciones
def play(params,url,category):
    logger.info("[terrorygore.py] play")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = urllib.unquote_plus( params.get("plot") )
    server = params["server"]

    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def play(params,url,category):
    logger.info("[redestv.py] play")
 
    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    server = params["server"]
 
    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def play(params,url,category):
    logger.info("[stagevusite.py] play")

    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    logger.info("[stagevusite.py] thumbnail="+thumbnail)
    server="stagevu"

    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def play(params,url,category):
    logger.info("[divxonline.py] play")

    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    server = params["server"]
    logger.info("[divxonline.py] thumbnail="+thumbnail)
    logger.info("[divxonline.py] server="+server)

    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
Beispiel #8
0
def play(params,url,category):
    xbmc.output("[cineblog01.py] play")

    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    server = params["server"]
    xbmc.output("[cineblog01.py] thumbnail="+thumbnail)
    xbmc.output("[cineblog01.py] server="+server)
    
    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
Beispiel #9
0
def play(params, url, category):
    xbmc.output("[cineblog01.py] play")

    title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
    thumbnail = xbmc.getInfoImage("ListItem.Thumb")
    plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")
    server = params["server"]
    xbmc.output("[cineblog01.py] thumbnail=" + thumbnail)
    xbmc.output("[cineblog01.py] server=" + server)

    xbmctools.playvideo(CHANNELNAME, server, url, category, title, thumbnail,
                        plot)
def play(params,url,category):
    logger.info("[pelispekes.py] play")
    try:
        title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    except:
        title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    server = params.get("server")

    # Abre dialogo
    dialogWait = xbmcgui.DialogProgress()
    dialogWait.create( 'Accediendo al video...', title , plot )

    # Descarga la página del reproductor
    # http://pelispekes.com/modulos/player.php?url=dmlkZW8uYWsuZmFjZWJvb2suY29tL2Nmcy1hay1hc2gyLzMzMjM2LzY4NS8xMDU1NTcxNDYxNjI3MjNfMzQ5ODk=
    # http://pelispekes.com/modulos/embed/playerembed.php?url=dmlkZW8uYWsuZmFjZWJvb2suY29tL2Nmcy1hay1hc2gyLzMzMjM2LzY4NS8xMDU1NTcxNDYxNjI3MjNfMzQ5ODk=
    logger.info("[pelispekes.py] url="+url)
    
    ## --------------------------------------------------------------------------------------##
    #            Busca enlaces de videos para el servidor vkontakte.ru                        #
    ## --------------------------------------------------------------------------------------##
    #"http://vkontakte.ru/video_ext.php?oid=89710542&id=147003951&hash=28845bd3be717e11&hd=1
    
    
    if "vkontakteX.php" in url:
        data = scrapertools.cachePage(url)
        server = "Directo"
        '''
        var video_host = 'http://cs12916.vkontakte.ru/';
        var video_uid = '87155741';
        var video_vtag = 'fc697084d3';
        var video_no_flv = 1;
        var video_max_hd = '1'
        '''
        patronvideos = '<iframe src="(http://vk[^/]+/video_ext.php[^"]+)"'
        matches = re.compile(patronvideos,re.DOTALL).findall(data)
        if len(matches)>0:
            print " encontro VKontakte.ru :%s" %matches[0]
            url =     vk.geturl(matches[0])
            
    
    # Cierra dialogo
    dialogWait.close()
    del dialogWait

    if len(url)>0:
        
        logger.info("url="+url)
        xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
    else:
        xbmctools.alertnodisponible()
def youtubeplay(params,url,category):
    logger.info("[peliculas21.py] youtubeplay")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = "Ver Video"
    server = "Directo"
    id = youtube.Extract_id(url)
    videourl = youtube.geturl(id)

    if videourl == ("" or "Esc"):return
    logger.info("link directo de youtube : "+videourl)
    xbmctools.playvideo("Trailer",server,videourl,category,title,thumbnail,plot)
def strm_detail (params,url,category):
    logger.info("[seriesyonkis.py] strm_detail")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    #server = "Megavideo"
    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    server,url = scrapvideoURL(url)
    if url == "":
        
        return
    logger.info("[seriesyonkis] strm_detail url="+url)
    
    xbmctools.playvideo("STRM_Channel",server,url,category,title,thumbnail,plot,1)
def buscavideos(params,url,category):
    data = scrapertools.cachePage("http://www.redes-tv.com"+url)
    #<embed src="http://blip.tv/play/+3KB0rYcAg" type="application/x-shockwave-flash"
    patronvideos  = '\n<div style="text-align: justify;">.+?</div>'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    if DEBUG:
        scrapertools.printMatches(matches)    
    #<embed src="http://blip.tv/play/+3KB0rYcAg" type="application/x-shockwave-flash"    
    patronvideos  = '<embed src="(http://blip.tv/play/\+.*?)" type="application/x-shockwave-flash"'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    if DEBUG:
        scrapertools.printMatches(matches)
    #bliptv.bliptv("3011527")
    #mediaurl = bliptv.geturl(matches[0])
    #logger.info("mediaurl="+mediaurl)
    
    xbmctools.playvideo(CHANNELNAME,"bliptv",matches[0],"","","","")
def youtubeplay(params,url,category):
    logger.info("[peliculasonlineflv.py] youtubeplay")
    if "www.youtube" not in url:
        url  = 'http://www.youtube.com'+url


    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = "Ver Video"
    server = "Directo"
    id = youtube.Extract_id(url)
    videourl = youtube.geturl(id)

    if len(videourl)>0:
        logger.info("link directo de youtube : "+videourl)
        xbmctools.playvideo("Trailer",server,videourl,category,title,thumbnail,plot)

    return
def play(params,url,category):
    logger.info("[tutvsite.py] play")

    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    server = params["server"]
    logger.info("[tutvsite.py] thumbnail="+thumbnail)
    logger.info("[tutvsite.py] server="+server)
    
    # Descarga la página de detalle y extrae el vídeo
    data = scrapertools.cachePage(url)
    listavideos = servertools.findvideos(data)
    if len(listavideos)>0:
        url = listavideos[0][1]
    logger.info("[tutvsite.py] url="+url)
    
    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def detail(params,url,category):
    logger.info("[peliculasyonkis.py] detail")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )

    # Descarga la pv°gina
    data = scrapertools.cachePage(url)
    #logger.info(data)

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    patronvideos  = 'href="http://www.peliculasyonkis.com/player/visor_([^\.]+).php.*?'
    patronvideos += 'id=([^"]+)".*?'
    patronvideos += 'alt="([^"]+)"'
    patronvideos += '(.*?)</tr>'
    matches = re.compile(patronvideos,re.DOTALL).findall(data)
    
    patronvideos1  = 'http://www.peliculasyonkis.com/go/(d)/(.+?)".*?alt="([^"]+)"'
    patronvideos1 += "(.+?)<br /></span></div></td>"
    matches1 = re.compile(patronvideos1,re.DOTALL).findall(data)
    if (len(matches1) > 0):
        for j in matches1:
            matches.append(j)
    
    if len(matches)>0:
        scrapertools.printMatches(matches)
        id,serv = ChoiceOneVideo(matches,title)
        logger.info("[peliculasyonkis.py]  id="+id)
        url = Decrypt_Server(id,serv)
        if (serv in ["pymeno2","pymeno3"]) and (":" in url):
            match = url.split(":")
            url = choiceOnePart(match)
            if url == "": return
        print 'codigo :%s' %url
    else:
        xbmctools.alertnodisponible()
        return ""
    
    if url == "":return
    xbmctools.playvideo(CHANNELNAME,SERVER[serv],url,category,title,thumbnail,plot)
def play(params,url,category):
	xbmc.output("[earthtv.py] play")

	# Extrae el ID
	id = youtube.Extract_id(url)
	xbmc.output("[earthtv.py] id="+id)
	
	# Descarga la página
	data = scrapertools.cachePage(url)
	
	# Obtiene la URL
	url = youtube.geturls(id,data)
	print url
	
	title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
	server = "Directo"

	xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
Beispiel #18
0
def play(params, url, category):
    xbmc.output("[earthtv.py] play")

    # Extrae el ID
    id = youtube.Extract_id(url)
    xbmc.output("[earthtv.py] id=" + id)

    # Descarga la página
    data = scrapertools.cachePage(url)

    # Obtiene la URL
    url = youtube.geturls(id, data)
    print url

    title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")
    server = "Directo"

    xbmctools.playvideo(CHANNELNAME, server, url, category, title, thumbnail,
                        plot)
def play(params,url,category):
    logger.info("[documaniatv.py] play")

    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
    try:
        thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    except:
        thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
    plot = urllib.unquote_plus( params.get("plot") )
    plot = urllib.unquote_plus( params.get("plot") )

    try:
        plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    except:
        plot = xbmc.getInfoLabel( "ListItem.Plot" )

    server = params["server"]
    logger.info("[documaniatv.py] thumbnail="+thumbnail)
    logger.info("[documaniatv.py] server="+server)
    
    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
def detail(params,url,category):
    logger.info("[seriesyonkis.py] detail")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
    Serie = urllib.unquote_plus( params.get("Serie") )
    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    #server = "Megavideo"
    server,url = scrapvideoURL(url) 
   
    if (":" in url):
        match = url.split(":")
        url = choiceOnePart(match)
   
    if url == "":return
   
    logger.info("[seriesyonkis - detail] url="+url)
   
    xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot,Serie=Serie)
def youtubeplay(params,url,category):
    logger.info("[series21.py] youtubeplay")

    title = urllib.unquote_plus( params.get("title") )
    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    plot = "Ver Video"
    server = "Directo"
    id = youtube.Extract_id(url)
    # Abre el diálogo de selección
    opciones = []
    opciones.append("(FLV) Baja calidad")
    opciones.append("(MP4) Alta calidad")
    dia = xbmcgui.Dialog()
    seleccion = dia.select("tiene 2 formatos elige uno", opciones)
    logger.info("seleccion=%d" % seleccion)
    if seleccion==-1:
        return("")
    if seleccion == 0:
        videourl,videoinfo = youtube.GetYoutubeVideoInfo(id)
    else:
        videourl = youtube.geturl(id)
    logger.info("link directo de youtube : "+videourl)
    xbmctools.playvideo("Trailer",server,videourl,category,title,thumbnail,plot)
Beispiel #22
0
def play(params, url, category):
    xbmc.output("[berriatb.py] play")

    # Page downloading
    data = scrapertools.cachePage(url)

    ##
    ## PARSE VIDEO DATA
    ##
    '''
Option1:

s1.addParam("flashvars","file=http://208.79.203.90/berria/bideoak/bideoa821.mp4&image=http://208.79.203.90/berria/bideoak/bideoa821.jpg&logo=http://208.79.203.90/berria/logo2_tv.png&stretching=fill&fullscreen=true&autostart=false&duration=17");
    			s1.write('player');
Option2:

"file":"http://208.79.203.90/berria/bideoak/bideoa786.mp4",
                        "scaling": 'fit',
                        "duration":"00:22:29"

	'''
    pattern = 'file.*?http://(.*?).mp4'
    matches = re.compile(pattern, re.DOTALL).findall(data)
    scrapertools.printMatches(matches)

    try:
        url = "http://" + matches[0] + ".mp4"
    except:
        url = ""

    title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")
    server = "Directo"

    xbmctools.playvideo(CHANNELCODE, server, url, category, title, thumbnail,
                        plot)
def play(params,url,category):
	xbmc.output("[berriatb.py] play")
	
	# Page downloading
	data = scrapertools.cachePage(url)
	
	##
	## PARSE VIDEO DATA
	##
	'''
Option1:

s1.addParam("flashvars","file=http://208.79.203.90/berria/bideoak/bideoa821.mp4&image=http://208.79.203.90/berria/bideoak/bideoa821.jpg&logo=http://208.79.203.90/berria/logo2_tv.png&stretching=fill&fullscreen=true&autostart=false&duration=17");
    			s1.write('player');
Option2:

"file":"http://208.79.203.90/berria/bideoak/bideoa786.mp4",
                        "scaling": 'fit',
                        "duration":"00:22:29"

	'''
	pattern = 'file.*?http://(.*?).mp4'
	matches = re.compile(pattern,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)
	
	try:
		url = "http://"+matches[0]+".mp4"
	except:
		url = ""
	
	title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
	server = "Directo"

	xbmctools.playvideo(CHANNELCODE,server,url,category,title,thumbnail,plot)
def playVideo_OLD(params,url,category,strmfile=False):
    '''Reproduce el video seleccionado
    En desuso desde los cambios de febrero 2011
    '''
    logger.info("[tvshack.py] playVideo")

    if params.has_key("Serie"):
        serie = params.get("Serie")
    else:
        serie = ""

    if (params.has_key("category")):
        category = params.get("category")

    title = urllib.unquote_plus( params.get("title") )
    if params.has_key("thumbnail"):
        thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    else:
        thumbnail = ''
        
    if params.has_key("plot"):
        plot = params.get("plot")
    else:
        plot = xbmc.getInfoLabel( "ListItem.Plot" )

    server = params["server"]

    if DEBUG:
        logger.info("[tvshack.py] url="+url)
        logger.info("[tvshack.py] title="+title)
        logger.info("[tvshack.py] plot="+plot)
        logger.info("[tvshack.py] thumbnail="+thumbnail)
        logger.info("[tvshack.py] server="+server)

    # Descarga la p�gina
    data = scrapertools.cachePage(url)

    #Averiguamos las partes del video (Puede tener m�s de una)
    partes = re.findall('<a href="javascript:changevid\(([0-9]+)\);"',data)

    # Y el path relativo de los v�deos    
#JUR CAMBIO EN WEB 01/04/2010
#    patronpath = '''(?x)                                    #            Activa opci�n VERBOSE.
#        http://tvshack\.bz/report_video/     #            Basura
#        ([^/]+/[^/]+)                                             # $0 = Path relativo Ej. 'tv/716063'
#        /","report"                                                 #            Basura
#    '''
    patronpath = '''(?x)                                    #            Activa opci�n VERBOSE.
        http://tvshack\.bz/video_load/         #            Basura
        ([^/]+/[^/]+)                                             # $0 = Path relativo Ej. 'tv/716063'
        /'\+part                                                        #            Basura
    '''
    paths=re.findall(patronpath,data)

    #JUR-PROV: De momento voy a considerar los v�deos de 1 s�la parte.
    # Para los v�deos con m�s partes habr� que crear una funci�n especial que
    # pregunte una sola vez y meta todos los v�deos juntos.
    if len(partes) > 1:
        logger.info ("[tvshack] playVideo - Video multiparte - pendiente:" + str(len(partes)))
        dialog = xbmcgui.Dialog()
        dialog.ok('pelisalacarta - tvshack','Este video tiene varias partes.','En esta versi�n de pelisalacarta no est�n soportados.','Eliga otro video con una s�la parte.')
#        for parte in partes:
    elif len(partes) == 1:
        url = 'http://tvshack.bz/video_load/'+paths[0] + '/' + partes[0]
        #Esta URL sigue sin ser un enlace megaupload u otro servidor v�lido por lo que seguimos scrapeando
        # para evitar excesivas selecciones por parte del usuario.

        # Descarga la p�gina
        data2 = scrapertools.cachePage(url)
        if server == 'megavideo':
            dlog ("[tvshack.py]playVideo: Server= megavideo")

            # 
            #Ej.<embed src="http://www.megavideo.com/v/5ZZHOM74...
            patronpath = '''(?x)                                                     #            Activa opci�n VERBOSE.
                <embed\ src="http://www\.megavideo\.com/v/     #            Basura
                (.{8})                                                                             # $0 = url megavideo Ej. '5ZZHOM74'
            '''
            mediaurl=re.findall(patronpath,data2)
            if len (mediaurl) == 0:
                dlog ("[tvshack.py]playVideo: No se encontr� la url de megavideo en:")
                dlog (data2)
                dialog = xbmcgui.Dialog()
                dialog.ok('pelisalacarta - tvshack','No se encontr� el video en megavideo.','Eliga otro video.')
                return
            elif len (mediaurl) > 1:
                dlog ("[tvshack.py]playVideo: Hay m�s de un enlace de megavideo (y no deber�a)")
                for url in mediaurl:
                    dlog (url)
            mediaurl = mediaurl[0]
#            xbmctools.playvideo(CHANNELNAME,server,mediaurl,category,title,thumbnail,plot,Serie=Serie)
            dlog ("[tvshack.py]playVideo: Llamando al play. mediaurl= "+mediaurl)
            xbmctools.playvideo(CHANNELNAME,'Megavideo',mediaurl,category,title,'','',Serie=serie,strmfile=strmfile)
        else: # Video de otro servidor (no megavideo)
            #Probamos si es flash...
            flashmatch = re.search('flashvars="file=(.+?)&type=flv',data2)
            if flashmatch != None:
                dlog ('[tvshack.py]playVideo: Video flash - url = ' + flashmatch.group(1))
                xbmctools.playvideo(CHANNELNAME,'Directo',flashmatch.group(1),category,title,'','',Serie=serie,strmfile=strmfile)
                return
            #Si no, buscamos otras fuentes de video
            othersmatch = re.search('src="([^"]+)"',data2)
            if othersmatch != None and server in ALLOWED_SERVERS:
                url = othersmatch.group(1).replace('&amp;','&')
                xbmctools.playvideo(CHANNELNAME,server,url,category,title,'','',Serie=serie,strmfile=strmfile)
                return

            dlog ("[tvshack.py]playVideo: Servidor no soportado: "+server)
            dialog = xbmcgui.Dialog()
            dialog.ok('pelisalacarta - tvshack - '+server,'El video seleccionado es de '+server,'Ese servidor a�n no est� soportado en TVShack.')
            return
def playVideo(params,url,category,strmfile=False):
    '''Reproduce el video seleccionado
    Actualizado a cambios de febrero 2011
    '''
    logger.info("[tvshack.py] playVideo")

    if params.has_key("Serie"):
        serie = params.get("Serie")
    else:
        serie = ""

    if (params.has_key("category")):
        category = params.get("category")

    title = urllib.unquote_plus( params.get("title") )
    if params.has_key("thumbnail"):
        thumbnail = urllib.unquote_plus( params.get("thumbnail") )
    else:
        thumbnail = ''
        
    if params.has_key("plot"):
        plot = params.get("plot")
    else:
        plot = xbmc.getInfoLabel( "ListItem.Plot" )

    server = params["server"]

    if DEBUG:
        logger.info("[tvshack.py] url="+url)
        logger.info("[tvshack.py] title="+title)
        logger.info("[tvshack.py] plot="+plot)
        logger.info("[tvshack.py] thumbnail="+thumbnail)
        logger.info("[tvshack.py] server="+server)

    # Descarga la página
    data = scrapertools.cachePage(url)

    if server == 'megavideo' or server == 'megaupload':
        dlog ("[tvshack.py]playVideo: Server= megavideo")

            # 
            #Ej. <param name="movie" value="http://wwwstatic.megavideo.com/mv_player.swf?image=http://tvshack.bz/images/splash.jpg&v=HEIFJJ0E">
        patronpath = '''(?x)                                 #            Activa opción VERBOSE.
                &v=                                              #            Basura
                (.{8})">                                         # $0 = url megavideo Ej. '5ZZHOM74' or 'HEIFJJ0E'
            '''
        mediaurl=re.findall(patronpath,data)
        if len (mediaurl) == 0:
            dlog ("[tvshack.py]playVideo: No se encontró la url de megavideo en:")
            dlog (data)
            dialog = xbmcgui.Dialog()
            dialog.ok('pelisalacarta - tvshack','No se encontr� el video en megavideo.','Eliga otro video.')
            return
        elif len (mediaurl) > 1:
            dlog ("[tvshack.py]playVideo: Hay más de un enlace de megavideo (y no debería)")
            for url in mediaurl:
                dlog (url)
        mediaurl = mediaurl[0]
#            xbmctools.playvideo(CHANNELNAME,server,mediaurl,category,title,thumbnail,plot,Serie=Serie)
        dlog ("[tvshack.py]playVideo: Llamando al play. mediaurl= "+mediaurl)
        xbmctools.playvideo(CHANNELNAME,'Megavideo',mediaurl,category,title,'','',Serie=serie,strmfile=strmfile)
    else: # Video de otro servidor (no megavideo)
            #Probamos si es flash...
        flashmatch = re.search('flashvars="file=(.+?)&type=flv',data)
        if flashmatch != None:
            dlog ('[tvshack.py]playVideo: Video flash - url = ' + flashmatch.group(1))
            xbmctools.playvideo(CHANNELNAME,'Directo',flashmatch.group(1),category,title,'','',Serie=serie,strmfile=strmfile)
            return
            #Si no, buscamos otras fuentes de video
        othersmatch = re.search('src="([^"]+)"',data)
        if othersmatch != None and server in ALLOWED_SERVERS:
            url = othersmatch.group(1).replace('&amp;','&')
            xbmctools.playvideo(CHANNELNAME,server,url,category,title,'','',Serie=serie,strmfile=strmfile)
            return

        dlog ("[tvshack.py]playVideo: Servidor no soportado: "+server)
        dialog = xbmcgui.Dialog()
        dialog.ok('pelisalacarta - tvshack - '+server,'El video seleccionado es de '+server,'Ese servidor aún no está soportado en TVShack.')
        return
Beispiel #26
0
def run():
    logger.info("[tvalacarta.py] run")

    # Verifica si el path de usuario del plugin está creado
    if not os.path.exists(config.DATA_PATH):
        logger.debug("[tvalacarta.py] Path de usuario no existe, se crea: " +
                     config.DATA_PATH)
        os.mkdir(config.DATA_PATH)

    # Imprime en el log los parámetros de entrada
    logger.info("[tvalacarta.py] sys.argv=%s" % str(sys.argv))

    # Crea el diccionario de parametros
    params = dict()
    if len(sys.argv) >= 2 and len(sys.argv[2]) > 0:
        params = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
    logger.info("[tvalacarta.py] params=%s" % str(params))

    # Extrae la url de la página
    if (params.has_key("url")):
        url = urllib.unquote_plus(params.get("url"))
    else:
        url = ''

    # Extrae la accion
    if (params.has_key("action")):
        action = params.get("action")
    else:
        action = "selectchannel"

    # Extrae el server
    if (params.has_key("server")):
        server = params.get("server")
    else:
        server = ""

    # Extrae la categoria
    if (params.has_key("category")):
        category = urllib.unquote_plus(params.get("category"))
    else:
        if params.has_key("channel"):
            category = params.get("channel")
        else:
            category = ""

    try:
        # Accion por defecto - elegir canal
        if (action == "selectchannel"):
            import channelselector as plugin
            plugin.listchannels(params, url, category)
        # Actualizar version
        elif (action == "update"):
            try:
                import updater
                updater.update(params)
            except ImportError:
                logger.info(
                    "[pelisalacarta.py] Actualizacion automática desactivada")

            import channelselector as plugin
            plugin.listchannels(params, url, category)

        # El resto de acciones vienen en el parámetro "action", y el canal en el parámetro "channel"
        else:
            if action == "mainlist" and config.get_setting(
                    "updatechannels") == "true":
                from core import downloadtools
                actualizado = downloadtools.updatechannel(
                    params.get("channel"))

                if actualizado:
                    import xbmcgui
                    advertencia = xbmcgui.Dialog()
                    advertencia.ok("pelisalacarta", params.get("channel"),
                                   config.get_localized_string(30063))

            exec "import tvalacarta.channels." + params.get(
                "channel") + " as channel"
            generico = False
            try:
                generico = channel.isGeneric()
            except:
                generico = False

            print "generico=", generico

            if not generico:
                exec "channel." + action + "(params, url, category)"
            else:
                if params.has_key("title"):
                    title = urllib.unquote_plus(params.get("title"))
                else:
                    title = ""
                if params.has_key("thumbnail"):
                    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
                else:
                    thumbnail = ""
                if params.has_key("plot"):
                    plot = urllib.unquote_plus(params.get("plot"))
                else:
                    plot = ""
                if params.has_key("server"):
                    server = urllib.unquote_plus(params.get("server"))
                else:
                    server = "directo"
                if params.has_key("extradata"):
                    extra = urllib.unquote_plus(params.get("extradata"))
                else:
                    extra = ""

                from core import xbmctools
                if action == "play":
                    xbmctools.playvideo(params.get("channel"), server, url,
                                        category, title, thumbnail, plot)
                else:
                    from core.item import Item
                    item = Item(channel=params.get("channel"),
                                title=title,
                                url=url,
                                thumbnail=thumbnail,
                                plot=plot,
                                server=server,
                                extra=extra)

                    exec "itemlist = channel." + action + "(item)"
                    xbmctools.renderItems(itemlist, params, url, category)

    except urllib2.URLError, e:
        import xbmcgui
        ventana_error = xbmcgui.Dialog()
        # Agarra los errores surgidos localmente enviados por las librerias internas
        if hasattr(e, 'reason'):
            logger.info("Razon del error, codigo: %d , Razon: %s" %
                        (e.reason[0], e.reason[1]))
            texto = config.get_localized_string(
                30050)  # "No se puede conectar con el sitio web"
            ok = ventana_error.ok("tvalacarta", texto)
        # Agarra los errores con codigo de respuesta del servidor externo solicitado
        elif hasattr(e, 'code'):
            logger.info("codigo de error HTTP : %d" % e.code)
            texto = (
                config.get_localized_string(30051) % e.code
            )  # "El sitio web no funciona correctamente (error http %d)"
            ok = ventana_error.ok("tvalacarta", texto)
        else:
            pass
Beispiel #27
0
def strm_detail(item):
    logger.info("[moviezet.py] strm_detail")
    from core import xbmctools
    import xbmc
    
    code =""
    if (item.url.startswith("http://www.cuevana.tv/list_search_info.php")):
        data = scrapertools.cachePage(item.url)
        patron = "window.location\='/series/([0-9]+)/"
        matches = re.compile(patron,re.DOTALL).findall(data)
        if len(matches)>0:
            code = matches[0]
        logger.info("code="+code)
        url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&tipo=s&sub_pre=ES" % matches[0]
        serieOpelicula = True
    else:
        logger.info("url1="+item.url)
        patron = "http://www.cuevana.tv/peliculas/([0-9]+)/"
        matches = re.compile(patron,re.DOTALL).findall(item.url)
        if len(matches)>0:
            code = matches[0]
        logger.info("code="+code)
        url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&sub_pre=ES#" % code
        serieOpelicula = False
    
    logger.info("url2="+url)
    data = scrapertools.cachePage(url)

    # goSource('ee5533f50eab1ef355661eef3b9b90ec','megaupload')
    patron = "goSource\('([^']+)','megaupload'\)"
    matches = re.compile(patron,re.DOTALL).findall(data)
    if len(matches)>0:
        data = scrapertools.cachePagePost("http://www.cuevana.tv/player/source_get","key=%s&host=megaupload&vars=&id=2933&subs=,ES&tipo=&amp;sub_pre=ES" % matches[0])
    logger.info("data="+data)

    # Subtitulos
    if serieOpelicula:
        suburl = "http://www.cuevana.tv/files/s/sub/"+code+"_ES.srt"
    else:
        suburl = "http://www.cuevana.tv/files/sub/"+code+"_ES.srt"
    logger.info("suburl="+suburl)
    
    # Elimina el archivo subtitulo.srt de alguna reproduccion anterior
    ficherosubtitulo = os.path.join( config.get_data_path(), 'subtitulo.srt' )
    if os.path.exists(ficherosubtitulo):
        try:
          os.remove(ficherosubtitulo)
        except IOError:
          logger.info("Error al eliminar el archivo subtitulo.srt "+ficherosubtitulo)
          raise

    from core import downloadtools
    downloadtools.downloadfile(suburl, ficherosubtitulo )
    config.set_setting("subtitulo","true")

    listavideos = servertools.findvideos(data)
    
    for video in listavideos:
        server = video[2]
        if server == "Megaupload":
            scrapedtitle = item.title + " [" + server + "]"
            scrapedurl = video[1]
            thumbnail = urllib.unquote_plus( item.thumbnail )
            plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
            xbmctools.playvideo(CHANNELNAME,server,scrapedurl,"Series",scrapedtitle,item.thumbnail,item.plot,strmfile=True,subtitle=suburl)
            exit
    logger.info("[moviezet.py] strm_detail fin")
    return
def run():
    import sys
    logger.info("[tvalacarta.py] run")
    
    # Verifica si el path de usuario del plugin está creado
    if not os.path.exists(config.get_data_path()):
        logger.debug("[tvalacarta.py] Path de usuario no existe, se crea: "+config.get_data_path())
        os.mkdir(config.get_data_path())

    # Imprime en el log los parámetros de entrada
    logger.info("[tvalacarta.py] sys.argv=%s" % str(sys.argv))
    
    # Crea el diccionario de parametros
    params = dict()
    if len(sys.argv)>=2 and len(sys.argv[2])>0:
        params = dict(part.split('=') for part in sys.argv[ 2 ][ 1: ].split('&'))
    logger.info("[tvalacarta.py] params=%s" % str(params))
    
    # Extrae la url de la página
    if (params.has_key("url")):
        url = urllib.unquote_plus( params.get("url") )
    else:
        url=''

    # Extrae la accion
    if (params.has_key("action")):
        action = params.get("action")
    else:
        action = "selectchannel"

    # Extrae el server
    if (params.has_key("server")):
        server = params.get("server")
    else:
        server = ""

    # Extrae la categoria
    if (params.has_key("category")):
        category = urllib.unquote_plus( params.get("category") )
    else:
        if params.has_key("channel"):
            category = params.get("channel")
        else:
            category = ""


    try:
        # Accion por defecto - elegir canal
        if ( action=="selectchannel" ):
            
            if config.get_setting("updatechannels")=="true":
                try:
                    from core import updater
                    actualizado = updater.updatechannel("channelselector")

                    if actualizado:
                        import xbmcgui
                        advertencia = xbmcgui.Dialog()
                        advertencia.ok("tvalacarta",config.get_localized_string(30064))
                except:
                    pass

            import channelselector as plugin
            plugin.mainlist(params, url, category)

        # Actualizar version
        elif ( action=="update" ):
            try:
                from core import updater
                updater.update(params)
            except ImportError:
                logger.info("[pelisalacarta.py] Actualizacion automática desactivada")

            import channelselector as plugin
            plugin.listchannels(params, url, category)

        elif (action=="channeltypes"):
            import channelselector as plugin
            plugin.channeltypes(params,url,category)

        elif (action=="listchannels"):
            import channelselector as plugin
            plugin.listchannels(params,url,category)

        # El resto de acciones vienen en el parámetro "action", y el canal en el parámetro "channel"
        else:
            if action=="mainlist" and config.get_setting("updatechannels")=="true":
                try:
                    from core import updater
                    actualizado = updater.updatechannel(params.get("channel"))

                    if actualizado:
                        import xbmcgui
                        advertencia = xbmcgui.Dialog()
                        advertencia.ok("plugin",params.get("channel"),config.get_localized_string(30063))
                except:
                    pass

            # La acción puede estar en el core, o ser un canal regular. El buscador es un canal especial que está en pelisalacarta
            regular_channel_path = os.path.join( config.get_runtime_path(), PLUGIN_NAME , 'channels' , params.get("channel")+".py" )
            core_channel_path = os.path.join( config.get_runtime_path(), 'core' , params.get("channel")+".py" )

            if params.get("channel")=="buscador":
                import pelisalacarta.buscador as channel
            elif os.path.exists( regular_channel_path ):
                exec "import pelisalacarta.channels."+params.get("channel")+" as channel"
            elif os.path.exists( core_channel_path ):
                exec "from core import "+params.get("channel")+" as channel"

            generico = False
            # Esto lo he puesto asi porque el buscador puede ser generico o normal, esto estará asi hasta que todos los canales sean genericos 
            if category == "Buscador_Generico":
                generico = True
            else:
                try:
                    generico = channel.isGeneric()
                except:
                    generico = False

            print "generico=" , generico 
            
            if not generico:
                exec "channel."+action+"(params, url, category)"
            else:
                if params.has_key("title"):
                    title = urllib.unquote_plus( params.get("title") )
                else:
                    title = ""
                if params.has_key("thumbnail"):
                    thumbnail = urllib.unquote_plus( params.get("thumbnail") )
                else:
                    thumbnail = ""
                if params.has_key("plot"):
                    plot = urllib.unquote_plus( params.get("plot") )
                else:
                    plot = ""
                if params.has_key("server"):
                    server = urllib.unquote_plus( params.get("server") )
                else:
                    server = "directo"
                if params.has_key("extradata"):
                    extra = urllib.unquote_plus( params.get("extradata") )
                else:
                    extra = ""
                if params.has_key("subtitle"):
                    subtitle = urllib.unquote_plus( params.get("subtitle") )
                else:
                    subtitle = ""
            
                from core.item import Item
                item = Item(channel=params.get("channel"), title=title , url=url, thumbnail=thumbnail , plot=plot , server=server, category=category, extra=extra, subtitle=subtitle)

                if item.subtitle!="":
                    logger.info("Descargando subtítulos de "+item.subtitle)
                    from core import downloadtools
                    
                    ficherosubtitulo = os.path.join( config.get_data_path() , "subtitulo.srt" )
                    if os.path.exists(ficherosubtitulo):
                        os.remove(ficherosubtitulo)

                    downloadtools.downloadfile(item.subtitle, ficherosubtitulo )
                    config.set_setting("subtitulo","true")
                else:
                    logger.info("Sin subtitulos")

                from core import xbmctools
                if action=="play":
                    # Si el canal tiene una acción "play" tiene prioridad
                    try:
                        itemlist = channel.play(item)
                        if len(itemlist)>0:
                            item = itemlist[0]
                    except:
                        import sys
                        for line in sys.exc_info():
                            logger.error( "%s" % line )
                   
                    xbmctools.playvideo(params.get("channel"),item.server,item.url,item.category,item.title,item.thumbnail,item.plot,subtitle=item.subtitle)
                else:
                    if action!="findvideos":
                        exec "itemlist = channel."+action+"(item)"
                    else:
                        # Intenta ejecutar una posible funcion "findvideos" del canal
                        try:
                            exec "itemlist = channel."+action+"(item)"
                        # Si no funciona, lanza el método genérico para detectar vídeos
                        except:
                            itemlist = findvideos(item)

                    xbmctools.renderItems(itemlist, params, url, category)

    except urllib2.URLError,e:
        import sys
        for line in sys.exc_info():
            logger.error( "%s" % line )
        import xbmcgui
        ventana_error = xbmcgui.Dialog()
        # Agarra los errores surgidos localmente enviados por las librerias internas
        if hasattr(e, 'reason'):
            logger.info("Razon del error, codigo: %d , Razon: %s" %(e.reason[0],e.reason[1]))
            texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web"
            ok = ventana_error.ok ("plugin", texto)
        # Agarra los errores con codigo de respuesta del servidor externo solicitado     
        elif hasattr(e,'code'):
            logger.info("codigo de error HTTP : %d" %e.code)
            texto = (config.get_localized_string(30051) % e.code) # "El sitio web no funciona correctamente (error http %d)"
            ok = ventana_error.ok ("plugin", texto)    
def strm_detail(item):
    logger.info("[cuevana.py] strm_detail")
    code =""
    if (item.url.startswith("http://www.cuevana.tv/list_search_info.php")):
        data = scrapertools.cachePage(item.url)
        patron = "window.location\='/series/([0-9]+)/"
        matches = re.compile(patron,re.DOTALL).findall(data)
        if len(matches)>0:
            code = matches[0]
        logger.info("code="+code)
        url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&tipo=s&sub_pre=ES" % matches[0]
        serieOpelicula = True
    else:
        logger.info("url1="+item.url)
        patron = "http://www.cuevana.tv/peliculas/([0-9]+)/"
        matches = re.compile(patron,re.DOTALL).findall(item.url)
        if len(matches)>0:
            code = matches[0]
        logger.info("code="+code)
        url = "http://www.cuevana.tv/player/source?id=%s&subs=,ES&onstart=yes&sub_pre=ES#" % code
        serieOpelicula = False
    
    logger.info("url2="+url)
    data = scrapertools.cachePage(url)

    # goSource('ee5533f50eab1ef355661eef3b9b90ec','megaupload')
    patron = "goSource\('([^']+)','megaupload'\)"
    matches = re.compile(patron,re.DOTALL).findall(data)
    if len(matches)>0:
        data = scrapertools.cachePagePost("http://www.cuevana.tv/player/source_get","key=%s&host=megaupload&vars=&id=2933&subs=,ES&tipo=&amp;sub_pre=ES" % matches[0])
    logger.info("data="+data)

    # Subtitulos
    if serieOpelicula:
        suburl = "http://www.cuevana.tv/files/s/sub/"+code+"_ES.srt"
    else:
        suburl = "http://www.cuevana.tv/files/sub/"+code+"_ES.srt"
    logger.info("suburl="+suburl)
    
    # Elimina el archivo subtitulo.srt de alguna reproduccion anterior
    ficherosubtitulo = os.path.join( config.get_data_path(), 'subtitulo.srt' )
    if os.path.exists(ficherosubtitulo):
        try:
          os.remove(ficherosubtitulo)
        except IOError:
          xbmc.output("Error al eliminar el archivo subtitulo.srt "+ficherosubtitulo)
          raise

    from core import downloadtools
    downloadtools.downloadfile(suburl, ficherosubtitulo )
    config.set_setting("subtitulo","true")

    listavideos = servertools.findvideos(data)
    
    for video in listavideos:
        server = video[2]
        if server == "Megaupload":
          scrapedtitle = item.title + " [" + server + "]"
          scrapedurl = video[1]
          thumbnail = urllib.unquote_plus( item.thumbnail )
          plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
          # xbmctools.playvideo("cuevana","megaupload","G0NMCIXJ","Series","24","","",strmfile=True)
          xbmctools.playvideo(CHANNELNAME,server,scrapedurl,"Series",scrapedtitle,item.thumbnail,item.plot,strmfile=True,subtitle=suburl)
          exit
    logger.info("[cuevana.py] strm_detail fin")
    return
Beispiel #30
0
def run():
	logger.info("[tvalacarta.py] run")
	
	# Verifica si el path de usuario del plugin está creado
	if not os.path.exists(config.DATA_PATH):
		logger.debug("[tvalacarta.py] Path de usuario no existe, se crea: "+config.DATA_PATH)
		os.mkdir(config.DATA_PATH)

	# Imprime en el log los parámetros de entrada
	logger.info("[tvalacarta.py] sys.argv=%s" % str(sys.argv))
	
	# Crea el diccionario de parametros
	params = dict()
	if len(sys.argv)>=2 and len(sys.argv[2])>0:
		params = dict(part.split('=') for part in sys.argv[ 2 ][ 1: ].split('&'))
	logger.info("[tvalacarta.py] params=%s" % str(params))
	
	# Extrae la url de la página
	if (params.has_key("url")):
		url = urllib.unquote_plus( params.get("url") )
	else:
		url=''

	# Extrae la accion
	if (params.has_key("action")):
		action = params.get("action")
	else:
		action = "selectchannel"

	# Extrae el server
	if (params.has_key("server")):
		server = params.get("server")
	else:
		server = ""

	# Extrae la categoria
	if (params.has_key("category")):
		category = urllib.unquote_plus( params.get("category") )
	else:
		if params.has_key("channel"):
			category = params.get("channel")
		else:
			category = ""


	try:
		# Accion por defecto - elegir canal
		if ( action=="selectchannel" ):
			import channelselector as plugin
			plugin.listchannels(params, url, category)
		# Actualizar version
		elif ( action=="update" ):
			try:
				import updater
				updater.update(params)
			except ImportError:
				logger.info("[pelisalacarta.py] Actualizacion automática desactivada")

			import channelselector as plugin
			plugin.listchannels(params, url, category)

		# El resto de acciones vienen en el parámetro "action", y el canal en el parámetro "channel"
		else:
			if action=="mainlist" and config.get_setting("updatechannels")=="true":
				from core import downloadtools
				actualizado = downloadtools.updatechannel(params.get("channel"))

				if actualizado:
					import xbmcgui
					advertencia = xbmcgui.Dialog()
					advertencia.ok("pelisalacarta",params.get("channel"),config.get_localized_string(30063))

			exec "import tvalacarta.channels."+params.get("channel")+" as channel"
			generico = False
			try:
				generico = channel.isGeneric()
			except:
				generico = False

			print "generico=" , generico 
			
			if not generico:
				exec "channel."+action+"(params, url, category)"
			else:
				if params.has_key("title"):
					title = urllib.unquote_plus( params.get("title") )
				else:
					title = ""
				if params.has_key("thumbnail"):
					thumbnail = urllib.unquote_plus( params.get("thumbnail") )
				else:
					thumbnail = ""
				if params.has_key("plot"):
					plot = urllib.unquote_plus( params.get("plot") )
				else:
					plot = ""
				if params.has_key("server"):
					server = urllib.unquote_plus( params.get("server") )
				else:
					server = "directo"
				if params.has_key("extradata"):
					extra = urllib.unquote_plus( params.get("extradata") )
				else:
					extra = ""
			
				from core import xbmctools
				if action=="play":
					xbmctools.playvideo(params.get("channel"),server,url,category,title,thumbnail,plot)
				else:
					from core.item import Item
					item = Item(channel=params.get("channel"), title=title , url=url, thumbnail=thumbnail , plot=plot , server=server, extra=extra)
		
					exec "itemlist = channel."+action+"(item)"
					xbmctools.renderItems(itemlist, params, url, category)

	except urllib2.URLError,e:
		import xbmcgui
		ventana_error = xbmcgui.Dialog()
		# Agarra los errores surgidos localmente enviados por las librerias internas
		if hasattr(e, 'reason'):
			logger.info("Razon del error, codigo: %d , Razon: %s" %(e.reason[0],e.reason[1]))
			texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web"
			ok = ventana_error.ok ("tvalacarta", texto)
		# Agarra los errores con codigo de respuesta del servidor externo solicitado 	
		elif hasattr(e,'code'):
			logger.info("codigo de error HTTP : %d" %e.code)
			texto = (config.get_localized_string(30051) % e.code) # "El sitio web no funciona correctamente (error http %d)"
			ok = ventana_error.ok ("tvalacarta", texto)	
		else:
			pass