def newest(categoria): logger.info() itemlist = [] item = Item() try: if categoria == 'torrent' or categoria == 'peliculas': item.category_new = 'newest' item.channel = channel item.category = channel.capitalize() item.extra = "peliculas" item.url = api + "?sort_by=date_added&page=0" itemlist = listado(item) if ">> Página siguiente" in itemlist[-1].title: itemlist.pop() if categoria == 'torrent': item.extra = "series" item.url = api_serie + "?sort_by=date_added&page=0" itemlist = listado(item) if ">> Página siguiente" in itemlist[-1].title: itemlist.pop() # Se captura la excepción, para no interrumpir al canal novedades si un canal falla except: import sys for line in sys.exc_info(): logger.error("{0}".format(line)) return [] return itemlist
def mainlist(item, thumbnail_type="squares"): logger.info() itemlist = [] list_canales = get_list_canales() thumbnail_base = plugin_media_url + thumbnail_type + "/" thumbnail = thumbnail_base + '/disabled' if list_canales['peliculas']: thumbnail = thumbnail_base + "/thumb_canales_peliculas.png" new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title="Películas", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra itemlist.append(new_item) if list_canales['infantiles']: thumbnail = thumbnail_base + "/thumb_canales_infantiles.png" new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title="Para niños", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra itemlist.append(new_item) if list_canales['series']: thumbnail = thumbnail_base + "/thumb_canales_series.png" new_item = Item(channel=item.channel, action="novedades", extra="series", title="Episodios de series", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra itemlist.append(new_item) if list_canales['anime']: thumbnail = thumbnail_base + "/thumb_canales_anime.png" new_item = Item(channel=item.channel, action="novedades", extra="anime", title="Episodios de anime", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra itemlist.append(new_item) if list_canales['documentales']: thumbnail = thumbnail_base + "/thumb_canales_documentales.png" new_item = Item(channel=item.channel, action="novedades", extra="documentales", title="Documentales", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra itemlist.append(new_item) return itemlist
def mainlist(item,thumbnail_type="squares"): logger.info("streamondemand.channels.novedades mainlist") itemlist = [] list_canales = get_list_canales() thumbnail_base = "http://media.tvalacarta.info/pelisalacarta/"+thumbnail_type+"/" thumbnail = thumbnail_base + '/disabled' if list_canales['peliculas']: thumbnail = thumbnail_base + "/thumb_canales_peliculas.png" new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title="Film", thumbnail=thumbnail) new_item.context = [{"title": "Canali inclusi in: %s" %new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel}] new_item.category = "Novità in %s" % new_item.extra itemlist.append(new_item) if list_canales['infantiles']: thumbnail = thumbnail_base + "/thumb_canales_infantiles.png" new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title="Cartoni Animati", thumbnail=thumbnail) new_item.context = [{"title": "Canali inclusi in: %s" %new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel}] new_item.category = "Novità in %s" % new_item.extra itemlist.append(new_item) if list_canales['series']: thumbnail = thumbnail_base + "/thumb_canales_series.png" new_item = Item(channel=item.channel, action="novedades", extra="series", title="Episodi Serie Tv", thumbnail=thumbnail) new_item.context = [{"title": "Canali inclusi in: %s" %new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel}] new_item.category = "Novità in %s" % new_item.extra itemlist.append(new_item) if list_canales['anime']: thumbnail = thumbnail_base + "/thumb_canales_anime.png" new_item = Item(channel=item.channel, action="novedades", extra="anime", title="Episodi Anime", thumbnail=thumbnail) new_item.context = [{"title": "Canali inclusi in: %s" %new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel}] new_item.category = "Novità in %s" % new_item.extra itemlist.append(new_item) if list_canales['documentales']: thumbnail = thumbnail_base + "/thumb_canales_documentales.png" new_item = Item(channel=item.channel, action="novedades", extra="documentales", title="Documentari", thumbnail=thumbnail) new_item.context = [{"title": "Canali inclusi in: %s" %new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel}] new_item.category = "Novità in %s" % new_item.extra itemlist.append(new_item) #itemlist.append(Item(channel=item.channel, action="menu_opciones", title="Opciones", viewmode="list", # thumbnail=thumbnail_base + "/thumb_configuracion.png")) return itemlist
def mainlist(item, thumbnail_type="squares"): logger.info() itemlist = [] list_canales = get_list_canales() thumbnail_base = "http://media.tvalacarta.info/pelisalacarta/" + thumbnail_type + "/" thumbnail = thumbnail_base + '/disabled' if list_canales['peliculas']: thumbnail = thumbnail_base + "/thumb_canales_peliculas.png" new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title="Film", thumbnail=thumbnail) new_item.context = [{ "title": "Canali inclusi in: %s" % new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel }] new_item.category = "Novità in %s" % new_item.title itemlist.append(new_item) ''' if list_canales['infantiles']: thumbnail = thumbnail_base + "/thumb_canales_infantiles.png" new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title="Cartoni Animati", thumbnail=thumbnail) new_item.context = [{"title": "Canali inclusi in: %s" %new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel}] new_item.category = "Novità in %s" % new_item.title itemlist.append(new_item) ''' if list_canales['series']: thumbnail = thumbnail_base + "/thumb_canales_series.png" new_item = Item(channel=item.channel, action="novedades", extra="series", title="Episodi Serie TV", thumbnail=thumbnail) new_item.context = [{ "title": "Canali inclusi in: %s" % new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel }] new_item.category = "Novità in %s" % new_item.title itemlist.append(new_item) if list_canales['anime']: thumbnail = thumbnail_base + "/thumb_canales_anime.png" new_item = Item(channel=item.channel, action="novedades", extra="anime", title="Episodi Anime", thumbnail=thumbnail) new_item.context = [{ "title": "Canali inclusi in: %s" % new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel }] new_item.category = "Novità in %s" % new_item.title itemlist.append(new_item) if list_canales['documentales']: thumbnail = thumbnail_base + "/thumb_canales_documentales.png" new_item = Item(channel=item.channel, action="novedades", extra="documentales", title="Documentari", thumbnail=thumbnail) new_item.context = [{ "title": "Canali inclusi in: %s" % new_item.title, "extra": new_item.extra, "action": "settingCanal", "channel": new_item.channel }] new_item.category = "Novità in %s" % new_item.title itemlist.append(new_item) # itemlist.append(Item(channel=item.channel, action="menu_opciones", title="Opciones", viewmode="list", # thumbnail=thumbnail_base + "/thumb_configuracion_0.png")) return itemlist
def mainlist(item): logger.info() itemlist = [] list_canales = get_channels_list() if list_canales['peliculas']: thumbnail = get_thumb("channels_movie.png") new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title="Películas", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra 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="Para niños", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra 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="Episodios de series", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra 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="Episodios de anime", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra 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="Documentales", thumbnail=thumbnail) new_item.context = [{ "title": "Canales incluidos en: %s" % new_item.title, "extra": new_item.extra, "action": "setting_channel", "channel": new_item.channel }] new_item.category = "Novedades en %s" % new_item.extra itemlist.append(new_item) return itemlist