diff --git a/plugin.video.alfa/channels/newpct1.json b/plugin.video.alfa/channels/newpct1.json index 8be41cb8..364395eb 100644 --- a/plugin.video.alfa/channels/newpct1.json +++ b/plugin.video.alfa/channels/newpct1.json @@ -57,6 +57,14 @@ "enabled": true, "visible": false }, + { + "id": "intervenidos_channels_list", + "type": "text", + "label": "Lista de canales y clones de NewPct1 intervenidos y orden de sustitución de URLs", + "default": "('0', 'canal_org', 'canal_des', 'url_org', 'url_des', 'patron1', 'patron2', 'patron3', 'patron4', 'patron5', 'content_inc', 'content_exc', 'ow_force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-([^.]+).html', '', '', '', 'movie', '', 'force')", + "enabled": true, + "visible": false + }, { "id": "seleccionar_ult_temporadda_activa", "type": "bool", diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index b17651bf..d0f6330f 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -34,8 +34,16 @@ for active_clone, channel_clone, host_clone, contentType_clone, info_clone in cl if i == host_index: channel_clone_name = channel_clone #Nombre del Canal elegido host = host_clone #URL del Canal elegido - break + if active_clone == "1": #Comprueba que el clone esté activo + break + channel_clone_name = "*** DOWN ***" #es un fallo masivo ??? + for active_clone, channel_clone, host_clone, contentType_clone, info_clone in clone_list: + if active_clone == "1": #Comprueba que el clone esté activo + 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 @@ -72,6 +80,10 @@ def mainlist(item): thumb_docus = get_thumb("channels_documentary.png") thumb_buscar = get_thumb("search.png") thumb_settings = get_thumb("setting_0.png") + + if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! + itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]")) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos itemlist.append(Item(channel=item.channel, action="submenu_novedades", title="Novedades", url=item.channel_host + "ultimas-descargas/", extra="novedades", thumbnail=thumb_pelis, category=item.category, channel_host=item.channel_host)) @@ -103,7 +115,6 @@ def settingCanal(item): return - def submenu(item): logger.info() @@ -183,6 +194,10 @@ def submenu_novedades(item): item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize() item.extra = "novedades" + if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!! + itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]")) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos + try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, timeout=timeout_search).data) except: @@ -307,7 +322,7 @@ def listado(item): data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url, timeout=timeout).data) except: pass - + patron = '