diff --git a/plugin.video.alfa/channels/newpct1.json b/plugin.video.alfa/channels/newpct1.json index 5cf00d41..ae11a835 100644 --- a/plugin.video.alfa/channels/newpct1.json +++ b/plugin.video.alfa/channels/newpct1.json @@ -82,6 +82,7 @@ "Descargas2020", "Tumejortorrent", "Torrentrapid", + "Pctnew", "Torrentlocura", "Tvsinpagar", "Planetatorrent", @@ -92,7 +93,7 @@ "id": "clonenewpct1_channels_list", "type": "text", "label": "Lista de clones de NewPct1 y orden de uso", - "default": "('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', 'serie_episodios'), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'planetatorrent', 'http://planetatorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search, listado_busqueda')", + "default": "('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', 'serie_episodios'), ('1', 'pctnew', 'http://pctnew.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'planetatorrent', 'http://planetatorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search, listado_busqueda')", "enabled": true, "visible": false }, diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index e456b356..a55f0871 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -44,19 +44,19 @@ clone_list_random = [] if host_index == 0: #Si el clones es "Aleatorio"... i = 0 - j = 2 #... marcamos el último de los clones "buenos" + j = 3 #... marcamos el último de los clones "buenos" for active_clone, channel_clone, host_clone, contentType_clone, info_clone in clone_list: if i <= j and active_clone == "1": - clone_list_random += [clone_list[i]] #... añadimos el clone activo "bueno" a la lista + clone_list_random += [clone_list[i]] #... añadimos el clone activo "bueno" a la lista else: break i += 1 if clone_list_random: #Si hay clones en la lista aleatoria... clone_list = [random.choice(clone_list_random)] #Seleccionamos un clone aleatorio #logger.debug(clone_list) - host_index = 1 #mutamos el num. de clone para que se procese en el siguiente loop + host_index = 1 #mutamos el num. de clone para que se procese en el siguiente loop -if host_index > 0 or not clone_list_random: #Si el Clone por defecto no es Aleatorio, o hay ya un aleatorio sleccionado... +if host_index > 0 or not clone_list_random: #Si el Clone por defecto no es Aleatorio, o hay ya un aleatorio sleccionado... i = 1 for active_clone, channel_clone, host_clone, contentType_clone, info_clone in clone_list: if i == host_index: @@ -202,20 +202,29 @@ def submenu(item): if "pelisyseries.com" in item.channel_host and item.extra == "varios": #compatibilidad con mispelisy.series.com data = '
  • Documentales
  • ' else: - data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa - if not data: + data_menu = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa + if not data_menu: logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '
  • ([^>]+)<\/a><\/li>' - matches = re.compile(patron, re.DOTALL).findall(data) + matches = re.compile(patron, re.DOTALL).findall(data_menu) if not matches: - logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data_menu) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + matches_hd = [] + if item.extra == "peliculas": + patron = '(?:)?Peliculas(?:<\/strong>)? en HD (?:ver .*?)?<\/a>(.*?)(?:<\/span>)?<\/h3>' + data_hd = scrapertools.find_single_match(data, patron) #Seleccionamos el trozo que nos interesa + if data_hd: + patron = '([^<]+)<\/a>' + matches_hd = re.compile(patron, re.DOTALL).findall(data_hd) + #logger.debug(matches_hd) + for scrapedurl, scrapedtitle in matches: title = scrapedtitle.strip() @@ -229,8 +238,19 @@ def submenu(item): item.extra2 = "" itemlist.append(item.clone(action="listado", title=title, url=scrapedurl)) + + if matches_hd and 'HD' in title: + for scrapedurlcat, scrapedtitlecat in matches_hd: #Pintamos las categorías de peliculas en HD + if '4k' in scrapedtitlecat.lower(): #... ignoramos 4K, no funcionan las categorías + continue + itemlist.append(item.clone(action="listado", title=" - Calidad: " + scrapedtitlecat, url=scrapedurlcat)) + itemlist.append(item.clone(action="alfabeto", title=title + " [A-Z]", url=scrapedurl)) + if item.extra == "varios" and len(itemlist) == 0: + itemlist.append(item.clone(action="listado", title="Varios", url=item.channel_host + "varios/")) + itemlist.append(item.clone(action="alfabeto", title="Varios" + " [A-Z]", url=item.channel_host + "varios/")) + if item.extra == "peliculas": itemlist.append(item.clone(action="listado", title="Películas 4K", url=item.channel_host + "peliculas-hd/4kultrahd/")) itemlist.append(item.clone(action="alfabeto", title="Películas 4K" + " [A-Z]", url=item.channel_host + "peliculas-hd/4kultrahd/")) diff --git a/plugin.video.alfa/lib/sambatools/libsmb.py b/plugin.video.alfa/lib/sambatools/libsmb.py index 64130347..b2cb9e5f 100755 --- a/plugin.video.alfa/lib/sambatools/libsmb.py +++ b/plugin.video.alfa/lib/sambatools/libsmb.py @@ -49,9 +49,15 @@ def connect(url): # logger.info("Url: %s" % url) global remote server_name, server_ip, share_name, path, user, password, domain = parse_url(url) + + #Da problemas asumir que la sesión está abierta. Si se abrió pero ha caducado, dará error. Mejor conectar siempre + """ if not remote or not remote.sock or not server_name == remote.remote_name: remote = SMBConnection(user, password, domain, server_name) remote.connect(server_ip, 139) + """ + remote = SMBConnection(user, password, domain, server_name) + remote.connect(ip=server_ip, timeout=20) return remote, share_name, path diff --git a/plugin.video.alfa/platformcode/platformtools.py b/plugin.video.alfa/platformcode/platformtools.py index c3529238..cc812b84 100644 --- a/plugin.video.alfa/platformcode/platformtools.py +++ b/plugin.video.alfa/platformcode/platformtools.py @@ -151,6 +151,10 @@ def render_items(itemlist, parent_item): # Si el item no contiene categoria, le ponemos la del item padre if item.category == "": item.category = parent_item.category + + # Si title no existe, lo iniciamos como str, para evitar errones "NoType" + if not item.title: + item.title = '' # Si el item no contiene fanart, le ponemos el del item padre if item.fanart == "":