diff --git a/plugin.video.alfa/channels/pelismedia.json b/plugin.video.alfa/channels/pelismedia.json new file mode 100644 index 00000000..72726692 --- /dev/null +++ b/plugin.video.alfa/channels/pelismedia.json @@ -0,0 +1,88 @@ +{ + "id": "pelismedia", + "name": "PelisMedia", + "active": true, + "adult": false, + "language": ["lat"], + "thumbnail": "https://s14.postimg.cc/eclmujsch/12715507_1112827435402340_7302361220060367711_n.jpg", + "categories": ["movie", "tvshow"], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Peliculas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_series", + "type": "bool", + "label": "Incluir en Novedades - Series", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 2, + "enabled": true, + "visible": true, + "lvalues": [ + "Perfil 3", + "Perfil 2", + "Perfil 1", + "Ninguno" + ] + }, + { + "id": "episodios_x_pag", + "type": "list", + "label": "Episodios por página", + "default": 2, + "enabled": true, + "visible": true, + "lvalues": [ + "10", + "15", + "20", + "25", + "30" + ] + }, + { + "id": "temporada_o_todos", + "type": "bool", + "label": "Mostrar temporadas", + "default": true, + "enabled": true, + "visible": true + } + ] +} \ No newline at end of file diff --git a/plugin.video.alfa/channels/pelismedia.py b/plugin.video.alfa/channels/pelismedia.py new file mode 100644 index 00000000..0712b03f --- /dev/null +++ b/plugin.video.alfa/channels/pelismedia.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +from core import httptools +from core import scrapertools +from core import servertools +from core import tmdb +from core.item import Item +from platformcode import config, logger +from channelselector import get_thumb + +__perfil__ = int(config.get_setting('perfil', 'pelisultra')) + +# Fijar perfil de color +perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00'], + ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E'], + ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE']] + +if __perfil__ < 3: + color1, color2, color3 = perfil[__perfil__] +else: + color1 = color2 = color3 = "" + +host="http://www.pelismedia.com" + +def mainlist(item): + logger.info() + itemlist = [] + item.thumbnail = get_thumb('movies', auto=True) + itemlist.append(item.clone(title="Películas:", folder=False, text_color="0xFFD4AF37", text_bold=True)) + itemlist.append(Item(channel = item.channel, title = " Novedades", action = "peliculas", url = host, + thumbnail=get_thumb('newest', auto=True))) + itemlist.append(Item(channel = item.channel, title = " Estrenos", action = "peliculas", url = host + "/genero/estrenos/", + thumbnail=get_thumb('premieres', auto=True))) + itemlist.append(Item(channel = item.channel, title = " Por género", action = "genero", url = host + "/genero/", + thumbnail=get_thumb('genres', auto=True) )) + item.thumbnail = get_thumb('tvshows', auto=True) + itemlist.append(item.clone(title="Series:", folder=False, text_color="0xFFD4AF37", text_bold=True)) + itemlist.append(Item(channel = item.channel, title = " Todas las series", action = "series", url = host + "/series/", + thumbnail=get_thumb('all', auto=True))) + itemlist.append(Item(channel = item.channel, title = " Nuevos episodios", action = "nuevos_episodios", url = host + "/episodio/", + thumbnail=get_thumb('new episodes', auto=True))) + itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search", url = host, text_color="red", text_bold=True, + thumbnail=get_thumb('search', auto=True))) + itemlist.append(item.clone(title="Configurar canal...", text_color="green", action="configuracion", text_bold=True)) + return itemlist + +def configuracion(item): + from platformcode import platformtools + ret = platformtools.show_channel_settings() + platformtools.itemlist_refresh() + return ret + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria in ["peliculas", "latino"]: + item.url = host + itemlist = peliculas(item) + elif categoria == 'terror': + item.url = host + '/genero/terror/' + itemlist = peliculas(item) + elif categoria == "series": + item.url = host + "/episodio/" + itemlist = nuevos_episodios(item) + if "Pagina" 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 peliculas(item): + #logger.info() + logger.info(item) + itemlist = [] + data = httptools.downloadpage(item.url).data + + data2 = scrapertools.find_single_match(data,'(?s)