From 1a76c7cd7973f54b624df621f613df017aa44e3d Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Wed, 4 Jul 2018 14:32:29 +0200 Subject: [PATCH 1/4] Newpct1: nuevo canal virtual con Alta Disponibilidad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Este nuevo canal virtual sustituye a los clones de Newpct1 actuales. Añade funciones de Alta Disponibilidad, cambiando automáticamente a otra web clone si está inaccesible la web en uso. --- plugin.video.alfa/channels/newpct1.json | 565 +++++++ plugin.video.alfa/channels/newpct1.py | 1610 ++++++++++++++++++++ plugin.video.alfa/channels/videolibrary.py | 12 +- plugin.video.alfa/lib/generictools.py | 208 ++- plugin.video.alfa/videolibrary_service.py | 12 +- 5 files changed, 2342 insertions(+), 65 deletions(-) create mode 100644 plugin.video.alfa/channels/newpct1.json create mode 100644 plugin.video.alfa/channels/newpct1.py diff --git a/plugin.video.alfa/channels/newpct1.json b/plugin.video.alfa/channels/newpct1.json new file mode 100644 index 00000000..a121e330 --- /dev/null +++ b/plugin.video.alfa/channels/newpct1.json @@ -0,0 +1,565 @@ +{ + "id": "newpct1", + "name": "Newpct1", + "active": true, + "adult": false, + "language": ["*"], + "thumbnail": "newpct1.png", + "banner": "newpct1.png", + "categories": [ + "movie", + "tvshow", + "anime", + "torrent", + "latino", + "documentary", + "vos", + "direct" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra (TMDB)", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "clonenewpct1_channel_default", + "type": "list", + "label": "Clone de NewPct1 por defecto", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "Torrentrapid", + "Torrentlocura", + "Tumejortorrent", + "Tvsinpagar", + "Descargas2020", + "Mispelisyseries" + ] + }, + { + "id": "clonenewpct1_channels_list", + "type": "text", + "label": "Lista de clones de NewPct1 y orden de uso", + "default": "('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search')", + "enabled": true, + "visible": false + }, + { + "id": "seleccionar_ult_temporadda_activa", + "type": "bool", + "label": "Seleccionar para Videoteca si estará activa solo la última Temporada", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "clonenewpct1_ver_enlaces_veronline", + "type": "list", + "label": "Mostrar enlaces Ver Online", + "default": 1, + "enabled": true, + "visible": true, + "lvalues": [ + "No", + "Todos", + "1", + "5", + "10", + "20" + ] + }, + { + "id": "clonenewpct1_verificar_enlaces_veronline", + "type": "list", + "label": "Verificar enlaces Ver Online", + "default": 1, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Todos", + "1", + "5", + "10", + "20" + ] + }, + { + "id": "clonenewpct1_verificar_enlaces_veronline_validos", + "type": "bool", + "label": "¿Contar sólo enlaces 'verificados' en Ver Online?", + "default": true, + "enabled": true, + "visible": "!eq(-1,'No') + !eq(-2,'No')" + }, + { + "id": "clonenewpct1_excluir1_enlaces_veronline", + "type": "list", + "label": "Excluir Servidores para Ver Online", + "default": 9, + "max_excl": 5, + "enabled": true, + "visible": "!eq(-3,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir2_enlaces_veronline", + "type": "list", + "label": "Excluir Servidores para Ver Online", + "default": 12, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir3_enlaces_veronline", + "type": "list", + "label": "Excluir Servidores para Ver Online", + "default": 20, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir4_enlaces_veronline", + "type": "list", + "label": "Excluir Servidores para Ver Online", + "default": 0, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir5_enlaces_veronline", + "type": "list", + "label": "Excluir Servidores para Ver Online", + "default": 0, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_ver_enlaces_descargas", + "type": "list", + "label": "Mostrar enlaces Descargas", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No", + "Todos", + "1", + "5", + "10", + "20", + "30", + "50", + "100" + ] + }, + { + "id": "clonenewpct1_verificar_enlaces_descargas", + "type": "list", + "label": "Verificar enlaces Descargas", + "default": 1, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Todos", + "1", + "5", + "10", + "20", + "30", + "50", + "100" + ] + }, + { + "id": "clonenewpct1_verificar_enlaces_descargas_validos", + "type": "bool", + "label": "¿Contar sólo enlaces 'verificados' en Descargar?", + "default": true, + "enabled": true, + "visible": "!eq(-1,'No') + !eq(-2,'No')" + }, + { + "id": "clonenewpct1_excluir1_enlaces_descargas", + "type": "list", + "label": "Excluir Servidores para Ver Descargas", + "default": 0, + "enabled": true, + "visible": "!eq(-3,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir2_enlaces_descargas", + "type": "list", + "label": "Excluir Servidores para Ver Descargas", + "default": 0, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir3_enlaces_descargas", + "type": "list", + "label": "Excluir Servidores para Descargas", + "default": 0, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir4_enlaces_descargas", + "type": "list", + "label": "Excluir Servidores para Descargas", + "default": 0, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "clonenewpct1_excluir5_enlaces_descargas", + "type": "list", + "label": "Excluir Servidores para Descargas", + "default": 0, + "enabled": true, + "visible": "!eq(-1,'No')", + "lvalues": [ + "No", + "Bankupload", + "Clipwatching", + "Flashx", + "Katfile", + "Mega", + "Mexashare", + "Movshare", + "Mowvideo", + "Openload", + "Powvideo", + "Rapidgator", + "Streamango", + "Streamcloud", + "Streame", + "Streaminto", + "Streamplay", + "Thevideo", + "Turbobit", + "Uploadedto", + "Uptobox", + "Userscloud", + "Vidabc", + "Vidspot" + ] + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Peliculas", + "default": true, + "enabled": true, + "visible": false + }, + { + "id": "include_in_newest_series", + "type": "bool", + "label": "Incluir en Novedades - Episodios de series", + "default": true, + "enabled": true, + "visible": false + }, + { + "id": "include_in_newest_anime", + "type": "bool", + "label": "Incluir en Novedades - Anime", + "default": true, + "enabled": true, + "visible": false + }, + { + "id": "include_in_newest_documentales", + "type": "bool", + "label": "Incluir en Novedades - Documentales", + "default": true, + "enabled": true, + "visible": false + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Documentales", + "default": true, + "enabled": true, + "visible": false + }, + { + "id": "include_in_newest_4k", + "type": "bool", + "label": "Incluir en Novedades - 4K", + "default": true, + "enabled": true, + "visible": false + }, + { + "id": "clonenewpct1_timeout_downloadpage", + "type": "list", + "label": "Timeout (segs.) en descarga de páginas o verificación de servidores", + "default": 5, + "enabled": true, + "visible": true, + "lvalues": [ + "None", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + } + ] +} \ No newline at end of file diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py new file mode 100644 index 00000000..8edb752c --- /dev/null +++ b/plugin.video.alfa/channels/newpct1.py @@ -0,0 +1,1610 @@ +# -*- coding: utf-8 -*- + +import re +import sys +import urllib +import urlparse +import datetime +import ast + +from channelselector import get_thumb +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from platformcode import config, logger +from core import tmdb +from lib import generictools + +channel_py = 'newpct1' + +#Código para permitir usar un único canal para todas las webs clones de NewPct1 +clone_list = config.get_setting('clonenewpct1_channels_list', channel_py) #Carga lista de clones +clone_list = ast.literal_eval(clone_list) #la convierte en array +host_index = 0 +host_index = config.get_setting('clonenewpct1_channel_default', channel_py) #Clone por defecto +i = 0 +for active_clone, channel_clone, host_clone, contentType_clone, info_clone in clone_list: + if i == host_index: + channel_clone_name = channel_clone #Nombre del Canal elegido + host = host_clone #URL del Canal elegido + break + i += 1 +item = Item() +if item.channel != channel_py: + item.channel = channel_py + +#Carga de opciones del canal +__modo_grafico__ = config.get_setting('modo_grafico', channel_py) #TMDB? +modo_ultima_temp = config.get_setting('seleccionar_ult_temporadda_activa', channel_py) #Actualización sólo últ. Temporada? +timeout = config.get_setting('clonenewpct1_timeout_downloadpage', channel_py) #Timeout downloadpage +if timeout == 0: timeout = None + + +def mainlist(item): + logger.info() + + itemlist = [] + + if not item.channel_host: + item.channel_host = host + if item.category.lower() == channel_py: + item.category = channel_clone_name.capitalize() + + thumb_pelis = get_thumb("channels_movie.png") + thumb_pelis_hd = get_thumb("channels_movie_hd.png") + thumb_series = get_thumb("channels_tvshow.png") + thumb_series_hd = get_thumb("channels_tvshow_hd.png") + thumb_series_az = get_thumb("channels_tvshow_az.png") + thumb_docus = get_thumb("channels_documentary.png") + thumb_buscar = get_thumb("search.png") + thumb_settings = get_thumb("setting_0.png") + + itemlist.append(Item(channel=item.channel, action="submenu", title="Películas", url=item.channel_host, + extra="peliculas", thumbnail=thumb_pelis, category=item.category)) + + itemlist.append(Item(channel=item.channel, action="submenu", title="Series", url=item.channel_host, extra="series", + thumbnail=thumb_series, category=item.category)) + + itemlist.append(Item(channel=item.channel, action="submenu", title="Documentales", url=item.channel_host, extra="varios", + thumbnail=thumb_docus, category=item.category)) + itemlist.append( + Item(channel=item.channel, action="search", title="Buscar", url=item.channel_host + "buscar", thumbnail=thumb_buscar, category=item.category)) + + itemlist.append( + Item(channel=item.channel, action="", title="[COLOR yellow]Configuración de Servidores:[/COLOR]", url="", thumbnail=thumb_settings, category=item.category)) + itemlist.append( + Item(channel=item.channel, action="settingCanal", title="Servidores para Ver Online y Descargas", url="", thumbnail=thumb_settings, category=item.category)) + + return itemlist + + +def settingCanal(item): + from platformcode import platformtools + return platformtools.show_channel_settings() + + +def submenu(item): + logger.info() + itemlist = [] + + data = '' + try: + data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url, timeout=timeout).data) + except: + pass + + patron = '