diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index 85cb8395..4ace762a 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -20,16 +20,14 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] » grantorrent » descargas2020 - » mejortorrent » mispelisyseries » torrentlocura » torrentrapid » tumejortorrent » tvsinpagar - » hdfull » clipwatching - » filebebo » anitoons - » netutv » seriesverde - » peliculasdk » cuevana2 - » cuevana2español + » mispelisyseries » vidoza + » streamplay » powvideo + » streamcloud ¤ arreglos internos - ¤ Agradecimientos a @mrgaturus por colaborar con ésta versión. + + ¤ Agradecimientos al equipo iSOD, @alaquepasa por colaborar con é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/descargas2020.py b/plugin.video.alfa/channels/descargas2020.py index 19d1e88b..23d388b9 100644 --- a/plugin.video.alfa/channels/descargas2020.py +++ b/plugin.video.alfa/channels/descargas2020.py @@ -66,7 +66,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -156,7 +156,7 @@ def listado(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + 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 @@ -302,6 +302,7 @@ def listado(item): #Extraemos info adicional del título y la guardamos para después de TMDB if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -508,12 +509,12 @@ def listado_busqueda(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data) except: - logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 cnt_next += 1 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 " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 @@ -592,6 +593,7 @@ def listado_busqueda(item): #logger.debug("PATRON: " + pattern) #logger.debug(matches) + #logger.debug(title_lista_alt) #logger.debug(data) cnt_title = 0 @@ -691,6 +693,7 @@ def listado_busqueda(item): #Extraemos info adicional del título y la guardamos para después de TMDB if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie": #Eliminamos Temporada de Series, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -936,8 +939,6 @@ def findvideos(item): logger.info() itemlist = [] - logger.debug(item) - # Cualquiera de las tres opciones son válidas # item.url = item.url.replace(".com/",".com/ver-online/") # item.url = item.url.replace(".com/",".com/descarga-directa/") @@ -1071,7 +1072,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -1349,7 +1350,7 @@ def episodios(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: #Algún error de proceso, salimos - logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea") + 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 @@ -1375,6 +1376,11 @@ def episodios(item): else: list_pages = [item.url] + season = max_temp + if item.library_playcounts: #Comprobamos si realmente sabemos el num. máximo de temporadas + num_temporadas_flag = True + else: + num_temporadas_flag = False for page in list_pages: #Recorre la lista de páginas if not list_pages: break @@ -1388,7 +1394,7 @@ def episodios(item): if not data: raise except: - logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages + " / DATA: " + data)) + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / 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 @@ -1401,13 +1407,11 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / 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 - data = '' #logger.debug("patron: " + pattern) #logger.debug(matches) #Empezamos a generar cada episodio - season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1465,6 +1469,23 @@ def episodios(item): if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" + try: + match['season'] = int(match['season']) + match['episode'] = int(match['episode']) + except: + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + " / TEMPORADA/EPISODIO: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + + if num_temporadas_flag and match['season'] != season and match['season'] > max_temp + 1: + #Si el num de temporada está fuera de control, se trata pone en num. de temporada actual + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + match['season'] = season + item_local.contentSeason = season + else: + item_local.contentSeason = match['season'] + season = match['season'] + num_temporadas_flag = True + if season > max_temp: + max_temp = season if match['quality'] and not item_local.quality and estado == True: item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie @@ -1481,7 +1502,6 @@ def episodios(item): item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) item_local.contentEpisodeNumber = match['episode'] - item_local.contentSeason = match['season'] if modo_ultima_temp and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: @@ -1512,16 +1532,21 @@ def episodios(item): del item_local.update_next itemlist.append(item_local.clone()) + + data = '' + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos # Pasada por TMDB y clasificación de lista por temporada y episodio - tmdb.set_infoLabels(itemlist, seekTmdb = True) - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + tmdb.set_infoLabels(itemlist, True) # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -1535,6 +1560,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -1569,13 +1607,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) - - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + #logger.debug(item_local) + + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py index bde52446..6ecb1fab 100644 --- a/plugin.video.alfa/channels/grantorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -65,7 +65,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 @@ -127,12 +127,12 @@ def listado(item): data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.post).data) video_section = scrapertools.find_single_match(data, '
(.*?
)') except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + video_section) + logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + video_section) 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 cnt_next += 1 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 " + " / DATA: " + video_section) + logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + video_section) 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 @@ -421,7 +421,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "utf-8", errors="replace").encode("utf-8") @@ -824,7 +824,7 @@ def episodios(item): item_local.contentEpisodeNumber = 0 item_local.contentEpisodeNumber = int(item_local.contentEpisodeNumber) except: - logger.error("ERROR 07: EPISODIOS: Error en número de Episodio: " + temp_epi) + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + temp_epi) 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 @@ -872,8 +872,10 @@ def episodios(item): # Pasada para maquillaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -887,6 +889,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -925,14 +940,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) #logger.debug(item_local) - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/mispelisyseries.py b/plugin.video.alfa/channels/mispelisyseries.py index d886efe9..36f632c8 100644 --- a/plugin.video.alfa/channels/mispelisyseries.py +++ b/plugin.video.alfa/channels/mispelisyseries.py @@ -66,7 +66,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -156,7 +156,7 @@ def listado(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + 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 @@ -302,6 +302,7 @@ def listado(item): #Extraemos info adicional del título y la guardamos para después de TMDB if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -508,12 +509,12 @@ def listado_busqueda(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data) except: - logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 cnt_next += 1 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 " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 @@ -592,6 +593,7 @@ def listado_busqueda(item): #logger.debug("PATRON: " + pattern) #logger.debug(matches) + #logger.debug(title_lista_alt) #logger.debug(data) cnt_title = 0 @@ -691,6 +693,7 @@ def listado_busqueda(item): #Extraemos info adicional del título y la guardamos para después de TMDB if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie": #Eliminamos Temporada de Series, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -936,8 +939,6 @@ def findvideos(item): logger.info() itemlist = [] - logger.debug(item) - # Cualquiera de las tres opciones son válidas # item.url = item.url.replace(".com/",".com/ver-online/") # item.url = item.url.replace(".com/",".com/descarga-directa/") @@ -1071,7 +1072,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -1349,7 +1350,7 @@ def episodios(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: #Algún error de proceso, salimos - logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea") + 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 @@ -1375,6 +1376,11 @@ def episodios(item): else: list_pages = [item.url] + season = max_temp + if item.library_playcounts: #Comprobamos si realmente sabemos el num. máximo de temporadas + num_temporadas_flag = True + else: + num_temporadas_flag = False for page in list_pages: #Recorre la lista de páginas if not list_pages: break @@ -1388,7 +1394,7 @@ def episodios(item): if not data: raise except: - logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages + " / DATA: " + data)) + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / 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 @@ -1401,13 +1407,11 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / 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 - data = '' #logger.debug("patron: " + pattern) #logger.debug(matches) #Empezamos a generar cada episodio - season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1465,6 +1469,23 @@ def episodios(item): if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" + try: + match['season'] = int(match['season']) + match['episode'] = int(match['episode']) + except: + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + " / TEMPORADA/EPISODIO: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + + if num_temporadas_flag and match['season'] != season and match['season'] > max_temp + 1: + #Si el num de temporada está fuera de control, se trata pone en num. de temporada actual + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + match['season'] = season + item_local.contentSeason = season + else: + item_local.contentSeason = match['season'] + season = match['season'] + num_temporadas_flag = True + if season > max_temp: + max_temp = season if match['quality'] and not item_local.quality and estado == True: item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie @@ -1481,7 +1502,6 @@ def episodios(item): item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) item_local.contentEpisodeNumber = match['episode'] - item_local.contentSeason = match['season'] if modo_ultima_temp and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: @@ -1512,16 +1532,21 @@ def episodios(item): del item_local.update_next itemlist.append(item_local.clone()) + + data = '' + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos # Pasada por TMDB y clasificación de lista por temporada y episodio - tmdb.set_infoLabels(itemlist, seekTmdb = True) - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + tmdb.set_infoLabels(itemlist, True) # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -1535,6 +1560,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -1569,13 +1607,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) - - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + #logger.debug(item_local) + + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/search.py b/plugin.video.alfa/channels/search.py index 36decede..b195912a 100644 --- a/plugin.video.alfa/channels/search.py +++ b/plugin.video.alfa/channels/search.py @@ -100,6 +100,9 @@ def sub_menu(item): itemlist.append(Item(channel=item.channel, action="opciones", title="Opciones", thumbnail=get_thumb("search.png"))) + itemlist.append(Item(channel="tvmoviedb", action="mainlist", title="Busquèda alternativa", + thumbnail=get_thumb("search.png"))) + saved_searches_list = get_saved_searches() context2 = context[:] context2.append({"title": "Borrar búsquedas guardadas", diff --git a/plugin.video.alfa/channels/torrentlocura.py b/plugin.video.alfa/channels/torrentlocura.py index 94e1c998..df56aece 100755 --- a/plugin.video.alfa/channels/torrentlocura.py +++ b/plugin.video.alfa/channels/torrentlocura.py @@ -66,7 +66,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -156,7 +156,7 @@ def listado(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + 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 @@ -302,6 +302,7 @@ def listado(item): #Extraemos info adicional del título y la guardamos para después de TMDB if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -508,12 +509,12 @@ def listado_busqueda(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data) except: - logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 cnt_next += 1 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 " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 @@ -592,6 +593,7 @@ def listado_busqueda(item): #logger.debug("PATRON: " + pattern) #logger.debug(matches) + #logger.debug(title_lista_alt) #logger.debug(data) cnt_title = 0 @@ -691,6 +693,7 @@ def listado_busqueda(item): #Extraemos info adicional del título y la guardamos para después de TMDB if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie": #Eliminamos Temporada de Series, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -936,8 +939,6 @@ def findvideos(item): logger.info() itemlist = [] - logger.debug(item) - # Cualquiera de las tres opciones son válidas # item.url = item.url.replace(".com/",".com/ver-online/") # item.url = item.url.replace(".com/",".com/descarga-directa/") @@ -1071,7 +1072,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -1349,7 +1350,7 @@ def episodios(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: #Algún error de proceso, salimos - logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea") + 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 @@ -1375,6 +1376,11 @@ def episodios(item): else: list_pages = [item.url] + season = max_temp + if item.library_playcounts: #Comprobamos si realmente sabemos el num. máximo de temporadas + num_temporadas_flag = True + else: + num_temporadas_flag = False for page in list_pages: #Recorre la lista de páginas if not list_pages: break @@ -1388,7 +1394,7 @@ def episodios(item): if not data: raise except: - logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages + " / DATA: " + data)) + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / 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 @@ -1401,13 +1407,11 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / 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 - data = '' #logger.debug("patron: " + pattern) #logger.debug(matches) #Empezamos a generar cada episodio - season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1465,6 +1469,23 @@ def episodios(item): if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" + try: + match['season'] = int(match['season']) + match['episode'] = int(match['episode']) + except: + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + " / TEMPORADA/EPISODIO: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + + if num_temporadas_flag and match['season'] != season and match['season'] > max_temp + 1: + #Si el num de temporada está fuera de control, se trata pone en num. de temporada actual + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + match['season'] = season + item_local.contentSeason = season + else: + item_local.contentSeason = match['season'] + season = match['season'] + num_temporadas_flag = True + if season > max_temp: + max_temp = season if match['quality'] and not item_local.quality and estado == True: item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie @@ -1481,7 +1502,6 @@ def episodios(item): item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) item_local.contentEpisodeNumber = match['episode'] - item_local.contentSeason = match['season'] if modo_ultima_temp and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: @@ -1512,16 +1532,21 @@ def episodios(item): del item_local.update_next itemlist.append(item_local.clone()) + + data = '' + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos # Pasada por TMDB y clasificación de lista por temporada y episodio - tmdb.set_infoLabels(itemlist, seekTmdb = True) - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + tmdb.set_infoLabels(itemlist, True) # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -1535,6 +1560,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -1569,13 +1607,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) - - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + #logger.debug(item_local) + + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/torrentrapid.py b/plugin.video.alfa/channels/torrentrapid.py index dca87382..06983789 100644 --- a/plugin.video.alfa/channels/torrentrapid.py +++ b/plugin.video.alfa/channels/torrentrapid.py @@ -66,7 +66,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -156,7 +156,7 @@ def listado(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + 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 @@ -302,6 +302,7 @@ def listado(item): #Extraemos info adicional del título y la guardamos para después de TMDB if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -508,12 +509,12 @@ def listado_busqueda(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data) except: - logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 cnt_next += 1 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 " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 @@ -592,6 +593,7 @@ def listado_busqueda(item): #logger.debug("PATRON: " + pattern) #logger.debug(matches) + #logger.debug(title_lista_alt) #logger.debug(data) cnt_title = 0 @@ -691,6 +693,7 @@ def listado_busqueda(item): #Extraemos info adicional del título y la guardamos para después de TMDB if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie": #Eliminamos Temporada de Series, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -936,8 +939,6 @@ def findvideos(item): logger.info() itemlist = [] - logger.debug(item) - # Cualquiera de las tres opciones son válidas # item.url = item.url.replace(".com/",".com/ver-online/") # item.url = item.url.replace(".com/",".com/descarga-directa/") @@ -1071,7 +1072,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -1349,7 +1350,7 @@ def episodios(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: #Algún error de proceso, salimos - logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea") + 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 @@ -1375,6 +1376,11 @@ def episodios(item): else: list_pages = [item.url] + season = max_temp + if item.library_playcounts: #Comprobamos si realmente sabemos el num. máximo de temporadas + num_temporadas_flag = True + else: + num_temporadas_flag = False for page in list_pages: #Recorre la lista de páginas if not list_pages: break @@ -1388,7 +1394,7 @@ def episodios(item): if not data: raise except: - logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages + " / DATA: " + data)) + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / 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 @@ -1401,13 +1407,11 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / 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 - data = '' #logger.debug("patron: " + pattern) #logger.debug(matches) #Empezamos a generar cada episodio - season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1465,6 +1469,23 @@ def episodios(item): if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" + try: + match['season'] = int(match['season']) + match['episode'] = int(match['episode']) + except: + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + " / TEMPORADA/EPISODIO: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + + if num_temporadas_flag and match['season'] != season and match['season'] > max_temp + 1: + #Si el num de temporada está fuera de control, se trata pone en num. de temporada actual + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + match['season'] = season + item_local.contentSeason = season + else: + item_local.contentSeason = match['season'] + season = match['season'] + num_temporadas_flag = True + if season > max_temp: + max_temp = season if match['quality'] and not item_local.quality and estado == True: item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie @@ -1481,7 +1502,6 @@ def episodios(item): item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) item_local.contentEpisodeNumber = match['episode'] - item_local.contentSeason = match['season'] if modo_ultima_temp and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: @@ -1512,16 +1532,21 @@ def episodios(item): del item_local.update_next itemlist.append(item_local.clone()) + + data = '' + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos # Pasada por TMDB y clasificación de lista por temporada y episodio - tmdb.set_infoLabels(itemlist, seekTmdb = True) - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + tmdb.set_infoLabels(itemlist, True) # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -1535,6 +1560,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -1569,13 +1607,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) - - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + #logger.debug(item_local) + + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/tumejortorrent.py b/plugin.video.alfa/channels/tumejortorrent.py index 00950acc..646a0bfb 100644 --- a/plugin.video.alfa/channels/tumejortorrent.py +++ b/plugin.video.alfa/channels/tumejortorrent.py @@ -66,7 +66,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -156,7 +156,7 @@ def listado(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + 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 @@ -302,6 +302,7 @@ def listado(item): #Extraemos info adicional del título y la guardamos para después de TMDB if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -508,12 +509,12 @@ def listado_busqueda(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data) except: - logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 cnt_next += 1 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 " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 @@ -592,6 +593,7 @@ def listado_busqueda(item): #logger.debug("PATRON: " + pattern) #logger.debug(matches) + #logger.debug(title_lista_alt) #logger.debug(data) cnt_title = 0 @@ -691,6 +693,7 @@ def listado_busqueda(item): #Extraemos info adicional del título y la guardamos para después de TMDB if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie": #Eliminamos Temporada de Series, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -936,8 +939,6 @@ def findvideos(item): logger.info() itemlist = [] - logger.debug(item) - # Cualquiera de las tres opciones son válidas # item.url = item.url.replace(".com/",".com/ver-online/") # item.url = item.url.replace(".com/",".com/descarga-directa/") @@ -1071,7 +1072,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -1349,7 +1350,7 @@ def episodios(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: #Algún error de proceso, salimos - logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea") + 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 @@ -1375,6 +1376,11 @@ def episodios(item): else: list_pages = [item.url] + season = max_temp + if item.library_playcounts: #Comprobamos si realmente sabemos el num. máximo de temporadas + num_temporadas_flag = True + else: + num_temporadas_flag = False for page in list_pages: #Recorre la lista de páginas if not list_pages: break @@ -1388,7 +1394,7 @@ def episodios(item): if not data: raise except: - logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages + " / DATA: " + data)) + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / 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 @@ -1401,13 +1407,11 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / 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 - data = '' #logger.debug("patron: " + pattern) #logger.debug(matches) #Empezamos a generar cada episodio - season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1465,6 +1469,23 @@ def episodios(item): if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" + try: + match['season'] = int(match['season']) + match['episode'] = int(match['episode']) + except: + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + " / TEMPORADA/EPISODIO: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + + if num_temporadas_flag and match['season'] != season and match['season'] > max_temp + 1: + #Si el num de temporada está fuera de control, se trata pone en num. de temporada actual + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + match['season'] = season + item_local.contentSeason = season + else: + item_local.contentSeason = match['season'] + season = match['season'] + num_temporadas_flag = True + if season > max_temp: + max_temp = season if match['quality'] and not item_local.quality and estado == True: item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie @@ -1481,7 +1502,6 @@ def episodios(item): item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) item_local.contentEpisodeNumber = match['episode'] - item_local.contentSeason = match['season'] if modo_ultima_temp and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: @@ -1512,16 +1532,21 @@ def episodios(item): del item_local.update_next itemlist.append(item_local.clone()) + + data = '' + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos # Pasada por TMDB y clasificación de lista por temporada y episodio - tmdb.set_infoLabels(itemlist, seekTmdb = True) - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + tmdb.set_infoLabels(itemlist, True) # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -1535,6 +1560,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -1569,13 +1607,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) - - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + #logger.debug(item_local) + + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/tvmoviedb.json b/plugin.video.alfa/channels/tvmoviedb.json index 6a09e799..f4e6108d 100755 --- a/plugin.video.alfa/channels/tvmoviedb.json +++ b/plugin.video.alfa/channels/tvmoviedb.json @@ -1,178 +1,178 @@ -{ - "id": "tvmoviedb", - "name": "TvMovieDB", - "active": true, - "adult": false, - "language": ["*"], - "thumbnail": "http://i.imgur.com/HA7fvgD.png", - "categories": [ - "movie", - "tvshow", - "anime" - ], - "settings": [ - { - "id": "tmdb", - "type": "list", - "label": "Idioma de búsqueda en TMDB", - "default": 7, - "enabled": true, - "visible": true, - "lvalues": [ - "Alemán", - "Francés", - "Portugués", - "Italiano", - "Español Latino", - "Catalán", - "Inglés", - "Castellano" - ] - }, - { - "id": "tmdb_alternativo", - "type": "list", - "label": "Idioma alternativo para TMDB (No sinopsis idioma principal)", - "default": 6, - "enabled": true, - "visible": true, - "lvalues": [ - "Alemán", - "Francés", - "Portugués", - "Italiano", - "Español Latino", - "Catalán", - "Inglés", - "Castellano" - ] - }, - { - "id": "imdb", - "type": "list", - "label": "Idioma de los títulos en IMDB", - "color": "0xFFE0F04B", - "default": 7, - "enabled": true, - "visible": true, - "lvalues": [ - "Alemán", - "Francés", - "Portugués", - "Italiano", - "Español Latino", - "Catalán", - "Inglés", - "Castellano" - ] - }, - { - "id": "label1", - "type": "label", - "label": "", - "enabled": false, - "visible": true - }, - { - "id": "filmaff", - "type": "list", - "label": "Sitio Web Filmaffinity", - "color": "0xFF25AA48", - "default": 5, - "enabled": true, - "visible": true, - "lvalues": [ - "Colombia", - "Chile", - "Argentina", - "México", - "US/UK", - "España" - ] - }, - { - "id": "usuariofa", - "type": "text", - "label": "Usuario Filmaffinity (Opcional)", - "color": "0xFFd50b0b", - "default": "", - "enabled": true, - "visible": true - }, - { - "id": "passfa", - "type": "text", - "label": "Contraseña Filmaffinity", - "color": "0xFFd50b0b", - "default": "", - "enabled": "!eq(-1,'')", - "hidden": true, - "visible": true - }, - { - "id": "orderfa", - "type": "list", - "label": "Ordenar listas personales de Filmaffinity por:", - "color": "0xFF25AA48", - "default": 0, - "enabled": "!eq(-1,'')", - "visible": true, - "lvalues": [ - "Posición", - "Título", - "Año", - "Voto", - "Nota media" - ] - }, - { - "id": "label2", - "type": "label", - "label": "", - "enabled": false, - "visible": true - }, - { - "id": "usuariomal", - "type": "text", - "label": "Usuario MyAnimeList (Opcional)", - "color": "0xFF25AA48", - "default": "", - "enabled": true, - "visible": true - }, - { - "id": "passmal", - "type": "text", - "label": "Contraseña MyAnimeList", - "color": "0xFF25AA48", - "default": "", - "enabled": "!eq(-1,'')", - "hidden": true, - "visible": true - }, - { - "id": "adult_mal", - "type": "bool", - "label": "Mostrar Hentais en MyAnimeList", - "color": "0xFFd50b0b", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "perfil", - "type": "list", - "label": "Perfil de color", - "default": 2, - "enabled": true, - "visible": true, - "lvalues": [ - "Perfil 3", - "Perfil 2", - "Perfil 1", - "Ninguno" - ] - } - ] +{ + "id": "tvmoviedb", + "name": "TvMovieDB", + "active": false, + "adult": false, + "language": ["*"], + "thumbnail": "http://i.imgur.com/HA7fvgD.png", + "categories": [ + "movie", + "tvshow", + "anime" + ], + "settings": [ + { + "id": "tmdb", + "type": "list", + "label": "Idioma de búsqueda en TMDB", + "default": 7, + "enabled": true, + "visible": true, + "lvalues": [ + "Alemán", + "Francés", + "Portugués", + "Italiano", + "Español Latino", + "Catalán", + "Inglés", + "Castellano" + ] + }, + { + "id": "tmdb_alternativo", + "type": "list", + "label": "Idioma alternativo para TMDB (No sinopsis idioma principal)", + "default": 6, + "enabled": true, + "visible": true, + "lvalues": [ + "Alemán", + "Francés", + "Portugués", + "Italiano", + "Español Latino", + "Catalán", + "Inglés", + "Castellano" + ] + }, + { + "id": "imdb", + "type": "list", + "label": "Idioma de los títulos en IMDB", + "color": "0xFFE0F04B", + "default": 7, + "enabled": true, + "visible": true, + "lvalues": [ + "Alemán", + "Francés", + "Portugués", + "Italiano", + "Español Latino", + "Catalán", + "Inglés", + "Castellano" + ] + }, + { + "id": "label1", + "type": "label", + "label": "", + "enabled": false, + "visible": true + }, + { + "id": "filmaff", + "type": "list", + "label": "Sitio Web Filmaffinity", + "color": "0xFF25AA48", + "default": 5, + "enabled": true, + "visible": true, + "lvalues": [ + "Colombia", + "Chile", + "Argentina", + "México", + "US/UK", + "España" + ] + }, + { + "id": "usuariofa", + "type": "text", + "label": "Usuario Filmaffinity (Opcional)", + "color": "0xFFd50b0b", + "default": "", + "enabled": true, + "visible": true + }, + { + "id": "passfa", + "type": "text", + "label": "Contraseña Filmaffinity", + "color": "0xFFd50b0b", + "default": "", + "enabled": "!eq(-1,'')", + "hidden": true, + "visible": true + }, + { + "id": "orderfa", + "type": "list", + "label": "Ordenar listas personales de Filmaffinity por:", + "color": "0xFF25AA48", + "default": 0, + "enabled": "!eq(-1,'')", + "visible": true, + "lvalues": [ + "Posición", + "Título", + "Año", + "Voto", + "Nota media" + ] + }, + { + "id": "label2", + "type": "label", + "label": "", + "enabled": false, + "visible": true + }, + { + "id": "usuariomal", + "type": "text", + "label": "Usuario MyAnimeList (Opcional)", + "color": "0xFF25AA48", + "default": "", + "enabled": true, + "visible": true + }, + { + "id": "passmal", + "type": "text", + "label": "Contraseña MyAnimeList", + "color": "0xFF25AA48", + "default": "", + "enabled": "!eq(-1,'')", + "hidden": true, + "visible": true + }, + { + "id": "adult_mal", + "type": "bool", + "label": "Mostrar Hentais en MyAnimeList", + "color": "0xFFd50b0b", + "default": false, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 2, + "enabled": true, + "visible": true, + "lvalues": [ + "Perfil 3", + "Perfil 2", + "Perfil 1", + "Ninguno" + ] + } + ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/tvmoviedb.py b/plugin.video.alfa/channels/tvmoviedb.py index 16d8e5bd..ef95c43a 100644 --- a/plugin.video.alfa/channels/tvmoviedb.py +++ b/plugin.video.alfa/channels/tvmoviedb.py @@ -730,11 +730,11 @@ def indices_tmdb(item): from datetime import datetime if "Géneros" in item.title: thumbnail = {} - url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=f7f51775877e0bb6703520952b3c7840&language=%s' + url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s' % (item.extra, langt)) + lista_generos = {} try: lista = jsontools.load(httptools.downloadpage(url, cookies=False).data)["genres"] - lista_generos = {} for l in lista: lista_generos[str(l["id"])] = l["name"] if "es" in langt: @@ -754,12 +754,10 @@ def indices_tmdb(item): sort_by = 'first_air_date.desc' param_year = 'air_date.lte' for key, value in lista_generos.items(): - new_item = item.clone() - new_item.title = value - new_item.thumbnail = thumbnail[key] - new_item.search = {'url': 'discover/%s' % item.extra, 'with_genres': key, 'sort_by': sort_by, - param_year: fecha, - 'language': langt, 'page': 1} + search = {'url': 'discover/%s' % item.extra, 'with_genres': key, 'sort_by': sort_by, + param_year: fecha, + 'language': langt, 'page': 1} + new_item = item.clone(title=value, thumbnail=thumbnail[key], action="listado_tmdb", search=search) itemlist.append(new_item) itemlist.sort(key=lambda item: item.title) diff --git a/plugin.video.alfa/channels/tvsinpagar.py b/plugin.video.alfa/channels/tvsinpagar.py index e7c13293..6c7f371c 100644 --- a/plugin.video.alfa/channels/tvsinpagar.py +++ b/plugin.video.alfa/channels/tvsinpagar.py @@ -66,7 +66,7 @@ def submenu(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -156,7 +156,7 @@ def listado(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + 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 @@ -302,6 +302,7 @@ def listado(item): #Extraemos info adicional del título y la guardamos para después de TMDB if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -508,12 +509,12 @@ def listado_busqueda(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data) except: - logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 cnt_next += 1 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 " + " / DATA: " + data) + logger.error("ERROR 01: LISTADO_BUSQUEDA: 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_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 @@ -592,6 +593,7 @@ def listado_busqueda(item): #logger.debug("PATRON: " + pattern) #logger.debug(matches) + #logger.debug(title_lista_alt) #logger.debug(data) cnt_title = 0 @@ -691,6 +693,7 @@ def listado_busqueda(item): #Extraemos info adicional del título y la guardamos para después de TMDB if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie": #Eliminamos Temporada de Series, solo nos interesa la serie completa + title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title) title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title) title = re.sub(r' - [t|T]emp\w+ \d+', '', title) title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title) @@ -936,8 +939,6 @@ def findvideos(item): logger.info() itemlist = [] - logger.debug(item) - # Cualquiera de las tres opciones son válidas # item.url = item.url.replace(".com/",".com/ver-online/") # item.url = item.url.replace(".com/",".com/descarga-directa/") @@ -1071,7 +1072,7 @@ def findvideos(item): try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) except: - logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea " + " / DATA: " + data) + logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data) 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 data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") @@ -1349,7 +1350,7 @@ def episodios(item): try: data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) except: #Algún error de proceso, salimos - logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea") + 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 @@ -1375,6 +1376,11 @@ def episodios(item): else: list_pages = [item.url] + season = max_temp + if item.library_playcounts: #Comprobamos si realmente sabemos el num. máximo de temporadas + num_temporadas_flag = True + else: + num_temporadas_flag = False for page in list_pages: #Recorre la lista de páginas if not list_pages: break @@ -1388,7 +1394,7 @@ def episodios(item): if not data: raise except: - logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages + " / DATA: " + data)) + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / 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 @@ -1401,13 +1407,11 @@ def episodios(item): logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / 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 - data = '' #logger.debug("patron: " + pattern) #logger.debug(matches) #Empezamos a generar cada episodio - season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1465,6 +1469,23 @@ def episodios(item): if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico if match['episode'] is None: match['episode'] = "0" + try: + match['season'] = int(match['season']) + match['episode'] = int(match['episode']) + except: + logger.error("ERROR 07: EPISODIOS: Error en número de Temporada o Episodio: " + " / TEMPORADA/EPISODIO: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + + if num_temporadas_flag and match['season'] != season and match['season'] > max_temp + 1: + #Si el num de temporada está fuera de control, se trata pone en num. de temporada actual + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(match['season']) + " / " + str(match['episode']) + " / NUM_TEMPORADA: " + str(max_temp) + " / " + str(season) + " / MATCHES: " + str(matches)) + match['season'] = season + item_local.contentSeason = season + else: + item_local.contentSeason = match['season'] + season = match['season'] + num_temporadas_flag = True + if season > max_temp: + max_temp = season if match['quality'] and not item_local.quality and estado == True: item_local.quality = match['quality'] #Si hay quality se coge, si no, la de la serie @@ -1481,7 +1502,6 @@ def episodios(item): item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2)) item_local.contentEpisodeNumber = match['episode'] - item_local.contentSeason = match['season'] if modo_ultima_temp and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca if item_local.contentSeason < max_temp: @@ -1512,16 +1532,21 @@ def episodios(item): del item_local.update_next itemlist.append(item_local.clone()) + + data = '' + + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos # Pasada por TMDB y clasificación de lista por temporada y episodio - tmdb.set_infoLabels(itemlist, seekTmdb = True) - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + tmdb.set_infoLabels(itemlist, True) # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 - num_episodios_lista = [0] + num_episodios_lista = [] + for i in range(0, 50): num_episodios_lista += [0] num_temporada = 1 + num_temporada_max = 99 num_episodios_flag = True for item_local in itemlist: @@ -1535,6 +1560,19 @@ def episodios(item): rating = round(rating, 1) #Salvamos en número de episodios de la temporada + if item_local.infoLabels['number_of_seasons']: + #Si el num de temporada está fuera de control, se pone 0, y se reclasifica itemlist + if item_local.contentSeason > item_local.infoLabels['number_of_seasons'] + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(item_local.infoLabels['number_of_seasons']) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + else: + num_temporada_max = item_local.infoLabels['number_of_seasons'] + else: + if item_local.contentSeason > num_temporada_max + 1: + logger.error("ERROR 07: EPISODIOS: Num. de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) + item_local.contentSeason = 0 + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) if num_temporada != item_local.contentSeason: num_temporada = item_local.contentSeason num_episodios = 0 @@ -1569,13 +1607,17 @@ def episodios(item): if num_episodios and not item_local.infoLabels['temporada_num_episodios']: item_local.infoLabels['temporada_num_episodios'] = num_episodios num_episodios_flag = False - num_episodios_lista[item_local.contentSeason:] = [num_episodios] + num_episodios_lista[item_local.contentSeason] = [num_episodios] #logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber) + " / num_episodios_lista: " + str(num_episodios_lista) + str(num_episodios_flag)) - - if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie - for item_local in itemlist: - item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + #logger.debug(item_local) + + try: + if not num_episodios_flag: #Si el num de episodios no está informado, acualizamos episodios de toda la serie + for item_local in itemlist: + item_local.infoLabels['temporada_num_episodios'] = num_episodios_lista[item_local.contentSeason] + except: + logger.error("ERROR 07: EPISODIOS: Num de Temporada fuera de rango " + " / TEMPORADA: " + str(item_local.contentSeason) + " / " + str(item_local.contentEpisodeNumber) + " / MAX_TEMPORADAS: " + str(num_temporada_max) + " / LISTA_TEMPORADAS: " + str(num_episodios_lista)) if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/videolibrary.json b/plugin.video.alfa/channels/videolibrary.json index e0caf59c..909f7563 100755 --- a/plugin.video.alfa/channels/videolibrary.json +++ b/plugin.video.alfa/channels/videolibrary.json @@ -267,6 +267,16 @@ "Título original" ] }, + { + "id": "lowerize_title", + "type": "list", + "label": "Crear directorios con letras en miúsculas", + "default": 0, + "lvalues": [ + "Si", + "No" + ] + }, { "id": "lab_1", "type": "label", diff --git a/plugin.video.alfa/core/videolibrarytools.py b/plugin.video.alfa/core/videolibrarytools.py index eae0b8e7..73f1c832 100644 --- a/plugin.video.alfa/core/videolibrarytools.py +++ b/plugin.video.alfa/core/videolibrarytools.py @@ -125,6 +125,9 @@ def save_movie(item): base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").encode("utf8") + if config.get_setting("lowerize_title", "videolibrary") == 0: + base_name = base_name.lower() + for raiz, subcarpetas, ficheros in filetools.walk(MOVIES_PATH): for c in subcarpetas: code = scrapertools.find_single_match(c, '\[(.*?)\]') @@ -246,6 +249,9 @@ def save_tvshow(item, episodelist): base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").encode("utf8") + if config.get_setting("lowerize_title", "videolibrary") == 0: + base_name = base_name.lower() + for raiz, subcarpetas, ficheros in filetools.walk(TVSHOWS_PATH): for c in subcarpetas: code = scrapertools.find_single_match(c, '\[(.*?)\]') diff --git a/plugin.video.alfa/servers/powvideo.py b/plugin.video.alfa/servers/powvideo.py index c82961ec..de0c0c4c 100755 --- a/plugin.video.alfa/servers/powvideo.py +++ b/plugin.video.alfa/servers/powvideo.py @@ -44,5 +44,5 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= def decode_powvideo_url(url): tria = re.compile('[0-9a-z]{40,}', re.IGNORECASE).findall(url)[0] gira = tria[::-1] - x = gira[:2] + gira[3:] + x = gira[1:] return re.sub(tria, x, url) diff --git a/plugin.video.alfa/servers/streamcloud.py b/plugin.video.alfa/servers/streamcloud.py index e7311743..350b6dc5 100755 --- a/plugin.video.alfa/servers/streamcloud.py +++ b/plugin.video.alfa/servers/streamcloud.py @@ -45,7 +45,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= media_url = scrapertools.get_match(data, 'file\: "([^"]+)"') video_urls = [] - video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [streamcloud]", media_url]) + video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [streamcloud]", media_url+"|Referer="+page_url]) + for video_url in video_urls: logger.info("%s - %s" % (video_url[0], video_url[1])) diff --git a/plugin.video.alfa/servers/streamplay.py b/plugin.video.alfa/servers/streamplay.py index 9ceae02b..cf8e0303 100644 --- a/plugin.video.alfa/servers/streamplay.py +++ b/plugin.video.alfa/servers/streamplay.py @@ -46,5 +46,5 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= def decode_video_url(url): tria = re.compile('[0-9a-z]{40,}', re.IGNORECASE).findall(url)[0] gira = tria[::-1] - x = gira[:2] + gira[3:] + x = gira[:3] + gira[4:] return re.sub(tria, x, url) diff --git a/plugin.video.alfa/servers/vidoza.py b/plugin.video.alfa/servers/vidoza.py index eacec9e5..a7b55f11 100755 --- a/plugin.video.alfa/servers/vidoza.py +++ b/plugin.video.alfa/servers/vidoza.py @@ -20,7 +20,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= logger.info("(page_url='%s')" % page_url) data = httptools.downloadpage(page_url).data video_urls = [] - matches = scrapertools.find_multiple_matches(data, 'file\s*:\s*"([^"]+)"\s*,\s*label:"([^"]+)"') + matches = scrapertools.find_multiple_matches(data, 'src\s*:\s*"([^"]+)".*?label:\'([^\']+)\'') for media_url, calidad in matches: ext = media_url[-4:] video_urls.append(["%s %s [vidoza]" % (ext, calidad), media_url])