示例#1
0
 def onAction(self, action):
     #exit
     global main
     if action.getId() == 92 or action.getId() == 10:
         main.close()
         del main
     if action.getId() == 117:
         config.open_settings()
示例#2
0
def mainlist(params,url="",category=""):
    global CHANNELNAME
    logger.info("[configuracion.py] mainlist")
    
    config.open_settings( )

    CHANNELNAME = params.url.split("/")[0]
    return respuesta()
示例#3
0
def mainlist(params, url="", category=""):
    global CHANNELNAME
    logger.info("[configuracion.py] mainlist")

    config.open_settings()

    CHANNELNAME = params.url.split("/")[0]
    return respuesta()
示例#4
0
def openconfig(item):
    if config.get_library_support():
        config.open_settings()

    if "kodi" in config.get_platform():
        import xbmc
        xbmc.executebuiltin("Container.Refresh")        
    return []
def mainlist(params,url,category):
    logger.info("[configuracion.py] mainlist")
    
    # Verifica ruta de descargas
    downloadtools.getDownloadPath()
    downloadtools.getDownloadListPath()

    config.open_settings( )
def mainlist(item):
    logger.info("[configuracion.py] mainlist")
    
    if config.get_setting("usepassword") =="true":
      import guitools
      password = guitools.Keyboard("", "Escriba la contraseña", True)
      if password == config.get_setting("password"):
        config.open_settings()
      else:
        guitools.Dialog_OK("Error", "La contraseña no es correcta")
    else:
      config.open_settings()
def mainlist(item):
    logger.info("[configuracion.py] mainlist")

    if config.get_setting("usepassword") == "true":
        import guitools
        password = guitools.Keyboard("", "Escriba la contraseña", True)
        if password == config.get_setting("password"):
            config.open_settings()
        else:
            guitools.Dialog_OK("Error", "La contraseña no es correcta")
    else:
        config.open_settings()
def favorites(item):
    if item.url == '':
        username = config.get_setting("justin_login")
    else:
        username = item.url
    if username == "":
        LoginEmpty()
        config.open_settings()
        item.url = config.get_setting("justin_login")
        if item.url == '':return
        favorites(item)
        return 
    item.title = "favorites"
    if config.get_setting('streamlive')=='true':
        livetrue='&live=true'
    else:
        livetrue = ''
    item.url = 'http://api.justin.tv/api/user/favorites/'+str(username)+'.json?offset=0&limit='+str(limit)+livetrue
    itemlist = getlistchannel(item)
    if not livetrue:
        return itemlist
    xbmctools.renderItems(itemlist, [], '', 'Movies',isPlayable='true')
    return 
示例#9
0
def favorites(item):
    if item.url == '':
        username = config.get_setting("justin_login")
    else:
        username = item.url
    if username == "":
        LoginEmpty()
        config.open_settings()
        item.url = config.get_setting("justin_login")
        if item.url == '': return
        favorites(item)
        return
    item.title = "favorites"
    if config.get_setting('streamlive') == 'true':
        livetrue = '&live=true'
    else:
        livetrue = ''
    item.url = 'http://api.justin.tv/api/user/favorites/' + str(
        username) + '.json?offset=0&limit=' + str(limit) + livetrue
    itemlist = getlistchannel(item)
    if not livetrue:
        return itemlist
    xbmctools.renderItems(itemlist, [], '', 'Movies', isPlayable='true')
    return
示例#10
0
def mainlist(params, url, category):
    logger.info("[configuracion.py] mainlist")

    config.open_settings()
def settings(item):
    config.open_settings()
示例#12
0
def settingCanal(item):

    if config.OLD_PLATFORM:
        config.open_settings()
    else:
        return platformtools.show_channel_settings()
示例#13
0
def openconfig(item):
    config.open_settings( )
    return []
示例#14
0
def settingCanal(item):

    if config.OLD_PLATFORM:
        config.open_settings()
    else:
        return platformtools.show_channel_settings()
示例#15
0
def openconfig(item):
    if config.get_library_support():
        config.open_settings( )
    return []
示例#16
0
def openconfig(item):
    logger.info("simpletv.openconfig")
    if "xbmc" in config.get_platform() or "boxee" in config.get_platform():
        config.open_settings()
    return []
示例#17
0
def openconfig(item):
    logger.info("simpletv.openconfig")
    if "xbmc" in config.get_platform() or "boxee" in config.get_platform():
        config.open_settings( )
    return []
示例#18
0
def openconfig(item):
    if "xbmc" in config.get_platform() or "boxee" in config.get_platform():
        config.open_settings()
    return []
def mainlist(params,url,category):
    logger.info("[configuracion.py] mainlist")
    
    config.open_settings( )
示例#20
0
def mainlist(item):
    logger.info("[configuracion.py] mainlist")
    
    config.open_settings( )
示例#21
0
def mainlist(item):
    logger.info("[configuracion.py] mainlist")

    config.open_settings()
示例#22
0
def openconfig(item):
    if config.get_library_support():
        config.open_settings()
    return []
示例#23
0
def settings(item):
    config.open_settings()
示例#24
0
def run():
    logger.info("[launcher.py] run")
    
    # Extract parameters from sys.argv
    params, channel_name, title, fulltitle, url, thumbnail, plot, action, server, extra, subtitle, category, show, password = extract_parameters()
    logger.info("[launcher.py] channel_name=%s, title=%s, fulltitle=%s, url=%s, thumbnail=%s, plot=%s, action=%s, server=%s, extra=%s, subtitle=%s, category=%s, show=%s, password=%s" % (channel_name, title, fulltitle, url, thumbnail, plot, action, server, extra, subtitle, category, show, password))

    from core.item import Item
    item = Item(channel=channel_name, title=title , fulltitle=fulltitle, url=url, thumbnail=thumbnail , plot=plot , server=server, category=category, extra=extra, subtitle=subtitle, show=show, password=password)

    try:
        # Actualizar version
        if ( action=="configuracion" ):
            logger.info("[launcher.py] configuracion")
            config.open_settings( )

        elif ( action=="vacio" ):
            logger.info("[launcher.py] vacio")

        elif action=="play":
            import channel
            generico = True
            itemlist = channel.play(item)
            if len(itemlist)==0:
                return
            elif len(itemlist)==1:

                item = itemlist[0]

                if item.url.lower().endswith(".jpg") or item.url.lower().endswith(".png"):
                    import os
                    slideshowpath = os.path.join(config.get_data_path(),"slideshow")
                    if not os.path.exists(slideshowpath):
                        try:
                            os.mkdir(slideshowpath)
                        except:
                            pass

                    urllib.urlretrieve(item.url, os.path.join(slideshowpath,"temp.jpg"))
                    import xbmc
                    xbmc.executebuiltin( "SlideShow("+slideshowpath+")" )
                else:
                    import xbmcplugin,xbmcgui,xbmc,xbmcaddon,sys
                    xlistitem = xbmcgui.ListItem( item.title, iconImage="DefaultVideo.png", thumbnailImage=item.thumbnail, path=item.url)
                    xlistitem.setInfo( "video", { "Title": item.title, "Plot" : item.plot , "Genre" : item.category } )

                    #xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=item.url))

                    # Añadimos el listitem a una lista de reproducción (playlist)
                    playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
                    playlist.clear()
                    playlist.add( item.url, xlistitem )

                    # Reproduce
                    xbmcPlayer = xbmc.Player()
                    xbmcPlayer.play(playlist)

                return

        # if other action
        # OR
        # len(itemlist)>1 for action=="play":

        import channel
        generico = True

        if action=="search":
            logger.info("[launcher.py] search")
            import xbmc
            keyboard = xbmc.Keyboard("")
            keyboard.doModal()
            if (keyboard.isConfirmed()):
                tecleado = keyboard.getText()
                tecleado = tecleado.replace(" ", "+")
                itemlist = channel.search(item,tecleado)
            else:
                itemlist = []

        else:
            exec "itemlist = channel."+action+"(item)"

        # Activa el modo biblioteca
        #import xbmcplugin
        #import sys
        #handle = sys.argv[1]
        #xbmcplugin.setContent(int( handle ),"movies")

        # Añade los items a la lista de XBMC

        import xbmctools
        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.code,e.reason))
            texto = "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 = ("El sitio web no funciona correctamente (error http %d)" % e.code)
            ok = ventana_error.ok ("plugin", texto)    
def openconfig(item):
    if "xbmc" in config.get_platform() or "boxee" in config.get_platform():
        config.open_settings( )
    return []
示例#26
0
def run():
    logger.info("[launcher.py] run")

    # Extract parameters from sys.argv
    params, channel_name, title, fulltitle, url, thumbnail, plot, action, server, extra, subtitle, category, show, password = extract_parameters(
    )
    logger.info(
        "[launcher.py] channel_name=%s, title=%s, fulltitle=%s, url=%s, thumbnail=%s, plot=%s, action=%s, server=%s, extra=%s, subtitle=%s, category=%s, show=%s, password=%s"
        % (channel_name, title, fulltitle, url, thumbnail, plot, action,
           server, extra, subtitle, category, show, password))

    from core.item import Item
    item = Item(channel=channel_name,
                title=title,
                fulltitle=fulltitle,
                url=url,
                thumbnail=thumbnail,
                plot=plot,
                server=server,
                category=category,
                extra=extra,
                subtitle=subtitle,
                show=show,
                password=password)

    try:
        # Actualizar version
        if (action == "configuracion"):
            logger.info("[launcher.py] configuracion")
            config.open_settings()

        elif (action == "vacio"):
            logger.info("[launcher.py] vacio")

        elif action == "play":
            import channel
            generico = True
            itemlist = channel.play(item)
            if len(itemlist) == 0:
                return
            item = itemlist[0]

            if item.url.lower().endswith(".jpg") or item.url.lower().endswith(
                    ".png"):
                import os
                slideshowpath = os.path.join(config.get_data_path(),
                                             "slideshow")
                if not os.path.exists(slideshowpath):
                    try:
                        os.mkdir(slideshowpath)
                    except:
                        pass

                urllib.urlretrieve(item.url,
                                   os.path.join(slideshowpath, "temp.jpg"))
                import xbmc
                xbmc.executebuiltin("SlideShow(" + slideshowpath + ")")
            else:
                import xbmcplugin, xbmcgui, xbmc, xbmcaddon, sys
                xlistitem = xbmcgui.ListItem(item.title,
                                             iconImage="DefaultVideo.png",
                                             thumbnailImage=item.thumbnail,
                                             path=item.url)
                xlistitem.setInfo("video", {
                    "Title": item.title,
                    "Plot": item.plot,
                    "Genre": item.category
                })

                #xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=item.url))

                # Añadimos el listitem a una lista de reproducción (playlist)
                playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
                playlist.clear()
                playlist.add(item.url, xlistitem)

                # Reproduce
                xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO)
                xbmcPlayer.play(playlist)

        else:
            import channel
            generico = True

            if action == "search":
                logger.info("[launcher.py] search")
                import xbmc
                keyboard = xbmc.Keyboard("")
                keyboard.doModal()
                if (keyboard.isConfirmed()):
                    tecleado = keyboard.getText()
                    tecleado = tecleado.replace(" ", "+")
                    itemlist = channel.search(item, tecleado)
                else:
                    itemlist = []

            else:
                exec "itemlist = channel." + action + "(item)"

            # Activa el modo biblioteca
            #import xbmcplugin
            #import sys
            #handle = sys.argv[1]
            #xbmcplugin.setContent(int( handle ),"movies")

            # Añade los items a la lista de XBMC

            import xbmctools
            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 = "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 = ("El sitio web no funciona correctamente (error http %d)" %
                     e.code)
            ok = ventana_error.ok("plugin", texto)