diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index 8a212ebe..dde43615 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,17 +19,17 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - ¤ allcalidad ¤ jkanime - ¤ miradetodo ¤ asialiveaction - ¤ pedropolis ¤ cinemahd - ¤ inkapelis ¤ pelisplusco - ¤ pelisr ¤ vepelis - ¤ ver-peliculas ¤ divxtotal - ¤ estrenosgo ¤ newpct1 - ¤ pelispedia + ¤ allcalidad ¤ cinecalidad + ¤ repelis ¤ cumlouder + ¤ porntrex ¤ crunchyroll + ¤ pedropolis ¤ pepecine + ¤ divxtotal ¤ elitetorrent + ¤ estrenosgo ¤ grantorrent + ¤ mejortorrent1 ¤ newpct1 + ¤ danimados ¤ fanpelis + ¤ repelis ¤ arreglos internos - - ¤ Agradecimientos a @angedam por colaborar en ésta versión + ¤ Agradecimientos a @angedam, @chivmalev, @alaquepasa por colaborar en ésta versión Navega con Kodi por páginas web para ver sus videos de manera fácil. diff --git a/plugin.video.alfa/channels/allcalidad.py b/plugin.video.alfa/channels/allcalidad.py index 0b629353..6c5930d8 100755 --- a/plugin.video.alfa/channels/allcalidad.py +++ b/plugin.video.alfa/channels/allcalidad.py @@ -34,12 +34,40 @@ def mainlist(item): 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 = "Por género", action = "generos_years", url = host, extra = "Genero", thumbnail = get_thumb("genres", auto = True) )) itemlist.append(Item(channel = item.channel, title = "Por año", action = "generos_years", url = host, extra = ">Año<", thumbnail = get_thumb("year", auto = True))) - itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "peliculas", url = host + "/favorites", thumbnail = get_thumb("favorites", auto = True) )) + itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "favorites", url = host + "/favorites", thumbnail = get_thumb("favorites", 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))) autoplay.show_option(item.channel, itemlist) return itemlist +def favorites(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + patron = '(?s)short_overlay.*?= 0: color1, color2, color3, color4, color5 = perfil[__perfil__ - 1] else: color1 = color2 = color3 = color4 = color5 = "" - host = "http://www.crunchyroll.com" proxy_u = "http://anonymouse.org/cgi-bin/anon-www.cgi/" proxy_e = "http://proxyanonimo.es/browse.php?u=" @@ -27,24 +26,20 @@ proxy_e = "http://proxyanonimo.es/browse.php?u=" def login(): logger.info() - langs = ['deDE', 'ptPT', 'frFR', 'itIT', 'enUS', 'esLA', 'esES'] lang = langs[config.get_setting("crunchyrollidioma", "crunchyroll")] - httptools.downloadpage("http://www.crunchyroll.com/ajax/", "req=RpcApiTranslation_SetLang&locale=%s" % lang) - - login_page = "https://www.crunchyroll.com/login" + httptools.downloadpage(host + "/ajax/", "req=RpcApiTranslation_SetLang&locale=%s" % lang) + login_page = host.replace("http","https") + "/login" user = config.get_setting("crunchyrolluser", "crunchyroll") password = config.get_setting("crunchyrollpassword", "crunchyroll") if not user or not password: return False, "", "" data = httptools.downloadpage(login_page).data - if not "Redirecting" in data: token = scrapertools.find_single_match(data, 'name="login_form\[_token\]" value="([^"]+)"') redirect_url = scrapertools.find_single_match(data, 'name="login_form\[redirect_url\]" value="([^"]+)"') post = "login_form%5Bname%5D=" + user + "&login_form%5Bpassword%5D=" + password + \ "&login_form%5Bredirect_url%5D=" + redirect_url + "&login_form%5B_token%5D=" + token - data = httptools.downloadpage(login_page, post).data if not "<title>Redirecting" in data: if "Usuario %s no disponible" % user in data: @@ -53,7 +48,6 @@ def login(): return False, "Es necesario resolver un captcha. Loguéate desde un navegador y vuelve a intentarlo", "" else: return False, "No se ha podido realizar el login.", "" - data = httptools.downloadpage(host).data premium = scrapertools.find_single_match(data, ',"premium_status":"([^"]+)"') premium = premium.replace("_", " ").replace("free trial", "Prueba Gratuita").capitalize() @@ -67,7 +61,6 @@ def mainlist(item): logger.info() itemlist = [] item.text_color = color1 - proxy_usa = config.get_setting("proxy_usa", "crunchyroll") proxy_spain = config.get_setting("proxy_spain", "crunchyroll") item.login = False @@ -82,14 +75,12 @@ def mainlist(item): httptools.downloadpage("http://proxyanonimo.es/") item.proxy = "spain" host = proxy_e + host - if not item.login and error_message: itemlist.append(item.clone(title=error_message, action="configuracion", folder=False, text_color=color4)) elif item.login: itemlist.append(item.clone(title="Tipo de cuenta: %s" % premium, action="", text_color=color4)) elif item.proxy: itemlist.append(item.clone(title="Usando proxy: %s" % item.proxy.capitalize(), action="", text_color=color4)) - itemlist.append(item.clone(title="Anime", action="", text_color=color2)) item.contentType = "tvshow" itemlist.append( @@ -104,39 +95,32 @@ def mainlist(item): itemlist.append( item.clone(title=" Popular", action="lista", url=host + "/videos/drama/popular/ajax_page?pg=0", page=0)) itemlist.append(item.clone(title=" Índice Alfabético", action="indices", - url="http://www.crunchyroll.com/videos/drama/alpha")) - + url=host + "/videos/drama/alpha")) if item.proxy != "usa": itemlist.append(item.clone(action="calendario", title="Calendario de Estrenos Anime", text_color=color4, url=host + "/simulcastcalendar")) itemlist.append(item.clone(title="Configuración del canal", action="configuracion", text_color="gold")) - return itemlist def configuracion(item): from platformcode import platformtools ret = platformtools.show_channel_settings() - user = config.get_setting("crunchyrolluser", "crunchyroll") password = config.get_setting("crunchyrollpassword", "crunchyroll") sub = config.get_setting("crunchyrollsub", "crunchyroll") - config.set_setting("crunchyrolluser", user) config.set_setting("crunchyrollpassword", password) values = [6, 5, 4, 3, 2, 1, 0] config.set_setting("crunchyrollsub", str(values[sub])) platformtools.itemlist_refresh() - return ret def lista(item): logger.info() itemlist = [] - data = httptools.downloadpage(item.url).data - next = item.url.replace("?pg=%s" % item.page, "?pg=%s" % str(item.page + 1)) data_next = httptools.downloadpage(next).data patron = '<li id="media_group_(\d+)".*?title="([^"]+)".*?href="([^"]+)".*?src="([^"]+)"' \ @@ -154,18 +138,15 @@ def lista(item): itemlist.append(item.clone(action="episodios", url=url, title=scrapedtitle, thumbnail=thumb, contentTitle=title, contentSerieName=title, infoLabels={'plot': plot}, text_color=color2)) - if '<li id="media_group' in data_next: itemlist.append(item.clone(action="lista", url=next, title=">> Página Siguiente", page=item.page + 1, text_color="")) - return itemlist def episodios(item): logger.info() itemlist = [] - data = httptools.downloadpage(item.url).data data = re.sub(r'\n|\t|\s{2,}', '', data) patron = '<li id="showview_videos.*?href="([^"]+)".*?(?:src|data-thumbnailUrl)="([^"]+)".*?media_id="([^"]+)"' \ @@ -215,12 +196,10 @@ def episodios(item): def indices(item): logger.info() itemlist = [] - if not item.url: - itemlist.append(item.clone(title="Alfabético", url="http://www.crunchyroll.com/videos/anime/alpha")) - itemlist.append(item.clone(title="Géneros", url="http://www.crunchyroll.com/videos/anime")) - itemlist.append(item.clone(title="Temporadas", url="http://www.crunchyroll.com/videos/anime")) - + itemlist.append(item.clone(title="Alfabético", url=host + "/videos/anime/alpha")) + itemlist.append(item.clone(title="Géneros", url=host + "/videos/anime")) + itemlist.append(item.clone(title="Temporadas", url=host + "/videos/anime")) else: data = httptools.downloadpage(item.url).data if "Alfabético" in item.title: @@ -235,7 +214,6 @@ def indices(item): url = proxy_u + host + url else: url = host + url - itemlist.append(item.clone(action="alpha", title=title, url=url, page=0)) elif "Temporadas" in item.title: bloque = scrapertools.find_single_match(data, @@ -249,7 +227,6 @@ def indices(item): url = proxy_u + host + url else: url = host + url - itemlist.append(item.clone(action="lista", title=title, url=url, page=0)) else: bloque = scrapertools.find_single_match(data, '<div class="genre-selectors selectors">(.*?)</div>') @@ -260,18 +237,14 @@ def indices(item): url = proxy_e + url.replace("&", "%26") elif item.proxy == "usa": url = proxy_u + url - itemlist.append(item.clone(action="lista", title=title, url=url, page=0)) - return itemlist def alpha(item): logger.info() itemlist = [] - data = httptools.downloadpage(item.url).data - patron = '<div class="wrapper hover-toggle-queue.*?title="([^"]+)".*?href="([^"]+)".*?src="([^"]+)"' \ '.*?<span class="series-data.*?>\s*([^<]+)</span>.*?<p.*?>(.*?)</p>' matches = scrapertools.find_multiple_matches(data, patron) @@ -285,16 +258,13 @@ def alpha(item): itemlist.append(item.clone(action="episodios", url=url, title=scrapedtitle, thumbnail=thumb, contentTitle=title, contentSerieName=title, infoLabels={'plot': plot}, text_color=color2)) - return itemlist def calendario(item): logger.info() itemlist = [] - data = httptools.downloadpage(item.url).data - patron = '<div class="specific-date">.*?datetime="\d+-(\d+)-(\d+).*?class="day-name">.*?>\s*([^<]+)</time>(.*?)</section>' bloques = scrapertools.find_multiple_matches(data, patron) for mes, dia, title, b in bloques: @@ -309,10 +279,8 @@ def calendario(item): subt = re.sub(r"\s{2,}", " ", subt) if "<time" in subt: subt = re.sub(r"<time.*?>", "", subt).replace("</time>", "") - scrapedtitle = " [%s] %s - %s" % (hora, scrapertools.htmlclean(title), subt) scrapedtitle = re.sub(r"\[email protected\]|\[email\xc2\xa0protected\]", "Idolm@ster", scrapedtitle) - if "Disponible" in scrapedtitle: if item.proxy == "spain": url = urllib.unquote(url.replace("/browse.php?u=", "").replace("&b=12", "")) @@ -329,7 +297,6 @@ def calendario(item): .replace("&b=12", "").replace("_large", "_full")) itemlist.append(item.clone(action=action, url=url, title=scrapedtitle, contentTitle=title, thumbnail=thumb, text_color=color2, contentSerieName=title, server=server)) - next = scrapertools.find_single_match(data, 'js-pagination-next"\s*href="([^"]+)"') if next: if item.proxy == "spain": @@ -344,7 +311,6 @@ def calendario(item): else: prev = host + prev itemlist.append(item.clone(action="calendario", url=prev, title="<< Semana Anterior")) - return itemlist @@ -353,6 +319,5 @@ def play(item): if item.login and not "[V]" in item.title: post = "cbelapsed=60&h=&media_id=%s" % item.media_id + "&req=RpcApiVideo_VideoView&cbcallcount=1&ht=0" \ "&media_type=1&video_encode_id=0&playhead=10000" - httptools.downloadpage("http://www.crunchyroll.com/ajax/", post) - + httptools.downloadpage(host + "/ajax/", post) return [item] diff --git a/plugin.video.alfa/channels/cumlouder.py b/plugin.video.alfa/channels/cumlouder.py old mode 100755 new mode 100644 index 76b13e79..81a26a7f --- a/plugin.video.alfa/channels/cumlouder.py +++ b/plugin.video.alfa/channels/cumlouder.py @@ -18,6 +18,7 @@ def mainlist(item): itemlist.append(item.clone(title="Últimos videos", action="videos", url="https://www.cumlouder.com/")) itemlist.append(item.clone(title="Categorias", action="categorias", url="https://www.cumlouder.com/categories/")) itemlist.append(item.clone(title="Pornstars", action="pornstars_list", url="https://www.cumlouder.com/girls/")) + itemlist.append(item.clone(title="Listas", action="series", url="https://www.cumlouder.com/series/")) itemlist.append(item.clone(title="Buscar", action="search", url="https://www.cumlouder.com/search?q=%s")) return itemlist @@ -82,10 +83,8 @@ def categorias(item): itemlist = [] data = get_data(item.url) - # logger.info("channels.cumlouder data="+data) - patron = '<a tag-url="[^"]+" class="[^"]+" href="([^"]+)" title="([^"]+)">[^<]+' - patron += '<img class="thumb" src="([^"]+)".*?<span class="cantidad">([^"]+)</span>' - + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + patron = '<a tag-url=.*?href="([^"]+)" title="([^"]+)".*?<img class="thumb" src="([^"]+)".*?<span class="cantidad">([^<]+)</span>' matches = re.compile(patron, re.DOTALL).findall(data) for url, title, thumbnail, count in matches: if "go.php?" in url: @@ -109,6 +108,28 @@ def categorias(item): return itemlist +def series(item): + logger.info() + itemlist = [] + + data = get_data(item.url) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + patron = '<a onclick=.*?href="([^"]+)".*?\<img src="([^"]+)".*?h2 itemprop="name">([^<]+).*?p>([^<]+)</p>' + matches = re.compile(patron, re.DOTALL).findall(data) + for url, thumbnail, title, count in matches: + itemlist.append( + item.clone(title="%s (%s) " % (title, count), url=urlparse.urljoin(item.url, url), action="videos", thumbnail=thumbnail)) + + # Paginador + matches = re.compile('<li[^<]+<a href="([^"]+)" rel="nofollow">Next[^<]+</a[^<]+</li>', re.DOTALL).findall(data) + if matches: + if "go.php?" in matches[0]: + url = urllib.unquote(matches[0].split("/go.php?u=")[1].split("&")[0]) + else: + url = urlparse.urljoin(item.url, matches[0]) + itemlist.append(item.clone(title="Pagina Siguiente", url=url)) + + return itemlist def videos(item): logger.info() @@ -116,7 +137,6 @@ def videos(item): data = get_data(item.url) patron = '<a class="muestra-escena" href="([^"]+)" title="([^"]+)"[^<]+<img class="thumb" src="([^"]+)".*?<span class="minutos"> <span class="ico-minutos sprite"></span> ([^<]+)</span>' - matches = re.compile(patron, re.DOTALL).findall(data) for url, title, thumbnail, duration in matches: if "go.php?" in url: diff --git a/plugin.video.alfa/channels/divxtotal.py b/plugin.video.alfa/channels/divxtotal.py index 8b3ca25e..8e1ba213 100644 --- a/plugin.video.alfa/channels/divxtotal.py +++ b/plugin.video.alfa/channels/divxtotal.py @@ -100,14 +100,14 @@ def categorias(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos matches = re.compile(patron, re.DOTALL).findall(data) if not matches: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug(item.url_plus) #logger.debug(matches) @@ -173,7 +173,7 @@ def listado(item): cnt_tot = 40 # Poner el num. máximo de items por página cnt_title = 0 # Contador de líneas insertadas en Itemlist - inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable + inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable fin = inicio + 10 # Después de este tiempo pintamos (segundos) timeout_search = timeout # Timeout para descargas if item.extra == 'search': @@ -182,8 +182,8 @@ def listado(item): timeout_search = 5 # Timeout un poco más largo para las búsquedas #Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios - title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas - if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada + title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas + if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item del item.title_lista # ... limpiamos @@ -206,7 +206,7 @@ def listado(item): if not data and not item.extra2: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #Patrón para todo, menos para Series completas, incluido búsquedas en cualquier caso patron = '<tr><td(?: class="[^"]+")?><a href="([^"]+)".?title="([^"]+)".*?<\/a><\/td><td(?: class="[^"]+")?>(?:<a href="[^"]+">)?(.*?)(?:<\/a>)?<\/td><td(?: class="[^"]+")?>.*?<\/td><td(?: class="[^"]+")?>(.*?)<\/td><\/tr>' @@ -224,7 +224,7 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: 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 + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -547,7 +547,7 @@ def episodios(item): itemlist = [] item.category = categoria - logger.debug(item) + #logger.debug(item) if item.from_title: item.title = item.from_title @@ -616,8 +616,8 @@ def episodios(item): itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: 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 - logger.debug("PATRON: " + patron) - logger.debug(matches) + #logger.debug("PATRON: " + patron) + #logger.debug(matches) #logger.debug(data) season = max_temp diff --git a/plugin.video.alfa/channels/dospelis.json b/plugin.video.alfa/channels/dospelis.json index 9a9dc8d9..13130b10 100644 --- a/plugin.video.alfa/channels/dospelis.json +++ b/plugin.video.alfa/channels/dospelis.json @@ -3,7 +3,7 @@ "name": "DosPelis", "active": true, "adult": false, - "language": ["lat", "cast", "vose"], + "language": ["lat", "cast"], "thumbnail": "https://www.dospelis.com/wp-content/uploads/2018/07/dospelislogo.png", "banner": "", "categories": [ diff --git a/plugin.video.alfa/channels/elitetorrent.json b/plugin.video.alfa/channels/elitetorrent.json index 72705725..ec17889b 100644 --- a/plugin.video.alfa/channels/elitetorrent.json +++ b/plugin.video.alfa/channels/elitetorrent.json @@ -3,7 +3,7 @@ "name": "Elite Torrent", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "elitetorrent.png", "banner": "elitetorrent.png", "categories": [ diff --git a/plugin.video.alfa/channels/elitetorrent.py b/plugin.video.alfa/channels/elitetorrent.py index 0faf759c..6842c037 100644 --- a/plugin.video.alfa/channels/elitetorrent.py +++ b/plugin.video.alfa/channels/elitetorrent.py @@ -49,14 +49,14 @@ def submenu(item): if not data: logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL: " + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #Algo no funciona, pintamos lo que tenemos + return itemlist #Algo no funciona, pintamos lo que tenemos - patron = '<div class="cab_menu">.*?<\/div>' #Menú principal + patron = '<div class="cab_menu">.*?<\/div>' #Menú principal data1 = scrapertools.get_match(data, patron) - patron = '<div id="menu_langen">.*?<\/div>' #Menú de idiomas + patron = '<div id="menu_langen">.*?<\/div>' #Menú de idiomas data1 += scrapertools.get_match(data, patron) - patron = '<a href="(.*?)".*?title="(.*?)"' #Encontrar todos los apartados + patron = '<a href="(.*?)".*?title="(.*?)"' #Encontrar todos los apartados matches = re.compile(patron, re.DOTALL).findall(data1) if not matches: item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada @@ -68,25 +68,25 @@ def submenu(item): logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data1) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: scrapedtitle = re.sub('\r\n', '', scrapedtitle).decode('utf8').strip() scrapedtitle = scrapedtitle.replace(" torrent", "").replace(" Torrent", "").replace("Series y ", "").title() - if "castellano" in scrapedtitle.lower(): #Evita la entrada de peliculas castellano del menú de idiomas + if "castellano" in scrapedtitle.lower(): #Evita la entrada de peliculas castellano del menú de idiomas continue - if item.extra == "series": #Tratamos Series + if item.extra == "series": #Tratamos Series if not "/serie" in scrapedurl: continue - else: #Tratamos Películas + else: #Tratamos Películas if "/serie" in scrapedurl: continue itemlist.append(item.clone(action="listado", title=scrapedtitle, url=scrapedurl)) - if item.extra == "series": #Añadimos Series VOSE que está fuera del menú principal + if item.extra == "series": #Añadimos Series VOSE que está fuera del menú principal itemlist.append(item.clone(action="listado", title="Series VOSE", url=host + "/series-vose/")) return itemlist @@ -103,24 +103,24 @@ def listado(item): except: pass - if not data: #Si la web está caída salimos sin dar error + if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '<div id="principal">.*?<\/nav><\/div><\/div>' data = scrapertools.find_single_match(data, patron) - patron = '<li>.*?<a href="(.*?)".*?' #url - patron += 'title="(.*?)".*?' #título - patron += 'src="(.*?)".*?' #thumb - patron += "title='(.*?)'.*?" #categoría, idioma - patron += '"><i>(.*?)<\/i><\/span.*?' #calidad - patron += '="dig1">(.*?)<.*?' #tamaño - patron += '="dig2">(.*?)<\/span><\/div>' #tipo tamaño + patron = '<li>.*?<a href="(.*?)".*?' #url + patron += 'title="(.*?)".*?' #título + patron += 'src="(.*?)".*?' #thumb + patron += "title='(.*?)'.*?" #categoría, idioma + patron += '"><i>(.*?)<\/i><\/span.*?' #calidad + patron += '="dig1">(.*?)<.*?' #tamaño + patron += '="dig2">(.*?)<\/span><\/div>' #tipo tamaño matches = re.compile(patron, re.DOTALL).findall(data) - if not matches and not '<title>503 Backend fetch failed' in data: #error + if not matches and not '503 Backend fetch failed' in data: #error item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Llamamos al método para el pintado del error @@ -128,21 +128,21 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) #logger.debug(data) for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedcategory, scrapedcalidad, scrapedsize, scrapedsizet in matches: - item_local = item.clone() #Creamos copia de Item para trabajar + item_local = item.clone() #Creamos copia de Item para trabajar title = re.sub('\r\n', '', scrapedtitle).decode('utf8').strip() title = title.replace(" torrent", "").replace(" Torrent", "").replace("Series y ", "") item_local.url = urlparse.urljoin(host, scrapedurl) item_local.thumbnail = urlparse.urljoin(host, scrapedthumbnail) - if "---" in scrapedcalidad: #limpiamos calidades + if "---" in scrapedcalidad: #limpiamos calidades scrapedcalidad = '' if "microhd" in title.lower(): item_local.quality = "microHD" @@ -158,7 +158,7 @@ def listado(item): else: item_local.quality += ' [%s %s]' % (scrapedsize.replace(".", ","), scrapedsizet) - item_local.language = [] #Verificamos el idioma por si encontramos algo + item_local.language = [] #Verificamos el idioma por si encontramos algo if "latino" in scrapedcategory.lower() or "latino" in item.url or "latino" in title.lower(): item_local.language += ["LAT"] if "ingles" in scrapedcategory.lower() or "ingles" in item.url or "vose" in scrapedurl or "vose" in item.url: @@ -175,7 +175,7 @@ def listado(item): title = re.sub(r'\??\s?\d*?\&.*', '', title).title().strip() item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título - if item_local.extra == "peliculas": #preparamos Item para películas + if item_local.extra == "peliculas": #preparamos Item para películas if "/serie" in scrapedurl or "/serie" in item.url: continue if not "/serie" in scrapedurl and not "/serie" in item.url: @@ -183,7 +183,7 @@ def listado(item): item_local.contentTitle = title item_local.extra = "peliculas" - if item_local.extra == "series": #preparamos Item para series + if item_local.extra == "series": #preparamos Item para series if not "/serie" in scrapedurl and not "/serie" in item.url: continue if "/serie" in scrapedurl or "/serie" in item.url: @@ -202,7 +202,7 @@ def listado(item): item_local.contentEpisodeNumber = 1 item_local.contentSerieName = title if epi_mult: - title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(epi_mult).zfill(2)) #Creamos un título con el rango de episodios + title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(epi_mult).zfill(2)) #Creamos un título con el rango de episodios else: title = '%sx%s ' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) @@ -214,7 +214,7 @@ def listado(item): if item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global, pasamos tmdb.set_infoLabels(item_local, True) - itemlist.append(item_local.clone()) #Pintar pantalla + itemlist.append(item_local.clone()) #Pintar pantalla #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo @@ -227,12 +227,12 @@ def listado(item): # Extrae el paginador patron = '
.*?>": + if "Página siguiente >>" in itemlist[-1].title: itemlist.pop() # Se captura la excepción, para no interrumpir al canal novedades si un canal falla diff --git a/plugin.video.alfa/channels/estrenosgo.json b/plugin.video.alfa/channels/estrenosgo.json index 5e335051..bf922a70 100755 --- a/plugin.video.alfa/channels/estrenosgo.json +++ b/plugin.video.alfa/channels/estrenosgo.json @@ -3,7 +3,7 @@ "name": "EstrenosGo", "active": true, "adult": false, - "language": ["cast", "LAT", "VOSE", "VOS"], + "language": ["cast", "lat"], "fanart": "estrenosgo.png", "thumbnail": "estrenosgo.png", "banner": "estrenosgo.png", @@ -11,7 +11,8 @@ "movie", "tvshow", "torrent", - "direct" + "direct", + "vos" ], "settings": [ { diff --git a/plugin.video.alfa/channels/estrenosgo.py b/plugin.video.alfa/channels/estrenosgo.py index 4036f3af..72cfa220 100644 --- a/plugin.video.alfa/channels/estrenosgo.py +++ b/plugin.video.alfa/channels/estrenosgo.py @@ -113,7 +113,7 @@ def categorias(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") matches = re.compile(patron, re.DOTALL).findall(data) @@ -121,7 +121,7 @@ def categorias(item): if not matches: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug(matches) @@ -182,7 +182,7 @@ def listado(item): cnt_tot = 40 # Poner el num. máximo de items por página cnt_title = 0 # Contador de líneas insertadas en Itemlist - inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable + inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable fin = inicio + 10 # Después de este tiempo pintamos (segundos) timeout_search = timeout # Timeout para descargas if item.extra == 'search': @@ -191,9 +191,9 @@ def listado(item): timeout_search = 5 # Timeout un poco más largo para las búsquedas #Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios - title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas - if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada - title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item + title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas + if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada + title_lista.extend(item.title_lista) # Se usa la lista de páginas anteriores en Item del item.title_lista # ... limpiamos if not item.extra2: # Si viene de Catálogo o de Alfabeto @@ -215,7 +215,12 @@ def listado(item): if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Patrón para todo menos para Series completas patron = '
' @@ -237,7 +242,12 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: 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 + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -253,9 +263,9 @@ def listado(item): except: last_page = 1 #Si no lo encuentra, lo ponemos a 1 - if item.extra == 'series': #Si son series completas, vamos a un listado especializado - item.matches = matches #salvamos todas las matches, no hay paginación - return listado_series(item) #llamamos a un método especializado + if item.extra == 'series': #Si son series completas, vamos a un listado especializado + item.matches = matches #salvamos todas las matches, no hay paginación + return listado_series(item) #llamamos a un método especializado #Empezamos el procesado de matches for scrapedurl, scrapedenlace, scrapedthumbnail, scrapedtitle, cat_ppal, cat_sec, opciones in matches: @@ -280,25 +290,25 @@ def listado(item): except: pass - if not data_serie: #Si la web está caída salimos sin dar error. Pintamos el episodio + if not data_serie: #Si la web está caída salimos sin dar error. Pintamos el episodio logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + scrapedurl + " / SERIE: " + cat_sec) else: patron_serie = '
.*?.*?<\/a>.*?' url = scrapertools.find_single_match(data_serie, patron_serie) #buscamos la url de la serie completa if url: url = host + url - extra = 'series' #es una serie completa - title_lista += [cat_sec] #la añadimos a la lista de series completas procesadas - title = cat_sec #salvamos el título de la serie completa + extra = 'series' #es una serie completa + title_lista += [cat_sec] #la añadimos a la lista de series completas procesadas + title = cat_sec #salvamos el título de la serie completa else: - url = scrapedurl #No se encuentra la Serie, se trata como Episodio suelto + url = scrapedurl #No se encuentra la Serie, se trata como Episodio suelto - elif "Archivo Torrent" not in scrapedenlace and "Video Online" not in scrapedenlace: #Si no tiene enlaces pasamos + elif "Archivo Torrent" not in scrapedenlace and "Video Online" not in scrapedenlace: #Si no tiene enlaces pasamos continue cnt_title += 1 - item_local = item.clone() #Creamos copia de Item para trabajar - if item_local.tipo: #... y limpiamos + item_local = item.clone() #Creamos copia de Item para trabajar + if item_local.tipo: #... y limpiamos del item_local.tipo if item_local.totalItems: del item_local.totalItems @@ -317,18 +327,18 @@ def listado(item): item_local.text_color = True del item_local.text_color - title_subs = [] #creamos una lista para guardar info importante - item_local.language = [] #creamos lista para los idiomas - item_local.quality = '' #iniciamos calidad + title_subs = [] #creamos una lista para guardar info importante + item_local.language = [] #creamos lista para los idiomas + item_local.quality = '' #iniciamos calidad quality_alt = '' - if 'series' not in cat_ppal: #si no son series, contiene la calidad + if 'series' not in cat_ppal: #si no son series, contiene la calidad quality_alt = cat_sec.lower().strip() - item_local.extra = extra #guardamos el extra procesado - item_local.url = url #guardamos la url final - item_local.thumbnail = host[:-1] + scrapedthumbnail #guardamos el thumb + item_local.extra = extra #guardamos el extra procesado + item_local.url = url #guardamos la url final + item_local.thumbnail = host[:-1] + scrapedthumbnail #guardamos el thumb item_local.context = "['buscar_trailer']" - item_local.contentType = "movie" #por defecto, son películas + item_local.contentType = "movie" #por defecto, son películas item_local.action = "findvideos" #Analizamos los formatos de la películas @@ -347,7 +357,7 @@ def listado(item): elif item_local.extra == 'series': item_local.contentType = "tvshow" item_local.action = "episodios" - item_local.season_colapse = True #Muestra las series agrupadas por temporadas + item_local.season_colapse = True #Muestra las series agrupadas por temporadas elif 'series' in cat_ppal or item_local.extra == 'episodios': item_local.contentType = "episode" item_local.extra = "episodios" @@ -361,7 +371,7 @@ def listado(item): item_local.contentType = "season" item_local.extra = "season" - if item_local.contentType == "movie": #para las peliculas ponemos el mismo extra + if item_local.contentType == "movie": #para las peliculas ponemos el mismo extra item_local.extra = "peliculas" #Detectamos idiomas @@ -495,13 +505,13 @@ def listado_series(item): #logger.debug(item) #Control de paginación - matches = item.matches #Restauramos la matches de la primera pasada + matches = item.matches #Restauramos la matches de la primera pasada del item.matches - matches_tot = len(matches) #La web no pagina las Series, lo tenemos que controlar - if item.matches_current: #Llevamos los contadores de cuánto hemos pintado y cuánto queda + matches_tot = len(matches) #La web no pagina las Series, lo tenemos que controlar + if item.matches_current: #Llevamos los contadores de cuánto hemos pintado y cuánto queda matches_current = item.matches_current if matches_tot >= matches_current + pag: - item.matches_current = matches_current + pag #Establecemos el bloque a pintar en este pasada + item.matches_current = matches_current + pag #Establecemos el bloque a pintar en este pasada else: item.matches_current = matches_tot @@ -566,8 +576,8 @@ def listado_series(item): #logger.debug(item_local) - #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global - # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo + #if not item.category: #Si este campo no existe es que viene de la primera pasada de una búsqueda global + # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo #Pasamos a TMDB la lista completa Itemlist tmdb.set_infoLabels(itemlist, __modo_grafico__) @@ -607,7 +617,7 @@ def findvideos(item): if not data_torrent and not data_directo: logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: FINDVIDEOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos patron = '
1 and (item.contentType == 'episode' or item.contentType == 'season'): itemlist_alt = sorted(itemlist_alt, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios + tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios itemlist.extend(itemlist_alt) #Ahora tratamos los servidores directo itemlist_alt = [] if matches_directo: - for scrapedurl, scrapedquality, scrapedlang in matches_directo: #leemos los torrents con la diferentes calidades + for scrapedurl, scrapedquality, scrapedlang in matches_directo: #leemos los torrents con la diferentes calidades #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() - item_local.url = scrapedurl #Guardamos la url intermedia + item_local.url = scrapedurl #Guardamos la url intermedia item_local.quality = '' if scrapedquality: @@ -779,11 +789,11 @@ def findvideos(item): if not item_local.quality: item_local.quality = item.quality - elif scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])'): #Salvamos la duración + elif scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])'): #Salvamos la duración item_local.quality += ' [/COLOR][COLOR white]%s' % scrapertools.find_single_match(item.quality, '(\[\d+:\d+ h\])') #Copiamos duración if scrapedlang in IDIOMAS: - item_local.language = ["%s" % IDIOMAS[scrapedlang]] #Salvamos el idioma, si lo hay + item_local.language = ["%s" % IDIOMAS[scrapedlang]] #Salvamos el idioma, si lo hay #Leemos la página con el enlace al Servidor try: @@ -797,7 +807,7 @@ def findvideos(item): if not data or not matches: logger.error("ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) - break #si no hay más datos, algo no funciona, pasamos a Ver Online + continue #si no hay más datos, algo no funciona, salimos #logger.debug(patron) #logger.debug(matches) @@ -862,14 +872,14 @@ def findvideos(item): #Verificamos el si el enlace del servidor está activo mostrar_server = True - if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran + if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran mostrar_server = servertools.is_server_enabled(servidor) - try: #Obtenemos el enlace + try: #Obtenemos el enlace if mostrar_server: - devuelve = servertools.findvideosbyserver(scrapedenlace, servidor) #existe el link ? + devuelve = servertools.findvideosbyserver(scrapedenlace, servidor) #existe el link ? if devuelve: - enlace = devuelve[0][1] #Se guarda el link + enlace = devuelve[0][1] #Se guarda el link if not enlace: continue @@ -877,21 +887,21 @@ def findvideos(item): #Si el link no está activo se ignora if "??" in item_local.alive: #dudoso item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), quality, str(item_local.language)) - elif "no" in item_local.alive.lower(): #No está activo. Lo preparo, pero no lo pinto + elif "no" in item_local.alive.lower(): #No está activo. Lo preparo, pero no lo pinto item_local.title = '[COLOR red][%s][/COLOR] [COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.alive, servidor.capitalize(), quality, str(item_local.language)) logger.debug(item_local.alive + ": ALIVE / " + servidor + " / " + enlace) raise - else: #Sí está activo + else: #Sí está activo item_local.title = '[COLOR yellow][%s][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (servidor.capitalize(), quality, str(item_local.language)) #Ahora pintamos el link Directo item_local.url = enlace item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos - item_local.action = "play" #Visualizar vídeo - item_local.server = servidor #Seridor Directo + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos + item_local.action = "play" #Visualizar vídeo + item_local.server = servidor #Seridor Directo - itemlist_alt.append(item_local.clone(quality=quality)) #Pintar pantalla + itemlist_alt.append(item_local.clone(quality=quality)) #Pintar pantalla except: logger.error('ERROR al procesar enlaces DIRECTOS: ' + servidor + ' / ' + scrapedenlace) @@ -901,7 +911,7 @@ def findvideos(item): #Si son múltiples episodios, ordenamos if len(itemlist_alt) > 1 and (item.contentType == 'episode' or item.contentType == 'season'): itemlist_alt = sorted(itemlist_alt, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios + tmdb.set_infoLabels(itemlist_alt, True) #TMDB de la lista de episodios itemlist.extend(itemlist_alt) return itemlist @@ -913,14 +923,14 @@ def episodios(item): #logger.debug(item) - curr_page = 1 # Página inicial - last_page = 99999 # Última página inicial + curr_page = 1 # Página inicial + last_page = 99999 # Última página inicial if item.curr_page: - curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos - del item.curr_page # ... y lo borramos + curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos + del item.curr_page # ... y lo borramos if item.last_page: - last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos - del item.last_page # ... y lo borramos + last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos + del item.last_page # ... y lo borramos url_item = item.url.replace('1-.fx', '%s-.fx').replace('-1.fx', '-%s.fx') if item.from_title: item.title = item.from_title @@ -928,8 +938,8 @@ def episodios(item): #Limpiamos num. Temporada y Episodio que ha podido quedar por Novedades season_display = 0 if item.contentSeason: - if item.season_colapse: #Si viene del menú de Temporadas... - season_display = item.contentSeason #... salvamos el num de sesión a pintar + if item.season_colapse: #Si viene del menú de Temporadas... + season_display = item.contentSeason #... salvamos el num de sesión a pintar item.from_num_season_colapse = season_display del item.season_colapse item.contentType = "tvshow" @@ -949,14 +959,14 @@ def episodios(item): tmdb.set_infoLabels(item, True) modo_ultima_temp_alt = modo_ultima_temp - if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo + if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo modo_ultima_temp_alt = False max_temp = 1 if item.infoLabels['number_of_seasons']: max_temp = item.infoLabels['number_of_seasons'] y = [] - if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca + if modo_ultima_temp_alt and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca patron = 'season (\d+)' matches = re.compile(patron, re.DOTALL).findall(str(item.library_playcounts)) for x in matches: @@ -967,19 +977,19 @@ def episodios(item): # Descarga la página data = '' - url = url_item % curr_page #Inserto en num de página en la url + url = url_item % curr_page #Inserto en num de página en la url try: data = re.sub(r"\n|\r|\t|\s{2}|()| ", "", httptools.downloadpage(url, timeout=timeout).data) data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") - except: #Algún error de proceso, salimos + except: #Algún error de proceso, salimos pass if not data: logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist + break #Pintamos lo que tenemos - curr_page += 1 #Apunto ya a la página siguiente + curr_page += 1 #Apunto ya a la página siguiente #Usamos el mismo patrón que en listado patron = '
' @@ -996,7 +1006,7 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: 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 + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -1080,10 +1090,10 @@ def episodios(item): else: item_local.title = '%sx%s -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2)) - if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca + if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: - curr_page = 999999 #Sale del bucle de leer páginas - break #Sale del bucle actual del WHILE de episodios por página + curr_page = 999999 #Sale del bucle de leer páginas + break #Sale del bucle actual del WHILE de episodios por página if season_display > 0: if item_local.contentSeason > season_display: @@ -1098,10 +1108,10 @@ def episodios(item): if len(itemlist) > 1: itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos - if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas + if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas item, itemlist = generictools.post_tmdb_seasons(item, itemlist) - if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo + if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo # Pasada por TMDB y clasificación de lista por temporada y episodio tmdb.set_infoLabels(itemlist, True) diff --git a/plugin.video.alfa/channels/grantorrent.json b/plugin.video.alfa/channels/grantorrent.json index d82d7313..e3f8591e 100644 --- a/plugin.video.alfa/channels/grantorrent.json +++ b/plugin.video.alfa/channels/grantorrent.json @@ -3,14 +3,15 @@ "name": "GranTorrent", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "grantorrent.jpg", "banner": "grantorrent.png", "fanart": "grantorrent.png", "categories": [ "torrent", "movie", - "tvshow" + "tvshow", + "vos" ], "settings": [ { diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py index e79df7bf..1e25ceef 100644 --- a/plugin.video.alfa/channels/grantorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -72,39 +72,39 @@ def submenu(item): if not data: logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL: " + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #Algo no funciona, pintamos lo que tenemos + return itemlist #Algo no funciona, pintamos lo que tenemos if item.extra == "peliculas": patron = '
') #Seleccionamos la zona de links patron = '\/icono_.*?png" title="(?P.*?)?" [^>]+><\/td>(?P.*?)?.*?(?P.*?)?<\/td>= item.infoLabels["number_of_seasons"]: #Si tenemos en .nfo igaual o más temporadas, investigar cnt_s = 0 - for s in item.library_playcounts: #Ver cuántas Temporadas hay en Videoteca + for s in item.library_playcounts: #Ver cuántas Temporadas hay en Videoteca if "season" in s: cnt_s += 1 - if cnt_s > 1: #hay más de 1 temporada en Videoteca, es Serie? - if temp_actual_num > 1: #Temp. actual > 1, parece Temporada + if cnt_s > 1: #hay más de 1 temporada en Videoteca, es Serie? + if temp_actual_num > 1: #Temp. actual > 1, parece Temporada s = 1 while s <= item.infoLabels["number_of_seasons"]: #Buscamos la primera Temporada de Videoteca if item.library_playcounts.has_key('season %d' % s): #Buscamos si la Temporada 1 existe @@ -564,19 +578,19 @@ def episodios(item): item.contentType = "tvshow" #No es Temporada 1, pero es más baja que la actual. Es Serie break s += 1 - else: #Sí, es Serie + else: #Sí, es Serie item.contentType = "tvshow" - else: #Solo hay una temporada en la Videoteca - if temp_actual_num > 1: #es Temporada la actual? + else: #Solo hay una temporada en la Videoteca + if temp_actual_num > 1: #es Temporada la actual? if item.contentSeason: - item.contentType = "season" #Si está informado el num de Temp. se creó como Temporada + item.contentType = "season" #Si está informado el num de Temp. se creó como Temporada else: - item.contentType = "tvshow" #Si no, es Serie que no tiene Temp. 1 - else: #Si es Temp. 1, se procesa según el valor de configuración - if modo_serie_temp == 0: #Es Temporada + item.contentType = "tvshow" #Si no, es Serie que no tiene Temp. 1 + else: #Si es Temp. 1, se procesa según el valor de configuración + if modo_serie_temp == 0: #Es Temporada item.contentType = "season" - else: #Es Serie + else: #Es Serie item.contentType = "tvshow" else: item.contentType = "list" @@ -592,21 +606,21 @@ def episodios(item): #Controla que no haya un bucle en la cadena de links entre temporadas if scrapertools.find_single_match(temp_actual, patron_actual_num) in temp_lista: temp_bucle += 1 - if temp_bucle > 5: #Si ha pasado por aquí más de 5 veces es que algo anda mal + if temp_bucle > 5: #Si ha pasado por aquí más de 5 veces es que algo anda mal logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) data = '' - return itemlist #Algo no funciona con los links, pintamos lo que tenemos + break #Algo no funciona con los links, pintamos lo que tenemos if temp_advance == "back": #Se salta una temporada hacia atrás logger.error("ERROR 05: EPISODIOS: Temporada duplicada. Link BACK erroneo: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / Bucle: " + str(temp_bucle) + " / DATA: " + data) temp_actual = scrapertools.find_single_match(data, patron_previous) #url de temporada anterior data = '' - continue #volvemos a leer página con la url de la anterior + continue #volvemos a leer página con la url de la anterior if temp_advance == "forw": #Se salta una temporada hacia adelante logger.error("ERROR 05: EPISODIOS: Temporada duplicada. Link FORW erroneo: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / Bucle: " + str(temp_bucle) + " / DATA: " + data) temp_actual = scrapertools.find_single_match(data, patron_next) #url de temporada siguiente data = '' - continue #volvemos a leer página con la url de la siguiente + continue #volvemos a leer página con la url de la siguiente #Comprobamos si se ha saltado una Temporada if temp_advance == "back": #Avanza marcha atrás? @@ -625,9 +639,9 @@ def episodios(item): logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) data = '' itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) - return itemlist #Algo no funciona con los links, pintamos lo que tenemos + break #Algo no funciona con los links, pintamos lo que tenemos data = '' - continue #volvemos a leer página con la url de la siguiente + continue #volvemos a leer página con la url de la siguiente #Comprobamos si se ha saltado una Temporada if temp_advance == "forw": #Avanza marcha adelante? @@ -646,9 +660,9 @@ def episodios(item): logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) data = '' itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) - return itemlist #Algo no funciona con los links, pintamos lo que tenemos + break #Algo no funciona con los links, pintamos lo que tenemos data = '' - continue #volvemos a leer página con la url de la siguiente + continue #volvemos a leer página con la url de la siguiente temp_actual_num = scrapertools.find_single_match(temp_actual, patron_actual_num) #num de la temporada actual temp_actual_num = int(temp_actual_num) @@ -660,7 +674,7 @@ def episodios(item): except: #Error al leer o procesar la página actual? Salimos logger.error("ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + break #si no hay más datos, algo no funciona, pintamos lo que tenemos if item.contentType == "season": temp_advance = '' #Es la única temporada @@ -700,7 +714,7 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: 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 + break #si no hay más datos, algo no funciona, pintamos lo que tenemos #logger.debug("PATRON: " + patron) #logger.debug(matches) @@ -752,7 +766,7 @@ def episodios(item): item_local.contentSeason = temp_actual_num item_local.contentSeason = int(item_local.contentSeason) item_local.contentEpisodeNumber = 1 - else: #si es un episodio lo guardamos + else: #si es un episodio lo guardamos if scrapertools.find_single_match(temp_epi, r'(\d+)&#.*?;(\d+)'): item_local.contentSeason, item_local.contentEpisodeNumber = scrapertools.find_single_match(temp_epi, r'(\d+)&#.*?;(\d+)') if not item_local.contentSeason: @@ -766,32 +780,32 @@ def episodios(item): item_local.contentEpisodeNumber = int(item_local.contentEpisodeNumber) except: logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + temp_epi) - continue #si da un error pasamos del episodio + continue #si da un error pasamos del episodio if item_local.contentSeason != temp_actual_num: #A veces es diferente el num de Temp. de la URL y de temp_actual_num = item_local.contentSeason #los episodios. Anatomia de Grey Temp. 14 - if "-" in temp_epi: #episodios múltiples + if "-" in temp_epi: #episodios múltiples episode2 = scrapertools.find_single_match(temp_epi, r'-(\d+)') - item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango de episodios + item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango de episodios elif "temporada" in temp_epi.lower() or "completa" in temp_epi.lower(): #Temporada completa episode2 = 99 - item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango ficticio de episodios - elif item_local.contentEpisodeNumber == 0: #episodio extraño + item_local.title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(episode2).zfill(2)) #Creamos un título con el rango ficticio de episodios + elif item_local.contentEpisodeNumber == 0: #episodio extraño item_local.title = '%sx%s - %s' % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), temp_epi) - else: #episodio normal + else: #episodio normal item_local.title = '%sx%s -' % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2)) - if len(itemlist) > 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and item_local.title == itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... + if len(itemlist) > 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and item_local.title == itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... if itemlist[-1].quality: - itemlist[-1].quality += ", " + quality #... pero acumulamos las calidades + itemlist[-1].quality += ", " + quality #... pero acumulamos las calidades else: itemlist[-1].quality = quality - continue #ignoramos el episodio duplicado + continue #ignoramos el episodio duplicado else: item_local.quality = quality - itemlist.append(item_local.clone()) #guardamos el episodio + itemlist.append(item_local.clone()) #guardamos el episodio #logger.debug("EPISODIOS: " + temp_actual + " (" + str (item_local.contentSeason) + "x" + str (item_local.contentEpisodeNumber) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista Temps: " + str(temp_lista)) #logger.debug(item_local) @@ -823,7 +837,7 @@ def episodios(item): def actualizar_titulos(item): logger.info() - item = generictools.update_title(item) #Llamamos al método que actualiza el título con tmdb.find_and_set_infoLabels + item = generictools.update_title(item) #Llamamos al método que actualiza el título con tmdb.find_and_set_infoLabels #Volvemos a la siguiente acción en el canal return item @@ -835,7 +849,7 @@ def search(item, texto): itemlist = [] item.url = "%s?s=%s" % (item.url, texto) - item.media = "search" #Marcar para "Listado": igual comportamiento que "Categorías" + item.media = "search" #Marcar para "Listado": igual comportamiento que "Categorías" try: if "series/" in item.url: diff --git a/plugin.video.alfa/channels/mejortorrent1.json b/plugin.video.alfa/channels/mejortorrent1.json index dd27bb1a..a06a4b5f 100644 --- a/plugin.video.alfa/channels/mejortorrent1.json +++ b/plugin.video.alfa/channels/mejortorrent1.json @@ -3,14 +3,15 @@ "name": "Mejor Torrent 1", "active": true, "adult": false, - "language": ["*"], + "language": ["cast", "lat"], "thumbnail": "mejortorrent.png", "banner": "mejortorrent.png", "categories": [ "torrent", "movie", "tvshow", - "documentary" + "documentary", + "vos" ], "settings": [ { diff --git a/plugin.video.alfa/channels/mejortorrent1.py b/plugin.video.alfa/channels/mejortorrent1.py index f2cf315f..cc9966c0 100644 --- a/plugin.video.alfa/channels/mejortorrent1.py +++ b/plugin.video.alfa/channels/mejortorrent1.py @@ -117,13 +117,12 @@ def alfabeto(item): def listado(item): logger.info() itemlist = [] - url_next_page ='' # Control de paginación - cnt_tot = 30 # Poner el num. máximo de items por página + url_next_page ='' # Control de paginación + cnt_tot = 30 # Poner el num. máximo de items por página - if item.category: - del item.category if item.totalItems: del item.totalItems + item.category = item.channel.capitalize() try: data = '' @@ -134,27 +133,27 @@ def listado(item): logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - if not data: #Si la web está caída salimos sin dar error + if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos # En este canal las url's y los títulos tienen diferente formato dependiendo del contenido - if (item.extra == "peliculas" or item.extra == "varios") and item.tipo: #Desde Lista Alfabética + if (item.extra == "peliculas" or item.extra == "varios") and item.tipo: #Desde Lista Alfabética patron = '([^<]+)?<\/a>' patron_enlace = '\/\/.*?\/(.*?)\/$' patron_title = '([^<]+)<\/a>(\s*([^>]+)<\/b>)?' item.action = "findvideos" item.contentType = "movie" - pag = False #No hay paginación + pag = False #No hay paginación elif (item.extra == "peliculas" or item.extra == "varios") and not item.tipo: #Desde Menú principal patron = '?' patron_enlace = '\/\/.*?\/(.*?)\/$' patron_title = '([^<]+)<\/a>(\s*([^>]+)<\/b>)?' item.action = "findvideos" item.contentType = "movie" - pag = True #Sí hay paginación - cnt_tot = 20 # Poner el num. máximo de items por página. Parece que hay 18 + pag = True #Sí hay paginación + cnt_tot = 20 # Poner el num. máximo de items por página. Parece que hay 18 item.next_page = 'b' elif item.extra == "series" and item.tipo: patron = '([^<]+)?<\/a>' @@ -165,7 +164,7 @@ def listado(item): item.action = "episodios" item.contentType = "season" pag = False - cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado + cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado elif item.extra == "series" and not item.tipo: patron = '?' patron_enlace = '\/\/.*?\/(.*?)-[temporada]?\d+[-|x]' @@ -175,7 +174,7 @@ def listado(item): item.action = "episodios" item.contentType = "season" pag = True - cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado + cnt_tot = 10 # Se reduce el numero de items por página porque es un proceso pesado elif item.extra == "documentales" and item.tipo: patron = '([^<]+)?<\/a>' patron_enlace = '\/\/.*?\/(.*?)-[temporada]?\d+[-|x]' @@ -219,13 +218,13 @@ def listado(item): logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Capturamos el num. de la última página para informala a pié de página. Opción para páginas sin paginación if pag == False: item.last_page = (len(matches) / cnt_tot) + 1 - if not item.last_page and pag: #Capturamos el num. de la última página para informala a pié de página + if not item.last_page and pag: #Capturamos el num. de la última página para informala a pié de página item.last_page = -1 #patron_next_page = " Siguiente >> <\/a>" if "/documentales" in item.url: @@ -309,7 +308,7 @@ def listado(item): item_local.thumbnail = scrapedthumbnail if "http" not in item_local.thumbnail: item_local.thumbnail = '' - item_local.infoLabels['year'] = '-' # Al no saber el año, le ponemos "-" y TmDB lo calcula automáticamente + item_local.infoLabels['year'] = '-' # Al no saber el año, le ponemos "-" y TmDB lo calcula automáticamente # Para que el menú contextual muestre conrrectamente las opciones de añadir a Videoteca if item_local.extra == "series": @@ -327,15 +326,18 @@ def listado(item): data_epi = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item_local.url).data) url = scrapertools.find_single_match(data_epi, '.*

.*?)<\/form>"): + url = item_local.url #Salvamos la url original + if not url: #No encuentro la Temporada. Lo dejo como capítulo suelto item_local.action = "findvideos" item_local.contentEpisodeNumber = episodio if not item_local.contentEpisodeNumber: item_local.contentEpisodeNumber = 1 logger.debug(item_local) logger.debug(data_epi) - else: #Busco la temporada. Salvo url de episodio por si acaso + else: #Busco la temporada. Salvo url de episodio por si acaso #item_local.url_ori = item_local.url item_local.url = url item_local.contentType = "season" @@ -386,7 +388,7 @@ def listado(item): # Limpiamos títulos, Sacamos datos de calidad, audio y lenguaje scrapedtitle = re.sub('\r\n', '', scrapedtitle_alt).decode('utf8').encode('utf8').strip() title = scrapedtitle - title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ") + title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ").replace("×", "x") title_subs = [] @@ -400,10 +402,7 @@ def listado(item): title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "") title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "") - if "3d" in title.lower(): #Reservamos info para después de TMDB - item_local.quality += " 3D" - title = title.replace(" [3d]", "").replace(" 3d", "").replace(" [3D]", "").replace(" 3D", "") - if "audio" in title.lower(): #Reservamos info de audio para después de TMDB + if "audio" in title.lower(): #Reservamos info de audio para después de TMDB title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')] title = re.sub(r'\[[a|A]udio.*?\]', '', title) if "[dual" in title.lower(): @@ -427,7 +426,7 @@ def listado(item): # scrapedinfo tiene la calidad, pero solo en llamadas desde peliculas sin alfabeto if item_local.extra == "series" or item_local.extra == "documentales": if item_local.quality: - title = re.sub(r'[\[|\(]\d+.*?[\)|\]]', '', title) # Quitar la calidad del título + title = re.sub(r'[\[|\(]\d+.*?[\)|\]]', '', title) # Quitar la calidad del título info = "" if not item_local.contentSerieName: item_local.contentSerieName = title.strip() @@ -435,12 +434,20 @@ def listado(item): item_local.contentSerieName = "SIN TITULO" if item_local.infoLabels['title']: del item_local.infoLabels['title'] + if item_local.contentType == "episode": + title = re.sub(r'\d+x\d+(?: al \d+)?', '', title) if info != "" and not item_local.quality: item_local.quality = info + if not scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') in item_local.quality: + if item_local.quality: + item_local.quality += ' ' + item_local.quality = scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') + if scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') and not scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') in item_local.quality: + item_local.quality += ' %s' % scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') + title = re.sub(r'[\[|\(].*?[\)|\]]\s?[\[|\(].*?[\)|\]]', '', title) + title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower(): - if not item_local.quality: - item_local.quality = scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if not item_local.quality: if "fullbluray" in title.lower(): @@ -450,12 +457,13 @@ def listado(item): item_local.quality = "4K" title = title.replace("4k-hdr", "").replace("4K-HDR", "").replace("hdr", "").replace("HDR", "").replace("4k", "").replace("4K", "") title = title.replace("(", "").replace(")", "").replace("[", "").replace("]", "").strip() - if item_local.extra == "peliculas": + if item_local.contentType == "movie": item_local.title = title item_local.contentTitle = title elif item_local.contentType != "episode": item_local.title = title item_local.title = item_local.contentSerieName + title = item_local.contentSerieName item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título if "saga" in item_local.contentTitle.lower() or "saga" in item_local.contentSerieName.lower(): @@ -505,14 +513,14 @@ def listado(item): def listado_busqueda(item): logger.info() itemlist = [] - url_next_page ='' # Controlde paginación - cnt_tot = 39 # Poner el num. máximo de items por página. Dejamos que la web lo controle - cnt_title = 0 # Contador de líneas insertadas en Itemlist - cnt_pag = 0 # Contador de líneas leídas de Matches - cnt_next = 0 # Contador de páginas leidas antes de pintar la pantalla - total_pag = 10 # Líneas por página de la web - curr_page_num = 1 # Página actual - category = "" # Guarda la categoria que viene desde una busqueda global + url_next_page ='' # Controlde paginación + cnt_tot = 39 # Poner el num. máximo de items por página. Dejamos que la web lo controle + cnt_title = 0 # Contador de líneas insertadas en Itemlist + cnt_pag = 0 # Contador de líneas leídas de Matches + cnt_next = 0 # Contador de páginas leidas antes de pintar la pantalla + total_pag = 10 # Líneas por página de la web + curr_page_num = 1 # Página actual + category = "" # Guarda la categoria que viene desde una busqueda global matches = [] if item.url_next_page: @@ -523,7 +531,7 @@ def listado_busqueda(item): #Máximo num. de líneas permitidas por TMDB. Máx de 5 páginas por Itemlist para no degradar el rendimiento while cnt_title <= cnt_tot and cnt_next < 5: - status = False # Calidad de los datos leídos + status = False # Calidad de los datos leídos data = '' try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url_next_page, post=item.post).data) @@ -532,10 +540,20 @@ def listado_busqueda(item): except: logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos if not data: #Si la web está caída salimos sin dar error logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos cnt_next += 1 @@ -561,7 +579,11 @@ def listado_busqueda(item): logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web. Reportar el error con el log')) - item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Llamamos al método para el pintado del error + if len(itemlist) > 1: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Capturamos el num. de la última página para informala a pié de página @@ -591,7 +613,7 @@ def listado_busqueda(item): item_local = item.clone() if item_local.category: category = item.category - del item_local.category + item_local.category = item_local.channel.capitalize() item_local.tipo = True del item_local.tipo if item_local.totalItems: @@ -624,9 +646,6 @@ def listado_busqueda(item): title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "") title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "") - if "3d" in title or "3D" in title: #Reservamos info para después de TMDB - item_local.quality += " 3D" - title = title.replace(" [3d]", "").replace(" 3d", "").replace(" [3D]", "").replace(" 3D", "") if "audio" in title.lower(): #Reservamos info de audio para después de TMDB title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')] title = re.sub(r'\[[a|A]udio.*?\]', '', title) @@ -645,7 +664,8 @@ def listado_busqueda(item): title = scrapertools.remove_htmltags(title) # Ahora preparamos el título y la calidad tanto para series como para documentales y películas - if item.extra == "novedades" and ("Series" in scrapedtype or "Documentales" in scrapedtype): + #if item.extra == "novedades" and ("Series" in scrapedtype or "Documentales" in scrapedtype): + if item.extra == "novedades": item_local.quality = scrapertools.find_single_match(scrapedtitle, '.*?\[(.*?)\]') else: item_local.quality = scrapertools.remove_htmltags(scrapedquality).decode('utf8').encode('utf8') @@ -660,8 +680,8 @@ def listado_busqueda(item): item_local.extra = "documentales" item_local.contentType = "season" - title = re.sub(r'\[\d+.*?\]', '', title) # Quitar la calidad del título - item_local.contentSerieName = scrapertools.find_single_match(title, '(.*?) Temporada \d+\s?').strip() + title = re.sub(r'\[\d+.*?\]', '', title) # Quitar la calidad del título + item_local.contentSerieName = scrapertools.find_single_match(title, '(.*?) Temporada\s?(?:\d+)?\s?').strip() if not item_local.contentSerieName: item_local.contentSerieName = title.strip() if item_local.infoLabels['title']: @@ -673,12 +693,17 @@ def listado_busqueda(item): item_local.contentSeason = scrapertools.find_single_match(scrapedurl, 'temporada-?(?:\d+p-)?(\d{1,2})[-|\/]') if not item_local.contentSeason: item_local.contentSeason = 1 + title = title.replace('Temporada', '').replace('temporada', '') + if not scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') in item_local.quality: + if item_local.quality: + item_local.quality += ' ' + item_local.quality += scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') + if scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') and not scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') in item_local.quality: + item_local.quality += ' %s' % scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') + title = re.sub(r'[\[|\(].*?[\)|\]]\s?[\[|\(].*?[\)|\]]', '', title) + title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower(): - if not item_local.quality: - item_local.quality = scrapertools.find_single_match(title, r'\(.*?\)?\(.*?\)') - if not item_local.quality: - item_local.quality = scrapertools.find_single_match(title, r'[\[|\(](.*?)[\)|\]]') title = re.sub(r'\(.*?\)?\(.*?\)', '', title) title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) if not item_local.quality: @@ -743,10 +768,12 @@ def listado_busqueda(item): def findvideos(item): logger.info() itemlist = [] + + #logger.debug(item) data = '' torrent_data = '' - headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Referer': item.url} #Necesario para el Post del .Torrent + headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Referer': item.url} #Necesario para el Post del .Torrent #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) @@ -781,7 +808,7 @@ def findvideos(item): #logger.debug(matches) #logger.debug(data) - for scrapedurl, name1, value1, value2, name2 in matches: + for scrapedurl, name1, value1, value2, name2 in matches: #Hacemos el FOR aunque solo habrá un item #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() url = scrapedurl @@ -790,19 +817,18 @@ def findvideos(item): post = '%s=%s&%s=%s' % (name1, value1, name2, value2) try: torrent_data = httptools.downloadpage(url, post=post, headers=headers, follow_redirects=False) - except: #error + except: #error pass else: - #Generamos una copia de Item para trabajar sobre ella + #Viene de SERIES y DOCUMENTALES. Generamos una copia de Item para trabajar sobre ella item_local = item.clone() try: #Localiza el .torrent en el siguiente link con Post. Viene de Documentales y Varios url = item.url_post torrent_data = httptools.downloadpage(url, post=item.post, headers=headers, follow_redirects=False) except: pass - - #logger.debug(torrent_data.headers) + if not torrent_data: item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente @@ -813,7 +839,8 @@ def findvideos(item): itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - item_local.url = torrent_data.headers['location'] #Capturamos la url del .torrent desde el Header + #Capturamos la url del .torrent desde el Header + item_local.url = torrent_data.headers['location'] if 'location' in torrent_data.headers else item.url_post item_local.url = item_local.url.replace(" ", "%20") #Quitamos espacios # Poner la calidad, si es necesario @@ -838,14 +865,14 @@ def findvideos(item): #Ahora pintamos el link del Torrent, si lo hay if item_local.url: # Hay 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 de 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 de Torrent item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos - item_local.alive = "??" #Calidad del link sin verificar - item_local.action = "play" #Visualizar vídeo - item_local.server = "torrent" #Seridor Torrent + item_local.alive = "??" #Calidad del link sin verificar + item_local.action = "play" #Visualizar vídeo + item_local.server = "torrent" #Seridor Torrent - itemlist.append(item_local.clone()) #Pintar pantalla + itemlist.append(item_local.clone()) #Pintar pantalla #logger.debug("title=[" + item.title + "], torrent=[ " + item_local.url + " ], url=[ " + url + " ], post=[" + item.post + "], thumbnail=[ " + item.thumbnail + " ]" + " size: " + size) #logger.debug(item_local) @@ -862,28 +889,38 @@ def episodios(item): tmdb.set_infoLabels(item, True) # Carga la página - data = '' + data_ini = '' try: - data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) - data = data.replace('"', "'") - except: #Algún error de proceso, salimos + data_ini = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) + data_ini = data_ini.replace('"', "'") + except: #Algún error de proceso, salimos pass - if not data: + if not data_ini: logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) return itemlist # Selecciona en tramo que nos interesa - data = scrapertools.find_single_match(data, "(
.*?)<\/form>") + data = scrapertools.find_single_match(data_ini, "(.*?)<\/form>") # Prepara el patrón de búsqueda - if item.extra == "documentales": - patron = "" - url, value2, name2 = scrapertools.find_single_match(data, patron) - patron = "" - else: - patron = "[^<]+<\/a><\/td>]+>]+>([^<]+)?<\/div><\/td>" + patron = "Documentales' else: - data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa + data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa if not data: 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 + 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) @@ -173,7 +173,7 @@ def submenu(item): if not matches: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.strip() @@ -208,7 +208,7 @@ def submenu_novedades(item): 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 + 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) @@ -232,7 +232,7 @@ def submenu_novedades(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -307,7 +307,7 @@ def alfabeto(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: ALFABETO: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif item.channel_alt: #Si ha habido fail-over, lo comento itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso')) itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible')) @@ -323,7 +323,7 @@ def alfabeto(item): if not matches: logger.error("ERROR 02: ALFABETO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: ALFABETO: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.upper() @@ -336,9 +336,9 @@ def alfabeto(item): def listado(item): logger.info() itemlist = [] - clase = "pelilist" # etiqueta para localizar zona de listado de contenidos - url_next_page ='' # Control de paginación - cnt_tot = 30 # Poner el num. máximo de items por página + clase = "pelilist" # etiqueta para localizar zona de listado de contenidos + url_next_page ='' # Control de paginación + cnt_tot = 30 # Poner el num. máximo de items por página if item.totalItems: del item.totalItems @@ -363,7 +363,7 @@ def listado(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Establecemos los valores básicos en función del tipo de contenido if item.extra == "peliculas": @@ -387,7 +387,7 @@ def listado(item): if not fichas and not '

    ( 0 ) Resultados encontrados ' in data: #error logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO: 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 + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos elif '

    ( 0 ) Resultados encontrados ' in data: #no hay vídeos return itemlist else: @@ -395,16 +395,16 @@ def listado(item): page_extra = clase #Scrapea los datos de cada vídeo. Título alternativo se mantiene, aunque no se usa de momento - patron = '( 0 ) Resultados encontrados ' in data): item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada if item.intervencion: #Sí ha sido clausurada judicialmente @@ -709,34 +713,40 @@ def listado_busqueda(item): if not data: #Si no ha logrado encontrar nada, salimos itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo')) itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - elif item.channel_alt: #Si ha habido fail-over, lo comento + if len(itemlist) > 2: + #Pasamos a TMDB la lista completa Itemlist + tmdb.set_infoLabels(itemlist, __modo_grafico__) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif item.channel_alt: #Si ha habido fail-over, lo comento host = host.replace(item.channel_alt, item.channel) #Obtiene la dirección de la próxima página, si la hay try: - post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás - - if item.extra == "novedades": - get, post, total_pag = scrapertools.find_single_match(data, '