Exemplo n.º 1
0
def setting_channel(item):
    channels_path = os.path.join(config.get_runtime_path(), "channels",
                                 '*.json')
    channel_language = config.get_setting("channel_language", default="auto")
    if channel_language == 'auto':
        channel_language = auto_filter()

    list_controls = []
    for infile in sorted(glob.glob(channels_path)):
        channel_id = os.path.basename(infile)[:-5]
        channel_parameters = channeltools.get_channel_parameters(channel_id)

        # Do not include if it is an inactive channel
        if not channel_parameters["active"]:
            continue

        # Do not include if the channel is in a filtered language
        if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \
                and "*" not in channel_parameters["language"]:
            continue

        # Do not include if the channel does not exist 'include_in_newest' in your configuration
        include_in_newest = config.get_setting(
            "include_in_newest_" + item.extra, channel_id)
        if include_in_newest is None:
            continue

        control = {
            'id': channel_id,
            'type': "bool",
            'label': channel_parameters["title"],
            'default': include_in_newest,
            'enabled': True,
            'visible': True
        }

        list_controls.append(control)

    caption = config.get_localized_string(60533) + item.title.replace(
        config.get_localized_string(60525), "- ").strip()
    if config.get_setting("custom_button_value_news", item.channel):
        custom_button_label = config.get_localized_string(59992)
    else:
        custom_button_label = config.get_localized_string(59991)

    return platformtools.show_channel_settings(list_controls=list_controls,
                                               caption=caption,
                                               callback="save_settings",
                                               item=item,
                                               custom_button={
                                                   'visible': True,
                                                   'function':
                                                   "cb_custom_button",
                                                   'close': False,
                                                   'label': custom_button_label
                                               })
Exemplo n.º 2
0
def get_channels_list():
    logger.info()

    list_canales = {
        'peliculas': [],
        '4k': [],
        'terror': [],
        'infantiles': [],
        'series': [],
        'anime': [],
        'castellano': [],
        'latino': [],
        'italiano': [],
        'torrent': [],
        'documentales': []
    }
    any_active = False
    # Rellenar listas de canales disponibles
    channels_path = os.path.join(config.get_runtime_path(), "channels",
                                 '*.json')
    channel_language = config.get_setting("channel_language", default="all")
    if channel_language == "auto":
        channel_language = auto_filter()

    for infile in sorted(glob.glob(channels_path)):
        channel_id = os.path.basename(infile)[:-5]
        channel_parameters = channeltools.get_channel_parameters(channel_id)

        # No incluir si es un canal inactivo
        if not channel_parameters["active"]:
            continue

        # No incluir si es un canal para adultos, y el modo adulto está desactivado
        if channel_parameters["adult"] and config.get_setting(
                "adult_mode") == 0:
            continue

        # No incluir si el canal es en un idioma filtrado
        if channel_language != "all" and channel_language not in channel_parameters["language"] \
                and "*" not in channel_parameters["language"]:
            continue

        # Incluir en cada categoria, si en su configuracion el canal esta activado para mostrar novedades

        for categoria in list_canales:
            include_in_newest = config.get_setting(
                "include_in_newest_" + categoria, channel_id)
            if include_in_newest:
                channels_id_name[channel_id] = channel_parameters["title"]
                list_canales[categoria].append(
                    (channel_id, channel_parameters["title"]))
                any_active = True

    return list_canales, any_active
Exemplo n.º 3
0
def setting_channel_old(item):
    channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json')
    # channel_language = config.get_setting("channel_language", default="all")
    channel_language = auto_filter()

    list_controls = []
    for infile in sorted(glob.glob(channels_path)):
        channel_name = os.path.basename(infile)[:-5]
        channel_parameters = channeltools.get_channel_parameters(channel_name)

        # No incluir si es un canal inactivo
        if not channel_parameters["active"]:
            continue

        # No incluir si es un canal para adultos, y el modo adulto está desactivado
        if channel_parameters["adult"] and config.get_setting("adult_mode") == 0:
            continue

        # No incluir si el canal es en un idioma filtrado
        if channel_language != "all" and channel_language not in channel_parameters["language"] \
                and "*" not in channel_parameters["language"]:
            continue

        # No incluir si en la configuracion del canal no existe "include_in_global_search"
        include_in_global_search = channel_parameters["include_in_global_search"]

        if not include_in_global_search:
            continue
        else:
            # Se busca en la configuración del canal el valor guardado
            include_in_global_search = config.get_setting("include_in_global_search", channel_name)

        control = {'id': channel_name,
                   'type': "bool",
                   'label': channel_parameters["title"],
                   'default': include_in_global_search,
                   'enabled': True,
                   'visible': True}

        list_controls.append(control)

    if config.get_setting("custom_button_value", item.channel):
        custom_button_label = config.get_localized_string(59992)
    else:
        custom_button_label = config.get_localized_string(59991)

    return platformtools.show_channel_settings(list_controls=list_controls,
                                               caption=config.get_localized_string(59990),
                                               callback="save_settings", item=item,
                                               custom_button={'visible': True,
                                                              'function': "cb_custom_button",
                                                              'close': False,
                                                              'label': custom_button_label})
Exemplo n.º 4
0
def get_channels_list():
    logger.debug()
    ##    import web_pdb; web_pdb.set_trace()
    ##    list_canales = {'peliculas': [], '4k': [], 'terror': [], 'infantiles': [], 'series': [], 'anime': [],
    ##                    'castellano': [], 'latino':[], 'italiano':[], 'torrent':[], 'documentales': []}
    list_canales = {
        'peliculas': [],
        'series': [],
        'anime': [],
        'documentales': []
    }

    any_active = False
    # Fill available channel lists
    channels_path = os.path.join(config.get_runtime_path(), "channels",
                                 '*.json')
    channel_language = config.get_setting("channel_language", default="all")
    if channel_language == "auto":
        channel_language = auto_filter()

    for infile in sorted(glob.glob(channels_path)):
        channel_id = os.path.basename(infile)[:-5]
        channel_parameters = channeltools.get_channel_parameters(channel_id)

        # Do not include if it is an inactive channel
        if not channel_parameters["active"]:
            continue

        # Do not include if the channel is in a filtered language
        if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \
                and "*" not in channel_parameters["language"]:
            continue

        # Include in each category, if in your configuration the channel is activated to show news

        for categoria in list_canales:
            include_in_newest = config.get_setting(
                "include_in_newest_" + categoria, channel_id)
            if include_in_newest:
                channels_id_name[channel_id] = channel_parameters["title"]
                list_canales[categoria].append(
                    (channel_id, channel_parameters["title"]))
                any_active = True

    return list_canales, any_active
Exemplo n.º 5
0
def do_search(item, categories=None):
    logger.info("blaa categorias %s" % categories)

    if item.contextual == True:
        categories = ["Películas"]
        setting_item = Item(channel=item.channel,
                            title=config.get_localized_string(59994),
                            folder=False,
                            thumbnail=get_thumb("search.png"))
        if not setting_channel(setting_item):
            return False

    if categories is None:
        categories = []

    multithread = config.get_setting("multithread", "search")
    result_mode = config.get_setting("result_mode", "search")

    if item.wanted != '':
        tecleado = item.wanted
    else:
        tecleado = item.extra

    itemlist = []

    channels_path = os.path.join(config.get_runtime_path(), "channels",
                                 '*.json')
    logger.info("channels_path=%s" % channels_path)

    # channel_language = config.get_setting("channel_language", default="all")
    channel_language = auto_filter()
    logger.info("channel_language=%s" % channel_language)

    # Para Kodi es necesario esperar antes de cargar el progreso, de lo contrario
    # el cuadro de progreso queda "detras" del cuadro "cargando..." y no se le puede dar a cancelar
    time.sleep(0.5)
    progreso = platformtools.dialog_progress(
        config.get_localized_string(30993) % tecleado, "")
    channel_files = sorted(glob.glob(channels_path),
                           key=lambda x: os.path.basename(x))
    import math

    threads = []
    search_results = {}
    start_time = time.time()
    list_channels_search = []

    # Extrae solo los canales a buscar
    for index, infile in enumerate(channel_files):
        try:
            basename = os.path.basename(infile)
            basename_without_extension = basename[:-5]
            logger.info("%s..." % basename_without_extension)

            channel_parameters = channeltools.get_channel_parameters(
                basename_without_extension)

            # No busca si es un canal inactivo
            if not channel_parameters["active"]:
                logger.info("%s -no activo-" % basename_without_extension)
                continue

            # En caso de búsqueda por categorias
            if categories:

                # Si no se ha seleccionado torrent no se muestra
                #if "torrent" not in categories and "infoPlus" not in categories:
                #    if "torrent" in channel_parameters["categories"]:
                #        logger.info("%s -torrent-" % basename_without_extension)
                #        continue

                for cat in categories:
                    if cat not in channel_parameters["categories"]:
                        logger.info("%s -no en %s-" %
                                    (basename_without_extension, cat))
                        continue

            # No busca si es un canal para adultos, y el modo adulto está desactivado
            if channel_parameters["adult"] and config.get_setting(
                    "adult_mode") == 0:
                logger.info("%s -adulto-" % basename_without_extension)
                continue

            # No busca si el canal es en un idioma filtrado
            if channel_language != "all" and channel_language not in channel_parameters["language"] \
                    and "*" not in channel_parameters["language"]:
                logger.info("%s -idioma no válido-" %
                            basename_without_extension)
                continue

            # No busca si es un canal excluido de la búsqueda global
            include_in_global_search = channel_parameters[
                "include_in_global_search"]
            if include_in_global_search:
                # Buscar en la configuracion del canal
                include_in_global_search = config.get_setting(
                    "include_in_global_search", basename_without_extension)

            if not include_in_global_search:
                logger.info("%s -no incluido en lista a buscar-" %
                            basename_without_extension)
                continue
            list_channels_search.append(infile)
        except:
            logger.error("No se puede buscar en: %s" %
                         channel_parameters["title"])
            import traceback
            logger.error(traceback.format_exc())
            continue

    for index, infile in enumerate(list_channels_search):
        try:
            # fix float porque la division se hace mal en python 2.x
            percentage = int(
                float((index + 1)) / len(list_channels_search) * float(100))
            basename = os.path.basename(infile)
            basename_without_extension = basename[:-5]
            logger.info("%s..." % basename_without_extension)
            channel_parameters = channeltools.get_channel_parameters(
                basename_without_extension)
            # Movido aqui el progreso, para que muestre el canal exacto que está buscando
            progreso.update(
                percentage,
                config.get_localized_string(60520) %
                (channel_parameters["title"]))
            # Modo Multi Thread
            if progreso.iscanceled():
                progreso.close()
                logger.info("Búsqueda cancelada")
                return itemlist
            if multithread:
                t = Thread(target=channel_search,
                           args=[search_results, channel_parameters, tecleado],
                           name=channel_parameters["title"])
                t.setDaemon(True)
                t.start()
                threads.append(t)
            # Modo single Thread
            else:
                logger.info("Intentado búsqueda en %s de %s " %
                            (basename_without_extension, tecleado))
                channel_search(search_results, channel_parameters, tecleado)
        except:
            logger.error("No se puede buscar en: %s" %
                         channel_parameters["title"])
            import traceback
            logger.error(traceback.format_exc())
            continue

    # Modo Multi Thread
    # Usando isAlive() no es necesario try-except,
    # ya que esta funcion (a diferencia de is_alive())
    # es compatible tanto con versiones antiguas de python como nuevas
    if multithread:
        pendent = [a for a in threads if a.isAlive()]
        if len(pendent) > 0: t = float(100) / len(pendent)
        while len(pendent) > 0:
            index = (len(threads) - len(pendent)) + 1
            percentage = int(math.ceil(index * t))

            list_pendent_names = [a.getName() for a in pendent]
            mensaje = config.get_localized_string(70282) % (
                ", ".join(list_pendent_names))
            progreso.update(
                percentage,
                config.get_localized_string(60521) %
                (len(threads) - len(pendent) + 1, len(threads)), mensaje)
            if progreso.iscanceled():
                logger.info("Búsqueda cancelada")
                break
            time.sleep(0.5)
            pendent = [a for a in threads if a.isAlive()]
    total = 0
    for channel in sorted(search_results.keys()):
        for element in search_results[channel]:
            total += len(element["itemlist"])
            title = channel
            # resultados agrupados por canales
            if item.contextual == True or item.action == 'search_tmdb':
                result_mode = 1
            if result_mode == 0:
                if len(search_results[channel]) > 1:
                    title += " -%s" % element["item"].title.strip()
                title += " (%s)" % len(element["itemlist"])
                title = re.sub("\[COLOR [^\]]+\]", "", title)
                title = re.sub("\[/COLOR]", "", title)
                itemlist.append(
                    Item(title=title,
                         channel="search",
                         action="show_result",
                         url=element["item"].url,
                         extra=element["item"].extra,
                         folder=True,
                         adult=element["adult"],
                         from_action="search",
                         from_channel=element["item"].channel,
                         tecleado=tecleado))
            # todos los resultados juntos, en la misma lista
            else:
                title = " [ Resultados del canal %s ] " % channel
                itemlist.append(
                    Item(title=title,
                         channel="search",
                         action="",
                         folder=False,
                         text_bold=True,
                         from_channel=channel))
                for i in element["itemlist"]:
                    if i.action:
                        title = "    " + i.title
                        if "infoPlus" in categories:  #Se manrca vi viene de una ventana de InfoPlus
                            i.infoPlus = True
                        itemlist.append(
                            i.clone(title=title,
                                    from_action=i.action,
                                    from_channel=i.channel,
                                    channel="search",
                                    action="show_result",
                                    adult=element["adult"]))
    title = config.get_localized_string(59972) % (tecleado, total,
                                                  time.time() - start_time)
    itemlist.insert(0, Item(title=title, text_color='yellow'))
    progreso.close()
    #Para opcion Buscar en otros canales
    if item.contextual == True:
        return exact_results(itemlist, tecleado)
    else:
        return itemlist
Exemplo n.º 6
0
def mainlist(item):
    logger.debug()

    itemlist = []
    # list_canales, any_active = get_channels_list()
    channel_language = config.get_setting("channel_language", default="auto")
    if channel_language == 'auto':
        channel_language = auto_filter()

    #if list_canales['peliculas']:
    thumbnail = get_thumb("movie.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="peliculas",
                    title=config.get_localized_string(30122),
                    thumbnail=thumbnail)

    set_category_context(new_item)
    itemlist.append(new_item)

    # thumbnail = get_thumb("movie_4k.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="4k", title=config.get_localized_string(70208), thumbnail=thumbnail)
    #
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['terror']:
    # thumbnail = get_thumb("channels_horror.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="terror", title=config.get_localized_string(70209),
    #                 thumbnail=thumbnail)
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['infantiles']:
    # thumbnail = get_thumb("children.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title=config.get_localized_string(60510),
    #                 thumbnail=thumbnail)
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['series']:
    thumbnail = get_thumb("tvshow.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="series",
                    title=config.get_localized_string(60511),
                    thumbnail=thumbnail)
    set_category_context(new_item)
    itemlist.append(new_item)

    #if list_canales['anime']:
    thumbnail = get_thumb("anime.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="anime",
                    title=config.get_localized_string(60512),
                    thumbnail=thumbnail)
    set_category_context(new_item)
    itemlist.append(new_item)

    # if channel_language == "all":
    #     # if list_canales['Italiano']:
    #     thumbnail = get_thumb("italian.png")
    #     new_item = Item(channel=item.channel, action="novedades", extra="italiano", title=config.get_localized_string(70563),
    #                     thumbnail=thumbnail)
    #     set_category_context(new_item)
    #     itemlist.append(new_item)

    # if list_canales['Torrent']:
    # thumbnail = get_thumb("channels_torrent.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="torrent", title=config.get_localized_string(70171), thumbnail=thumbnail)
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['documentales']:
    thumbnail = get_thumb("documentary.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="documentales",
                    title=config.get_localized_string(60513),
                    thumbnail=thumbnail)
    set_category_context(new_item)
    itemlist.append(new_item)
    thumbnail = get_thumb("setting_0.png")
    itemlist.append(
        Item(channel='shortcuts',
             action="SettingOnPosition",
             category=7,
             setting=1,
             title=typo(config.get_localized_string(70285), 'bold color kod'),
             thumbnail=thumbnail))

    return itemlist
Exemplo n.º 7
0
def setting_channel(item):
    channels_path = os.path.join(config.get_runtime_path(), "channels",
                                 '*.json')
    channel_language = config.get_setting("channel_language", default="auto")
    if channel_language == 'auto':
        channel_language = auto_filter()[0]

    list_controls = []
    for infile in sorted(glob.glob(channels_path)):
        channel_id = os.path.basename(infile)[:-5]
        channel_parameters = channeltools.get_channel_parameters(channel_id)

        # No incluir si es un canal inactivo
        if not channel_parameters["active"]:
            continue

        # No incluir si es un canal para adultos, y el modo adulto está desactivado
        if channel_parameters["adult"] and config.get_setting(
                "adult_mode") == 0:
            continue

        # No incluir si el canal es en un idioma filtrado
        if channel_language != "all" and channel_language not in channel_parameters["language"] \
                and "*" not in channel_parameters["language"]:
            continue

        # No incluir si en su configuracion el canal no existe 'include_in_newest'
        include_in_newest = config.get_setting(
            "include_in_newest_" + item.extra, channel_id)
        if include_in_newest is None:
            continue

        control = {
            'id': channel_id,
            'type': "bool",
            'label': channel_parameters["title"],
            'default': include_in_newest,
            'enabled': True,
            'visible': True
        }

        list_controls.append(control)

    caption = config.get_localized_string(60533) + item.title.replace(
        config.get_localized_string(60525), "- ").strip()
    if config.get_setting("custom_button_value_news", item.channel):
        custom_button_label = config.get_localized_string(59992)
    else:
        custom_button_label = config.get_localized_string(59991)

    return platformtools.show_channel_settings(list_controls=list_controls,
                                               caption=caption,
                                               callback="save_settings",
                                               item=item,
                                               custom_button={
                                                   'visible': True,
                                                   'function':
                                                   "cb_custom_button",
                                                   'close': False,
                                                   'label': custom_button_label
                                               })
Exemplo n.º 8
0
def mainlist(item):
    logger.info()

    itemlist = []
    list_canales, any_active = get_channels_list()
    channel_language = config.get_setting("channel_language", default="auto")
    if channel_language == 'auto':
        channel_language = auto_filter()[0]

    #if list_canales['peliculas']:
    thumbnail = get_thumb("channels_movie.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="peliculas",
                    title=config.get_localized_string(30122),
                    thumbnail=thumbnail)

    set_category_context(new_item)
    itemlist.append(new_item)

    # thumbnail = get_thumb("channels_movie_4k.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="4k", title=config.get_localized_string(70208), thumbnail=thumbnail)
    #
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['terror']:
    # thumbnail = get_thumb("channels_horror.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="terror", title=config.get_localized_string(70209),
    #                 thumbnail=thumbnail)
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['infantiles']:
    # thumbnail = get_thumb("channels_children.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title=config.get_localized_string(60510),
    #                 thumbnail=thumbnail)
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['series']:
    thumbnail = get_thumb("channels_tvshow.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="series",
                    title=config.get_localized_string(60511),
                    thumbnail=thumbnail)
    set_category_context(new_item)
    itemlist.append(new_item)

    #if list_canales['anime']:
    thumbnail = get_thumb("channels_anime.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="anime",
                    title=config.get_localized_string(60512),
                    thumbnail=thumbnail)
    set_category_context(new_item)
    itemlist.append(new_item)

    if channel_language == "all":
        # if list_canales['Italiano']:
        thumbnail = get_thumb("channels_italian.png")
        new_item = Item(channel=item.channel,
                        action="novedades",
                        extra="italiano",
                        title=config.get_localized_string(70563),
                        thumbnail=thumbnail)
        set_category_context(new_item)
        itemlist.append(new_item)

    # if list_canales['Torrent']:
    # thumbnail = get_thumb("channels_torrent.png")
    # new_item = Item(channel=item.channel, action="novedades", extra="torrent", title=config.get_localized_string(70171), thumbnail=thumbnail)
    # set_category_context(new_item)
    # itemlist.append(new_item)

    #if list_canales['documentales']:
    thumbnail = get_thumb("channels_documentary.png")
    new_item = Item(channel=item.channel,
                    action="novedades",
                    extra="documentales",
                    title=config.get_localized_string(60513),
                    thumbnail=thumbnail)
    set_category_context(new_item)
    itemlist.append(new_item)

    return itemlist
Exemplo n.º 9
0
    def onInit(self):
        #### Compatibilidad con Kodi 18 ####
        if config.get_platform(True)['num_version'] < 18:
            self.setCoordinateResolution(2)
        
        self.focus = -1
        self.buttons = []
        posx= 0
        posy= 145
        space = 30

        selected = 'selected0.png'
        width = 260
        height = 30
        textcolor = "0xffffd700"
        conditional_textcolor = "0xffff3030"
        shadow = "0xFF000000"
        offsetx = 30
        offsety = 5
        font = 'font25_title'

        if config.get_setting('start_page'):
            label = config.get_localized_string(70663)
            self.button_start = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                       noFocusTexture='', focusTexture=media_path + selected,
                                                       textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                       textOffsetY=offsety)
            self.addControl(self.button_start)
            self.buttons.append(self.button_start)

        posy += space * 2
        label = config.get_localized_string(70009)
        self.button_alfa = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                 noFocusTexture='', focusTexture=media_path+selected, 
                                                 textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                 textOffsetY=offsety)
        self.addControl(self.button_alfa)
        self.buttons.append(self.button_alfa)


        posy += space
        label = config.get_localized_string(30100)
        self.button_config = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                   noFocusTexture='', focusTexture=media_path + selected,
                                                   textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                   textOffsetY=offsety)
        self.addControl(self.button_config)
        self.buttons.append(self.button_config)
        posy += space*2
        label = config.get_localized_string(30122)
        self.button_peliculas = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                      alignment=0x00000000, noFocusTexture='',
                                                      focusTexture=media_path+selected, textColor=textcolor,
                                                      shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_peliculas)
        self.buttons.append(self.button_peliculas)
        posy += space
        label = config.get_localized_string(70017)
        self.button_series = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                   alignment=0x00000000, noFocusTexture='',
                                                   focusTexture=media_path+selected, textColor=textcolor,
                                                   shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_series)
        self.buttons.append(self.button_series)
        posy += space
        label = config.get_localized_string(30124)
        self.button_anime = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                  noFocusTexture='', focusTexture=media_path+selected,
                                                  textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                  textOffsetY=offsety)
        self.addControl(self.button_anime)
        self.buttons.append(self.button_anime)
        posy += space
        label = config.get_localized_string(70018)
        self.button_infantil = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                     alignment=0x00000000, noFocusTexture='',
                                                     focusTexture=media_path+selected, textColor=textcolor,
                                                     shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_infantil)
        self.buttons.append(self.button_infantil)
        posy += space
        label = config.get_localized_string(70019)
        self.button_docu = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                     alignment=0x00000000, noFocusTexture='',
                                                     focusTexture=media_path + selected, textColor=textcolor,
                                                     shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_docu)
        self.buttons.append(self.button_docu)
        posy += space

        label = config.get_localized_string(70013)
        self.button_terror = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                   alignment=0x00000000, noFocusTexture='',
                                                   focusTexture=media_path+selected, textColor=textcolor,
                                                   shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_terror)
        self.buttons.append(self.button_terror)

        if channelselector.auto_filter() == 'esp':
            posy += space
            label = config.get_localized_string(59981)
            self.button_lat = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                    noFocusTexture='', focusTexture=media_path+selected,
                                                    textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                    textOffsetY=offsety)
            self.addControl(self.button_lat)
            self.buttons.append(self.button_lat)
            posy += space
            label = config.get_localized_string(70014)
            self.button_cast = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                     noFocusTexture='', focusTexture=media_path + selected,
                                                     textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                     textOffsetY=offsety)
            self.addControl(self.button_cast)
            self.buttons.append(self.button_cast)
        posy += space
        label = config.get_localized_string(70015)
        self.button_torrent = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                    alignment=0x00000000, noFocusTexture='',
                                                    focusTexture=media_path+selected, textColor=textcolor,
                                                    shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_torrent)
        self.buttons.append(self.button_torrent)

        start_page_item = get_start_page()
        if config.get_setting('start_page') and start_page_item.channel == 'news':
            posy += space
            label = config.get_localized_string(70016)
            self.button_config = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                       alignment=0x00000000, noFocusTexture='',
                                                       focusTexture=media_path+selected, textColor=conditional_textcolor,
                                                       shadowColor=shadow, textOffsetX=offsetx, textOffsetY=offsety)
            self.addControl(self.button_config)
            self.buttons.append(self.button_config)

        posy += space*2
        label = config.get_localized_string(60423)
        self.button_buscar = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                   noFocusTexture='', focusTexture=media_path + selected,
                                                   textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                   textOffsetY=offsety)
        self.addControl(self.button_buscar)
        self.buttons.append(self.button_buscar)
        posy += space
        label = config.get_localized_string(70036)
        self.button_actor = xbmcgui.ControlButton(posx, posy, width, height, label, font=font, alignment=0x00000000,
                                                   noFocusTexture='', focusTexture=media_path + selected,
                                                   textColor=textcolor, shadowColor=shadow, textOffsetX=offsetx,
                                                   textOffsetY=offsety)
        self.addControl(self.button_actor)
        self.buttons.append(self.button_actor)

        posy += space
        label = config.get_localized_string(70010)
        self.button_config_search = xbmcgui.ControlButton(posx, posy, width, height, label, font=font,
                                                       alignment=0x00000000,
                                                   noFocusTexture='', focusTexture=media_path + selected,
                                                   textColor=conditional_textcolor, shadowColor=shadow,
                                                   textOffsetX=offsetx, textOffsetY=offsety)
        self.addControl(self.button_config_search)
        self.buttons.append(self.button_config_search)


        label=''
        self.button_close = xbmcgui.ControlButton(260, 0, 1020, 725, label, noFocusTexture='', focusTexture='')
        self.addControl(self.button_close)