def mainlist(item): logger.info() thumb_series = get_thumb("squares", "thumb_canales_series.png") thumb_series_az = get_thumb("squares", "thumb_canales_series_az.png") thumb_buscar = get_thumb("squares", "thumb_buscar.png") itemlist = [] itemlist.append(Item(channel=item.channel, title="Listado alfabético", action="series_listado_alfabetico", thumbnail=thumb_series_az)) itemlist.append(Item(channel=item.channel, title="Todas las series", action="series", url=urlparse.urljoin(HOST, "listado/"), thumbnail=thumb_series)) itemlist.append(Item(channel=item.channel, title="Capítulos de estreno", action="homeSection", extra=CAPITULOS_DE_ESTRENO_STR, url=HOST , thumbnail=thumb_series)) itemlist.append(Item(channel=item.channel, title="Último actualizado", action="homeSection", extra="Último Actualizado", url=HOST , thumbnail=thumb_series)) itemlist.append(Item(channel=item.channel, title="Series más vistas", action="homeSection", extra="Series Más vistas", url=HOST , thumbnail=thumb_series)) itemlist.append(Item(channel=item.channel, title="Series menos vistas", action="homeSection", extra="Series Menos vistas", url=HOST , thumbnail=thumb_series)) itemlist.append(Item(channel=item.channel, title="Últimas fichas creadas", action="series", url=urlparse.urljoin(HOST, "fichas_creadas/"), thumbnail=thumb_series)) itemlist.append(Item(channel=item.channel, title="Buscar...", action="search", url=HOST, thumbnail=thumb_buscar)) if filtertools.context: itemlist = filtertools.show_option(itemlist, item.channel, list_idiomas, CALIDADES) return itemlist
def mainlist(item): logger.info() thumb_series = get_thumb("squares", "thumb_canales_series.png") thumb_series_az = get_thumb("squares", "thumb_canales_series_az.png") thumb_buscar = get_thumb("squares", "thumb_buscar.png") itemlist = [] itemlist.append(Item(action = "listado_alfabetico", title = "Listado Alfabetico", channel = item.channel, thumbnail = thumb_series_az)) itemlist.append(Item(action = "novedades", title = "Capítulos de estreno", channel = item.channel, thumbnail = thumb_series)) itemlist.append(Item(action = "search", title = "Buscar", channel = item.channel, thumbnail = thumb_buscar)) if filtertools.context: itemlist = filtertools.show_option(itemlist, item.channel, list_idiomas, CALIDADES) return itemlist
def mainlist(item): logger.info() thumb_series = get_thumb("channels_tvshow.png") autoplay.init(item.channel, list_servers, list_quality) itemlist = list() itemlist.append( Item(channel=item.channel, action="lista", title="Series", contentSerieName="Series", url=host, thumbnail=thumb_series, page=0)) #itemlist.append( # Item(channel=item.channel, action="lista", title="Live Action", contentSerieName="Live Action", url=host+"/liveaction", thumbnail=thumb_series, page=0)) #itemlist.append( # Item(channel=item.channel, action="peliculas", title="Películas", contentSerieName="Películas", url=host+"/peliculas", thumbnail=thumb_series, page=0)) itemlist = renumbertools.show_option(item.channel, itemlist) autoplay.show_option(item.channel, itemlist) return itemlist
def show_option(channel, itemlist, text_color=colorKOD, thumbnail=None, fanart=None): ''' Agrega la opcion Configurar AutoPlay en la lista recibida :param channel: str :param itemlist: list (lista donde se desea integrar la opcion de configurar AutoPlay) :param text_color: str (color para el texto de la opcion Configurar Autoplay) :param thumbnail: str (direccion donde se encuentra el thumbnail para la opcion Configurar Autoplay) :return: ''' from channelselector import get_thumb logger.info() if not config.is_xbmc(): return itemlist if thumbnail == None: thumbnail = get_thumb('autoplay.png') # if fanart == None: # fanart = get_thumb('autoplay.png') plot_autoplay = config.get_localized_string(60399) itemlist.append( Item( channel=__channel__, title=config.get_localized_string(60071), action="autoplay_config", text_color=text_color, text_bold=True, thumbnail=thumbnail, # fanart=fanart, plot=plot_autoplay, from_channel=channel, folder=False)) return itemlist
def mainlist(item): logger.info() itemlist = [] autoplay.init(item.channel, list_servers, list_quality) itemlist.append( item.clone(title="Películas", action="lista", url=host + "search/label/Pel%C3%ADcula?&max-results=24")) itemlist.append( item.clone(title="Géneros", action="generos", url=host + "p/categorias.html")) itemlist.append(item.clone(title="Buscar", action="search")) itemlist.append( item.clone(title="Configurar canal...", text_color="gold", action="configuracion", thumbnail=get_thumb('setting_0.png'))) autoplay.show_option(item.channel, itemlist) return itemlist
def flixtvshow(item): logger.info() item.viewType = 'tvshows' itemlist = [item.clone( action="series", text_blod=True, title="Novedades", url=host + 'series/netflix?filtro=fecha_actualizacion', ), item.clone( action="series", text_blod=True, title="Más Vistas", url=host + 'series/netflix?filtro=visitas' ), item.clone( action="series", text_blod=True, title="Recíen Agregadas", url=host + 'series/netflix?filtro=fecha_creacion', ), item.clone( action="search", extra="buscars", text_blod=True, thumbnail=get_thumb('search.png'), title="Buscar", url=host + 'series/netflix' ) ] item.viewType = 'videos' return itemlist
def mainlist(item): logger.info() autoplay.init(item.channel, list_servers, list_quality) itemlist = list() itemlist.append( Item(channel=item.channel, title="Ultimas", action="list_all", url=host, thumbnail=get_thumb('last', auto=True))) itemlist.append( Item(channel=item.channel, title="Generos", action="section", section='genre', thumbnail=get_thumb('genres', auto=True))) itemlist.append( Item(channel=item.channel, title="Por Calidad", action="section", section='quality', thumbnail=get_thumb('quality', auto=True))) itemlist.append( Item(channel=item.channel, title="Por Año", action="section", section='year', thumbnail=get_thumb('year', auto=True))) itemlist.append( Item(channel=item.channel, title="Alfabetico", action="section", section='alpha', thumbnail=get_thumb('alphabet', auto=True))) itemlist.append( Item(channel=item.channel, title="Buscar", action="search", url=host + '?s=', thumbnail=get_thumb('search', auto=True))) autoplay.show_option(item.channel, itemlist) return itemlist
def submenu_tools(item): logger.info() itemlist = list() itemlist.append( Item(channel=CHANNELNAME, title="Herramientas de canales", action="", folder=False, thumbnail=get_thumb("channels.png"))) itemlist.append( Item(channel=CHANNELNAME, title=" Comprobar archivos *_data.json", action="conf_tools", folder=True, extra="lib_check_datajson", thumbnail=get_thumb("channels.png"))) if config.get_videolibrary_support(): itemlist.append( Item(channel=CHANNELNAME, action="", title="", folder=False, thumbnail=get_thumb("setting_0.png"))) itemlist.append( Item(channel=CHANNELNAME, title="Herramientas de videoteca", action="", folder=False, thumbnail=get_thumb("videolibrary.png"))) itemlist.append( Item( channel=CHANNELNAME, action="overwrite_tools", folder=False, thumbnail=get_thumb("videolibrary.png"), title=" Sobreescribir toda la videoteca (strm, nfo y json)")) itemlist.append( Item(channel="videolibrary", action="update_videolibrary", folder=False, thumbnail=get_thumb("videolibrary.png"), title=" Buscar nuevos episodios y actualizar videoteca")) return itemlist
def submenu_tools(item): logger.info() itemlist = list() # Herramientas personalizadas import os channel_custom = os.path.join(config.get_runtime_path(), 'channels', 'custom.py') if not filetools.exists(channel_custom): user_custom = os.path.join(config.get_data_path(), 'custom.py') if filetools.exists(user_custom): filetools.copy(user_custom, channel_custom, silent=True) if filetools.exists(channel_custom): itemlist.append(Item(channel='custom', action='mainlist', title='Custom Channel')) #Disabilitato il menu degli aggiornamenti #itemlist.append(Item(channel=CHANNELNAME, action="check_quickfixes", folder=False, # title=config.get_localized_string(30001), plot="Versión actual: %s" % config.get_addon_version() )) itemlist.append(Item(channel=CHANNELNAME, action="update_quasar", folder=False, title=config.get_localized_string(70569))) itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False, thumbnail=get_thumb("setting_0.png"))) itemlist.append(Item(channel=CHANNELNAME, title=config.get_localized_string(60564) + ":", action="", folder=False, text_bold=True, thumbnail=get_thumb("channels.png"))) itemlist.append(Item(channel=CHANNELNAME, title=config.get_localized_string(60565), action="conf_tools", folder=True, extra="lib_check_datajson", thumbnail=get_thumb("channels.png"))) if config.get_videolibrary_support(): itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False, thumbnail=get_thumb("setting_0.png"))) itemlist.append(Item(channel=CHANNELNAME, title=config.get_localized_string(60566) + ":", action="", folder=False, text_bold=True, thumbnail=get_thumb("videolibrary.png"))) itemlist.append(Item(channel=CHANNELNAME, action="overwrite_tools", folder=False, thumbnail=get_thumb("videolibrary.png"), title="- " + config.get_localized_string(60567))) itemlist.append(Item(channel="videolibrary", action="update_videolibrary", folder=False, thumbnail=get_thumb("videolibrary.png"), title="- " + config.get_localized_string(60568))) return itemlist
def categorie(item): logger.info("%s mainlist categorie log: %s" % (__channel__, item)) itemlist = [] # scarico la pagina data = httptools.downloadpage(item.url, headers=headers).data # da qui fare le opportuni modifiche if item.args == 'genres': bloque = scrapertools.find_single_match(data, '<ul class="kategori_list">(.*?)</ul>') patron = '<li><a href="/(.*?)">(.*?)</a>' elif item.args[1] == 'years': bloque = scrapertools.find_single_match(data, '<ul class="anno_list">(.*?)</ul>') patron = '<li><a href="/(.*?)">(.*?)</a>' elif item.args[1] == 'orderalf': bloque = scrapertools.find_single_match(data, '<div class="movies-letter">(.*)<div class="clearfix">') patron = '<a title=.*?href="(.*?)"><span>(.*?)</span>' matches = scrapertools.find_multiple_matches(bloque, patron) for scrapurl, scraptitle in sorted(matches): if "01" in scraptitle: continue else: scrapurl = host+scrapurl if item.args[1] != 'orderalf': action = "peliculas" else: action = 'orderalf' itemlist.append(Item( channel=item.channel, action= action, title = scraptitle, url= scrapurl, thumbnail = get_thumb(scraptitle, auto = True), extra = item.extra, )) return itemlist
def show_channels(item): logger.info() itemlist = [] context = [{ "title": config.get_localized_string(50005), "action": "remove_channel", "channel": "community" }] path = os.path.join(config.get_data_path(), 'community_channels.json') file = open(path, "r") json = jsontools.load(file.read()) itemlist.append( Item(channel=item.channel, title=config.get_localized_string(70676), action='add_channel', thumbnail=get_thumb('add.png'))) for key, channel in json['channels'].items(): file_path = channel['path'] file_url = httptools.downloadpage(file_path, follow_redirects=True).data json_url = jsontools.load(file_url) thumbnail = json_url['thumbnail'] if 'thumbnail' in json_url else '' fanart = json_url['fanart'] if 'fanart' in json_url else '' itemlist.append( Item(channel=item.channel, title=channel['channel_name'], url=file_path, thumbnail=thumbnail, fanart=fanart, action='show_menu', channel_id=key, context=context)) return itemlist
def show_channels(item): support.info() itemlist = [] # add context menu context = [{"title": config.get_localized_string(50005), "action": "remove_channel", "channel": "community"}] # read json json = load_and_check(item) itemlist.append(Item(channel=item.channel, title=support.typo(config.get_localized_string(70676),'bold color kod'), action='add_channel', thumbnail=get_thumb('add.png'))) for key, channel in json['channels'].items(): path = filetools.dirname(channel['path']) # relative path channel_json = load_json(channel['path']) # read channel json # retrieve information from json thumbnail = relative('thumbnail', channel_json, path) if not thumbnail: thumbnail = item.thumbnail fanart = relative('fanart', channel_json, path) plot = channel_json['plot'] if 'plot' in channel_json else '' itemlist.append(Item(channel=item.channel, title=support.typo(channel['channel_name'],'bold'), url=channel['path'], thumbnail=thumbnail, fanart=fanart, plot=plot, action='show_menu', channel_id = key, context=context, path=path)) support.channel_config(item, itemlist) return itemlist
def series(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data patron = '<div class="poster"> <img src="([^"]+)"' patron += ' alt="([^"]+)">.*?' patron += '<a href="([^"]+)">' matches = scrapertools.find_multiple_matches(data, patron) for scrapedthumbnail, scrapedtitle, scrapedurl in matches: scrapedtitle = scrapedtitle.replace('’', "'") itemlist.append(Item(channel=__channel__, title=scrapedtitle, extra='serie', url=scrapedurl, thumbnail=scrapedthumbnail, contentSerieName=scrapedtitle, show=scrapedtitle, action="temporadas", contentType='tvshow')) tmdb.set_infoLabels(itemlist, __modo_grafico__) pagination = scrapertools.find_single_match(data, '<link rel="next" href="([^"]+)" />') if pagination: itemlist.append(Item(channel=__channel__, action="series", title="» Siguiente »", url=pagination, thumbnail=get_thumb("next.png"))) return itemlist
def mainlist(item): support.log(item.channel + 'mainlist') itemlist = [] support.menu(itemlist, 'Serie TV bold', 'lista_serie', "%s/category/serie-tv" % host, 'tvshow') support.menu(itemlist, 'Novità submenu', 'latestep', "%s/ultimi-episodi" % host, 'tvshow') # support.menu(itemlist, 'Nuove serie color azure', 'lista_serie', "%s/category/serie-tv" % host,'tvshow') support.menu(itemlist, 'Categorie', 'categorie', host, 'tvshow') support.menu(itemlist, 'Cerca', 'search', host, 'tvshow') # autoplay.init(item.channel, list_servers, list_quality) # autoplay.show_option(item.channel, itemlist) itemlist.append( Item(channel='setting', action="channel_config", title=support.typo("Configurazione Canale color lime"), config=item.channel, folder=False, thumbnail=channelselector.get_thumb('setting_0.png'))) return itemlist
def series(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) # logger.info(data) patron = '<img class="portada" src="/([^"]+)"><[^<]+><a href="([^"]+)".*?' # img, url patron += 'class="link-title"><h2>([^<]+)</h2>' # title matches = re.compile(patron, re.DOTALL).findall(data) for scrapedthumbnail, scrapedurl, scrapedtitle in matches: itemlist.append(Item(channel=__channel__, title=scrapedtitle, extra='serie', url=scrapedurl, thumbnail=host+scrapedthumbnail, contentSerieName=scrapedtitle, show=scrapedtitle, action="temporadas", contentType='tvshow')) tmdb.set_infoLabels(itemlist, __modo_grafico__) pagination = scrapertools.find_single_match(data, '<li><a href="([^"]+)" rel="next">') if pagination: itemlist.append(Item(channel=__channel__, action="series", title="» Siguiente »", url=pagination, thumbnail=get_thumb("next.png"))) return itemlist
def get_saved_searches(): current_saved_searches_list = config.get_setting("saved_searches_list", "search") if not current_saved_searches_list: current_saved_searches_list = [] saved_searches_list = [] for saved_search_item in current_saved_searches_list: if type(saved_search_item) == str: saved_searches_list.append( Item(channel='search' if not config.get_setting('new_search') else 'globalsearch', action="new_search" if not config.get_setting('new_search') else 'Search', title=typo(saved_search_item.split('{}')[0], 'bold'), search_text=saved_search_item.split('{}')[0], text=saved_search_item.split('{}')[0], mode='all', thumbnail=get_thumb('search.png'))) else: saved_searches_list.append(Item().fromjson( json.dumps(saved_search_item))) return saved_searches_list
def findvideos(item): logger.info() itemlist = [] if alfa_assistant.is_alfa_installed(): data = httptools.downloadpage(item.url).data bloque = scrapertools.find_single_match(data, 'Server</span>(.*?)id="choose_quality"') matches = scrapertools.find_multiple_matches(bloque, '<option sv="[^"]+" value="([^"]+)"') headers = {"Referer" : item.url} for url in matches: xserver = scrapertools.find_single_match(url, 's=([a-zA-Z0-9]+)') source = HOST + "get_video_info_v2?s=%s" % xserver link = get_link(source, url) if link: itemlist.append(Item(channel=item.channel, action="play", url=link, title=xserver.capitalize(),plot=item.plot, thumbnail=item.thumbnail, contentTitle=item.title, language='VOSE', server="directo")) #~itemlist = servertools.get_servers_itemlist(itemlist, lambda x: x.title % x.server.capitalize()) # Requerido para AutoPlay autoplay.start(itemlist, item) else: from lib import generictools browser, res = generictools.call_browser('', lookup=True) if not browser: action = '' else: action = 'call_browser' from channelselector import get_thumb from core import channeltools channel_name = channeltools.get_channel_parameters(item.channel)["title"] itemlist.append(Item(channel=item.channel, action=action, title="Para utilizar {} se requiere Alfa Assistant. [COLOR=yellow]Haz clic para + info[/COLOR] [COLOR=green](https://alfa-addon.com/threads/manual-de-alfa-assistant-herramienta-de-apoyo.3797/)[/COLOR]".format(channel_name), thumbnail=get_thumb("update.png"), url="https://alfa-addon.com/threads/manual-de-alfa-assistant-herramienta-de-apoyo.3797/")) return itemlist
def mainlist(item): logger.info() item.channel = "search" itemlist = list() context = [{"title": "Elegir canales incluidos", "action": "setting_channel", "channel": item.channel}] itemlist.append(Item(channel=item.channel, action="search", title="Buscar por titulo", context=context, thumbnail=get_thumb("search.png"))) thumbnail = get_thumb("search_star.png") itemlist.append(Item(channel='tvmoviedb', title="Buscar actor/actriz", action="search_", search={'url': 'search/person', 'language': 'es', 'page': 1}, star=True, thumbnail=thumbnail)) itemlist.append(Item(channel=item.channel, action="search", title="Buscar por categorias (búsqueda avanzada)", extra="categorias", context=context, thumbnail=get_thumb("search.png"))) itemlist.append(Item(channel=item.channel, action="opciones", title="Opciones", thumbnail=get_thumb("search.png"))) saved_searches_list = get_saved_searches() context2 = context[:] context2.append({"title": "Borrar búsquedas guardadas", "action": "clear_saved_searches", "channel": item.channel}) logger.info("saved_searches_list=%s" % saved_searches_list) if saved_searches_list: itemlist.append(Item(channel=item.channel, action="", title="Búsquedas guardadas:", context=context2, thumbnail=get_thumb("search.png"))) for saved_search_text in saved_searches_list: itemlist.append(Item(channel=item.channel, action="do_search", title=' "' + saved_search_text + '"', extra=saved_search_text, context=context2, category=saved_search_text, thumbnail=get_thumb("search.png"))) return itemlist
def mainlist(item): logger.info() itemlist = [] itemlist.append(Item(channel = item.channel, title = "Películas", text_bold = True, folder = False)) itemlist.append(Item(channel = item.channel, title = " Novedades", action = "peliculas", url = host + "/?peli=1", thumbnail=get_thumb('newest', auto=True))) itemlist.append(Item(channel = item.channel, title = " Por género", action = "filtro", url = host, extra = "categories", thumbnail=get_thumb('genres', auto=True))) itemlist.append(Item(channel = item.channel, title = " Por calidad", action = "filtro", url = host, extra = "qualitys", thumbnail=get_thumb('quality', auto=True))) itemlist.append(Item(channel = item.channel, title = " Por idioma", action = "filtro", url = host, extra = "languages", thumbnail=get_thumb('language', auto=True))) itemlist.append(Item(channel = item.channel, title = " Por año", action = "filtro", url = host, extra = "years", thumbnail=get_thumb('year', auto=True))) itemlist.append(Item(channel = item.channel, title = "")) itemlist.append(Item(channel = item.channel, title = "Series", text_bold = True, folder = False)) itemlist.append(Item(channel = item.channel, title = " Novedades", action = "series", url = host +"/series/?peli=1", thumbnail=get_thumb('newest', auto=True))) itemlist.append(Item(channel = item.channel, title = "")) itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "/?s=", thumbnail=get_thumb('search', auto=True))) return itemlist
def search(item, texto): logger.info() texto = texto.replace(" ", "+") item.url = urlparse.urljoin(item.url, "?q={0}".format(texto)) if item.extra == 'buscarp' or item.extra == 'buscars': item.url = urlparse.urljoin(item.url, "?buscar={0}".format(texto)) try: if item.extra == 'buscars': return series(item) return peliculas(item) # Se captura la excepción, para no interrumpir al buscador global si un canal falla except: import sys for line in sys.exc_info(): logger.error("{0}".format(line)) return [] pagination = scrapertools.find_single_match(data, '<link rel="next" href="([^"]+)" />') if pagination: itemlist.append(Item(channel=item.channel, action="sub_search", title="» Siguiente »", url=pagination, thumbnail=get_thumb("next.png"))) return itemlist
def show_channels(item): logger.info() itemlist = [] context = [{ "title": "Eliminar este canal", "action": "remove_channel", "channel": "community" }] path = os.path.join(config.get_data_path(), 'community_channels.json') file = open(path, "r") json = jsontools.load(file.read()) itemlist.append( Item(channel=item.channel, title=config.get_localized_string(70676), action='add_channel', thumbnail=get_thumb('add.png'))) for key, channel in json['channels'].items(): if 'poster' in channel: poster = channel['poster'] else: poster = '' itemlist.append( Item(channel=item.channel, title=channel['channel_name'], url=channel['path'], thumbnail=poster, action='show_menu', channel_id=key, context=context)) return itemlist
def sub_search(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t| |<br>", "", data) patron = '<a href="([^"]+)"><img src="([^"]+)" alt="([^"]+)" />' # url, img, title patron += '<span class="[^"]+">([^<]+)</span>.*?' # tipo patron += '<span class="year">([^"]+)</span>.*?<div class="contenido"><p>([^<]+)</p>' # year, plot matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle, tipo, year, plot in matches: title = scrapedtitle if tipo == 'Serie': contentType = 'tvshow' action = 'temporadas' title += ' [COLOR red](' + tipo + ')[/COLOR]' else: contentType = 'movie' action = 'findvideos' title += ' [COLOR green](' + tipo + ')[/COLOR]' itemlist.append(item.clone(title=title, url=scrapedurl, contentTitle=scrapedtitle, extra='buscar', action=action, infoLabels={"year": year}, contentType=contentType, thumbnail=scrapedthumbnail, text_color=color1, contentSerieName=scrapedtitle)) tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) paginacion = scrapertools.find_single_match(data, '<link rel="next" href="([^"]+)" />') if paginacion: itemlist.append(Item(channel=item.channel, action="sub_search", title="» Siguiente »", url=paginacion, thumbnail=get_thumb("next.png"))) return itemlist
def movie_list(item): logger.info() itemlist = [] itemlist.append( item.clone(title="Estrenos", action="lista", url=host + 'estrenos-de-cine', extra='movie')) itemlist.append( item.clone(title="Todas", action="lista", url=host + 'peliculas', extra='movie')) itemlist.append( item.clone(title="Buscar", action="search", url=host + '/peliculas/?pTit=', thumbnail=get_thumb("search.png"), extra='movie')) return itemlist
def menumovies(item): logger.info() itemlist = [ item.clone(title="Estrenos", action="peliculas", text_blod=True, viewcontent='movie', url=host + 'peliculas/estrenos', viewmode="movie_with_plot"), item.clone(title="Más Populares", action="peliculas", text_blod=True, viewcontent='movie', url=host + 'peliculas?filtro=visitas', viewmode="movie_with_plot"), item.clone(title="Recíen Agregadas", action="peliculas", text_blod=True, viewcontent='movie', url=host + 'peliculas?filtro=fecha_creacion', viewmode="movie_with_plot"), item.clone(title="Géneros", action="p_portipo", text_blod=True, extra='movie', viewcontent='movie', url=host + 'peliculas', viewmode="movie_with_plot"), item.clone(title="Buscar", action="search", text_blod=True, extra='buscarp', thumbnail=get_thumb('search.png'), url=host + 'peliculas') ] return itemlist
def mainlist(item): logger.info() itemlist = [] if config.get_setting('hdfulluser', channel='hdfull'): account = login() else: account = False autoplay.init(item.channel, list_servers, list_quality) itemlist.append(Item(channel=item.channel, action="menupeliculas", title="Películas", url=host, thumbnail=get_thumb('movies', auto=True), text_bold=True)) itemlist.append(Item(channel=item.channel, action="menuseries", title="Series", url=host, thumbnail=get_thumb('tvshows', auto=True), text_bold=True)) itemlist.append(Item(channel=item.channel, action="search", title="Buscar...", thumbnail=get_thumb('search', auto=True), text_bold=True)) autoplay.show_option(item.channel, itemlist) if not account: itemlist.append(Item(channel=item.channel, action="settingCanal", url="", text_bold=True, title="[COLOR dodgerblue]Habilita tu cuenta para activar los items de usuario...[/COLOR]", thumbnail=get_thumb("setting_0.png"))) else: itemlist.append(Item(channel=item.channel, action="", url="", title="", folder=False, thumbnail=get_thumb("setting_0.png"))) itemlist.append(Item(channel=item.channel, action="settingCanal", url="", title="[COLOR greenyellow][B]Configurar Canal[/B][/COLOR]", thumbnail=get_thumb("setting_0.png"), folder=False)) itemlist.append(Item(channel=item.channel, action="logout", url="", folder=False, title="[COLOR steelblue][B]Desloguearse[/B][/COLOR]", plot="Para cambiar de usuario", thumbnail=get_thumb("back.png"))) return itemlist
def mainlist(item): logger.info() itemlist = list() itemlist.append( Item(channel=item.channel, title="Peliculas", action="listado", url=host + "peliculas/", thumbnail=get_thumb("channels_movie.png"))) itemlist.append( Item(channel=item.channel, title="Español", action="listado", url=host + "peliculas/en-espanol/", thumbnail = get_thumb("channels_spanish.png"))) itemlist.append( Item(channel=item.channel, title="Latino", action="listado", url=host + "peliculas/en-latino/", thumbnail=get_thumb("channels_latino.png"))) itemlist.append( Item(channel=item.channel, title="Subtituladas", action="listado", url=host + "peliculas/subtituladas/", thumbnail=get_thumb("channels_vos.png"))) itemlist.append( Item(channel=item.channel, title="Generos", action="categories", url=host, thumbnail=get_thumb('genres', auto=True) )) itemlist.append( Item(channel=item.channel, title="Buscar", action="search", url=host + "core/ajax/suggest_search", thumbnail=get_thumb("search.png"))) return itemlist
def mainlist(item): logger.info() itemlist = [] itemlist.append(item.clone(action="peliculas", title="Novedades", url=host + "archivos/peliculas", thumbnail=get_thumb('newest', auto=True), text_color=color1,)) itemlist.append(item.clone(action="peliculas", title="Estrenos", url=host + "archivos/estrenos", thumbnail=get_thumb('premieres', auto=True), text_color=color1)) itemlist.append(item.clone(action="indices", title="Por géneros", url=host, thumbnail=get_thumb('genres', auto=True), text_color=color1)) itemlist.append(item.clone(action="indices", title="Por país", url=host, text_color=color1, thumbnail=get_thumb('country', auto=True))) itemlist.append(item.clone(action="indices", title="Por año", url=host, text_color=color1, thumbnail=get_thumb('year', auto=True))) itemlist.append(item.clone(title="", action="")) itemlist.append(item.clone(action="search", title="Buscar...", text_color=color3, thumbnail=get_thumb('search', auto=True))) itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False)) return itemlist
def menu_opciones(item): itemlist = list() itemlist.append(Item(channel=item.channel, title=config.get_localized_string(60525), text_bold = True, thumbnail=get_thumb("setting_0.png"), folder=False)) itemlist.append(Item(channel=item.channel, action="setting_channel", extra="peliculas", title=config.get_localized_string(60526), thumbnail=get_thumb("movie.png"), folder=False)) # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="4K", title=config.get_localized_string(70207), # thumbnail=get_thumb("movie.png"), folder=False)) # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="infantiles", title=config.get_localized_string(60527), # thumbnail=get_thumb("children.png"), # folder=False)) itemlist.append(Item(channel=item.channel, action="setting_channel", extra="series", title=config.get_localized_string(60528), thumbnail=get_thumb("tvshow.png"), folder=False)) itemlist.append(Item(channel=item.channel, action="setting_channel", extra="anime", title=config.get_localized_string(60529), thumbnail=get_thumb("anime.png"), folder=False)) # itemlist.append( # Item(channel=item.channel, action="setting_channel", extra="castellano", title=config.get_localized_string(70212), # thumbnail=get_thumb("documentary.png"), folder=False)) # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="latino", title=config.get_localized_string(70213), # thumbnail=get_thumb("documentary.png"), folder=False)) # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="torrent", title=config.get_localized_string(70214), # thumbnail=get_thumb("documentary.png"), folder=False)) itemlist.append(Item(channel=item.channel, action="setting_channel", extra="documentales", title=config.get_localized_string(60530), thumbnail=get_thumb("documentary.png"), folder=False)) itemlist.append(Item(channel=item.channel, action="settings", title=config.get_localized_string(60531), thumbnail=get_thumb("setting_0.png"), folder=False)) return itemlist
def mainlist(item): logger.info() itemlist = list() itemlist.append( item.clone(title="Ultimas", action="list_all", url=host, thumbnail=get_thumb('last', auto=True))) itemlist.append( item.clone(title="Generos", action="section", section='genre', thumbnail=get_thumb('genres', auto=True))) itemlist.append( item.clone(title="Por Calidad", action="section", section='quality', thumbnail=get_thumb('quality', auto=True))) itemlist.append( item.clone(title="Por Año", action="section", section='year', thumbnail=get_thumb('year', auto=True))) itemlist.append( item.clone(title="Alfabetico", action="section", section='alpha', thumbnail=get_thumb('alphabet', auto=True))) itemlist.append( item.clone(title="Buscar", action="search", url=host + '?s=', thumbnail=get_thumb('search', auto=True))) return itemlist
def mainlist(item): logger.info() itemlist = [] thumb_cartelera = get_thumb("now_playing.png") thumb_pelis = get_thumb("channels_movie.png") thumb_pelis_hd = get_thumb("channels_movie_hd.png") thumb_buscar = get_thumb("search.png") thumb_separador = get_thumb("next.png") thumb_settings = get_thumb("setting_0.png") autoplay.init(item.channel, list_servers, list_quality) itemlist.append(Item(channel=item.channel, title="Novedades", action="listado", url=host+'torrents', thumbnail=thumb_cartelera, extra="peliculas")) itemlist.append(Item(channel=item.channel, title="Por Calidades", action="categorias", url=host, thumbnail=thumb_pelis_hd, extra="peliculas", extra2="categorias")) itemlist.append(Item(channel=item.channel, title="Buscar...", action="search", url=host+'buscar?searchword=', thumbnail=thumb_buscar, extra="search")) itemlist.append(Item(channel=item.channel, url=host, title="[COLOR yellow]Configuración:[/COLOR]", folder=False, thumbnail=thumb_separador)) itemlist.append(Item(channel=item.channel, action="configuracion", title="Configurar canal", thumbnail=thumb_settings)) autoplay.show_option(item.channel, itemlist) #Activamos Autoplay return itemlist
def findvideos(item): logger.info() itemlist = [] itemlist_t = [] #Itemlist total de enlaces itemlist_f = [] #Itemlist de enlaces filtrados if not item.language: item.language = ['CAST'] #Castellano por defecto matches = [] item.category = categoria item.extra2 = 'xyz' del item.extra2 #logger.debug(item) matches = item.url if not matches: #error logger.error( "ERROR 02: FINDVIDEOS: No hay enlaces o ha cambiado la estructura de la Web: " + item) itemlist.append( item.clone( action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: No hay enlaces o ha cambiado la estructura de la Web. Verificar en la Web esto último y reportar el error con el log' )) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug(matches) #Llamamos al método para crear el título general del vídeo, con toda la información obtenida de TMDB item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) #Ahora tratamos los enlaces .torrent for scrapedurl, quality in matches: #leemos los magnets con la diferentes calidades #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() item_local.url = scrapedurl #Añadimos la calidad y copiamos la duración item_local.quality = quality if scrapertools.find_single_match(item.quality, '(\[\d+:\d+\ h])'): item_local.quality += ' [/COLOR][COLOR white]%s' % scrapertools.find_single_match( item.quality, '(\[\d+:\d+\ h])') #Ahora pintamos el link del Torrent item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % ( item_local.quality, str(item_local.language)) #Preparamos título y calidad, quitamos etiquetas vacías item_local.title = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.title) item_local.title = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.title) item_local.title = item_local.title.replace("--", "").replace( "[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() item_local.quality = re.sub( r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.quality) item_local.quality = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.quality).strip() item_local.quality = item_local.quality.replace("--", "").replace( "[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() item_local.alive = "??" #Calidad del link sin verificar item_local.action = "play" #Visualizar vídeo item_local.server = "torrent" #Servidor Torrent itemlist_t.append( item_local.clone()) #Pintar pantalla, si no se filtran idiomas # Requerido para FilterTools if config.get_setting( 'filter_languages', channel) > 0: #Si hay idioma seleccionado, se filtra itemlist_f = filtertools.get_link( itemlist_f, item_local, list_language) #Pintar pantalla, si no está vacío #logger.debug("TORRENT: " + scrapedurl + " / title gen/torr: " + item.title + " / " + item_local.title + " / calidad: " + item_local.quality + " / content: " + item_local.contentTitle + " / " + item_local.contentSerieName) #logger.debug(item_local) if len(itemlist_f) > 0: #Si hay entradas filtradas... itemlist.extend(itemlist_f) #Pintamos pantalla filtrada else: if config.get_setting('filter_languages', channel) > 0 and len( itemlist_t) > 0: #Si no hay entradas filtradas ... thumb_separador = get_thumb( "next.png") #... pintamos todo con aviso itemlist.append( Item( channel=item.channel, url=host, title= "[COLOR red][B]NO hay elementos con el idioma seleccionado[/B][/COLOR]", thumbnail=thumb_separador)) itemlist.extend( itemlist_t) #Pintar pantalla con todo si no hay filtrado # Requerido para AutoPlay autoplay.start(itemlist, item) #Lanzamos Autoplay return itemlist
def mainlist(item): logger.info() autoplay.init(item.channel, list_servers, list_quality) itemlist = [] itemlist.append( Item(channel=item.channel, title="Nuevos Episodios", action="new_episodes", thumbnail=get_thumb('new_episodes', auto=True), url=host)) itemlist.append( Item(channel=item.channel, title="Ultimas", action="list_all", thumbnail=get_thumb('last', auto=True), url=host + 'emision')) itemlist.append( Item(channel=item.channel, title="Todas", action="list_all", thumbnail=get_thumb('all', auto=True), url=host + 'animes')) itemlist.append( Item(channel=item.channel, title="Anime", action="list_all", thumbnail=get_thumb('anime', auto=True), url=host + 'categoria/anime')) itemlist.append( Item(channel=item.channel, title="Películas", action="list_all", thumbnail=get_thumb('movies', auto=True), url=host + 'categoria/pelicula')) itemlist.append( Item(channel=item.channel, title="OVAs", action="list_all", thumbnail='', url=host + 'categoria/ova')) itemlist.append( Item(channel=item.channel, title="ONAs", action="list_all", thumbnail='', url=host + 'categoria/ona')) itemlist.append( Item(channel=item.channel, title="Especiales", action="list_all", thumbnail='', url=host + 'categoria/especial')) itemlist.append( Item(channel=item.channel, title="Buscar", action="search", url=host + 'search?q=', thumbnail=get_thumb('search', auto=True), fanart='https://s30.postimg.cc/pei7txpa9/buscar.png')) autoplay.show_option(item.channel, itemlist) itemlist = renumbertools.show_option(item.channel, itemlist) return itemlist
def run(): logger.info("streamondemand.platformcode.launcher run") # Extract item from sys.argv if sys.argv[2]: item = Item().fromurl(sys.argv[2]) # If no item, this is mainlist else: item = Item(channel="channelselector", action="getmainlist", viewmode="movie") logger.info("streamondemand.platformcode.launcher "+item.tostring()) try: # If item has no action, stops here if item.action == "": logger.info("streamondemand.platformcode.launcher Item sin accion") return # Action for main menu in channelselector if item.action == "getmainlist": import channelselector # Check for updates only on first screen if config.get_setting("check_for_plugin_updates") == "true": logger.info("streamondemand.platformcode.launcher Check for plugin updates enabled") from core import updater try: config.set_setting("plugin_updates_available","0") version = updater.checkforupdates() itemlist = channelselector.getmainlist() if version: config.set_setting("plugin_updates_available","1") platformtools.dialog_ok("Versione "+version+" disponible", "E' possibile fare il download della nuova versione\n" "selezionare la relativa voce nel menu principale") itemlist = channelselector.getmainlist() itemlist.insert(0, Item(title="Download versione "+version, version=version, channel="updater", action="update", thumbnail=channelselector.get_thumb("squares","thumb_actualizar.png"))) except: import traceback logger.info(traceback.format_exc()) platformtools.dialog_ok("Impossibile connettersi", "Non è stato possibile verificare", "aggiornamenti") logger.info("cpelisalacarta.platformcode.launcher Fallo al verificar la actualización") config.set_setting("plugin_updates_available","0") itemlist = channelselector.getmainlist() else: logger.info("streamondemand.platformcode.launcher Check for plugin updates disabled") config.set_setting("plugin_updates_available","0") itemlist = channelselector.getmainlist() platformtools.render_items(itemlist, item) # Action for updating plugin elif item.action == "update": from core import updater updater.update(item) config.set_setting("plugin_updates_available","0") if config.get_system_platform() != "xbox": import xbmc xbmc.executebuiltin("Container.Refresh") # Action for channel types on channelselector: movies, series, etc. elif item.action == "getchanneltypes": import channelselector itemlist = channelselector.getchanneltypes() platformtools.render_items(itemlist, item) # Action for channel listing on channelselector elif item.action == "filterchannels": import channelselector itemlist = channelselector.filterchannels(item.channel_type) platformtools.render_items(itemlist, item) # Special action for playing a video from the library elif item.action == "play_from_library": play_from_library(item) return # Action in certain channel specified in "action" and "channel" parameters else: # Entry point for a channel is the "mainlist" action, so here we check parental control if item.action == "mainlist": # Parental control can_open_channel = False # If it is an adult channel, and user has configured pin, asks for it if channeltools.is_adult(item.channel) and config.get_setting("adult_pin") != "": tecleado = platformtools.dialog_input("", "PIN per canali per adulti", True) if tecleado is not None: if tecleado == config.get_setting("adult_pin"): can_open_channel = True # All the other cases can open the channel else: can_open_channel = True if not can_open_channel: return # Actualiza el canal individual if item.action == "mainlist" and item.channel!="channelselector" and config.get_setting("check_for_channel_updates")=="true": from core import updater updater.update_channel(item.channel) # Checks if channel exists channel_file = os.path.join(config.get_runtime_path(), 'channels', item.channel+".py") logger.info("streamondemand.platformcode.launcher channel_file=%s" % channel_file) channel = None if item.channel in ["personal", "personal2", "personal3", "personal4", "personal5"]: import channels.personal as channel elif os.path.exists(channel_file): try: channel = __import__('channels.%s' % item.channel, None, None, ["channels.%s" % item.channel]) except ImportError: exec "import channels."+item.channel+" as channel" logger.info("streamondemand.platformcode.launcher running channel "+channel.__name__+" "+channel.__file__) # Special play action if item.action == "play": logger.info("streamondemand.platformcode.launcher play") # logger.debug("item_toPlay: " + "\n" + item.tostring('\n')) # First checks if channel has a "play" function if hasattr(channel, 'play'): logger.info("streamondemand.platformcode.launcher executing channel 'play' method") itemlist = channel.play(item) b_favourite = item.isFavourite # Play should return a list of playable URLS if len(itemlist) > 0: item = itemlist[0] if b_favourite: item.isFavourite = True platformtools.play_video(item) #Permitir varias calidades desde play en el canal elif len(itemlist) > 0 and isinstance(itemlist[0], list): item.video_urls = itemlist platformtools.play_video(item) # If not, shows user an error message else: platformtools.dialog_ok("plugin", "Niente da riprodurre") # If player don't have a "play" function, not uses the standard play from platformtools else: logger.info("streamondemand.platformcode.launcher executing core 'play' method") platformtools.play_video(item) # Special action for findvideos, where the plugin looks for known urls elif item.action == "findvideos": # First checks if channel has a "findvideos" function if hasattr(channel, 'findvideos'): itemlist = getattr(channel, item.action)(item) # If not, uses the generic findvideos function else: logger.info("streamondemand.platformcode.launcher no channel 'findvideos' method, " "executing core method") from core import servertools itemlist = servertools.find_video_items(item) if config.get_setting('filter_servers') == 'true': itemlist = filtered_servers(itemlist) from platformcode import subtitletools subtitletools.saveSubtitleName(item) platformtools.render_items(itemlist, item) # Special action for adding a movie to the library elif item.action == "add_pelicula_to_library": library.add_pelicula_to_library(item) # Special action for adding a serie to the library elif item.action == "add_serie_to_library": library.add_serie_to_library(item, channel) # Special action for downloading all episodes from a serie elif item.action == "download_all_episodes": from channels import descargas item.action = item.extra del item.extra descargas.save_download(item) # Special action for searching, first asks for the words then call the "search" function elif item.action == "search": logger.info("streamondemand.platformcode.launcher search") last_search = "" last_search_active = config.get_setting("last_search", "buscador") if last_search_active: try: current_saved_searches_list = list(config.get_setting("saved_searches_list", "buscador")) last_search = current_saved_searches_list[0] except: pass tecleado = platformtools.dialog_input(last_search) if tecleado is not None: if last_search_active: from channels import buscador buscador.save_search(tecleado) # TODO revisar 'personal.py' porque no tiene función search y daría problemas # DrZ3r0 itemlist = channel.search(item, tecleado.replace(" ", "+")) else: itemlist = [] platformtools.render_items(itemlist, item) # For all other actions else: logger.info("streamondemand.platformcode.launcher executing channel '"+item.action+"' method") itemlist = getattr(channel, item.action)(item) platformtools.render_items(itemlist, item) except urllib2.URLError, e: import traceback logger.error("streamondemand.platformcode.launcher "+traceback.format_exc()) # Grab inner and third party errors if hasattr(e, 'reason'): logger.info("streamondemand.platformcode.launcher Razon del error, codigo: "+str(e.reason[0])+", Razon: " + str(e.reason[1])) texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web" platformtools.dialog_ok("plugin", texto) # Grab server response errors elif hasattr(e, 'code'): logger.info("streamondemand.platformcode.launcher codigo de error HTTP : %d" % e.code) # "El sitio web no funciona correctamente (error http %d)" platformtools.dialog_ok("plugin", config.get_localized_string(30051) % e.code)