diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index 73abc370..85cb8395 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,15 +19,17 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - » clipwatching » vidup - » allcalidad » descargacineclasico - » mastorrent » tiotorrent - » animeshd » filebebo - » cuevana2 » Cuevana2español - » seriesverde » flashx + » grantorrent » descargas2020 + » mejortorrent » mispelisyseries + » torrentlocura » torrentrapid + » tumejortorrent » tvsinpagar + » hdfull » clipwatching + » filebebo » anitoons + » netutv » seriesverde + » peliculasdk » cuevana2 + » cuevana2español ¤ arreglos internos - - ¤ Agradecimientos a @angedam, @alaquepasa, @mrgaturus, @axlt2002 por colaborar con ésta versión. + ¤ Agradecimientos a @mrgaturus 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/anitoonstv.py b/plugin.video.alfa/channels/anitoonstv.py index 5fcc9900..02720e32 100644 --- a/plugin.video.alfa/channels/anitoonstv.py +++ b/plugin.video.alfa/channels/anitoonstv.py @@ -33,13 +33,12 @@ def mainlist(item): itemlist = list() itemlist.append(Item(channel=item.channel, action="lista", title="Series", url=host+"/lista-de-anime.php", - thumbnail=thumb_series)) - #itemlist.append(Item(channel=item.channel, action="lista", title="Series Animadas", url=host, - # thumbnail=thumb_series)) - #itemlist.append(Item(channel=item.channel, action="lista", title="Novedades", url=host, - # thumbnail=thumb_series)) - #itemlist.append(Item(channel=item.channel, action="lista", title="Pokemon", url=host, - # thumbnail=thumb_series)) + thumbnail=thumb_series, range=[0,19])) + itemlist.append(Item(channel=item.channel, action="lista", title="Películas", url=host+"/catalogo.php?g=&t=peliculas&o=0", + thumbnail=thumb_series, range=[0,19] )) + itemlist.append(Item(channel=item.channel, action="lista", title="Especiales", url=host+"/catalogo.php?g=&t=especiales&o=0", + thumbnail=thumb_series, range=[0,19])) + itemlist = renumbertools.show_option(item.channel, itemlist) autoplay.show_option(item.channel, itemlist) return itemlist @@ -60,8 +59,9 @@ def lista(item): patron +=".+?(.+?)<\/span>" #scrapedplot matches = scrapertools.find_multiple_matches(data, patron) - for scrapedurl, scrapedthumbnail,scrapedtitle,scrapedplot in matches: - if ":" in scrapedtitle: + next_page = [item.range[0]+19, item.range[1]+20] + for scrapedurl, scrapedthumbnail,scrapedtitle,scrapedplot in matches[item.range[0] : item.range[1]]: + if ":" in scrapedtitle: cad = scrapedtitle.split(":") show = cad[0] else: @@ -81,9 +81,15 @@ def lista(item): context2 = autoplay.context context.extend(context2) scrapedurl=host+scrapedurl - itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl, plot=scrapedplot, - thumbnail=scrapedthumbnail, action="episodios", show=show, context=context)) - #tmdb.set_infoLabels(itemlist) + if item.title!="Series": + itemlist.append(item.clone(title=scrapedtitle, contentTitle=show,url=scrapedurl, + thumbnail=scrapedthumbnail, action="findvideos", context=context)) + else: + itemlist.append(item.clone(title=scrapedtitle, contentSerieName=show,url=scrapedurl, plot=scrapedplot, + thumbnail=scrapedthumbnail, action="episodios", context=context)) + tmdb.set_infoLabels(itemlist, seekTmdb=True) + itemlist.append(Item(channel=item.channel, url=item.url, range=next_page, title='Pagina Siguente >>>', action='lista')) + return itemlist @@ -92,16 +98,16 @@ def episodios(item): itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - patron = '
(.+?)<\/div>
' data = scrapertools.find_single_match(data, patron) patron_caps = "
  • Cap(?:i|í)tulo: (.+?) - (.+?)<\/a>" matches = scrapertools.find_multiple_matches(data, patron_caps) - show = scrapertools.find_single_match(data, 'Titulo.+?<\/span>(.+?)
    ') + #show = scrapertools.find_single_match(data, 'Titulo.+?<\/span>(.+?)
    ') scrapedthumbnail = scrapertools.find_single_match(data, "") scrapedplot = scrapertools.find_single_match(data, 'Descripcion.+?<\/span>(.+?)
    ') i = 0 temp = 0 + infoLabels = item.infoLabels for link, cap, name in matches: if int(cap) == 1: temp = temp + 1 @@ -109,19 +115,25 @@ def episodios(item): cap = "0" + cap season = temp episode = int(cap) + season, episode = renumbertools.numbered_for_tratk( item.channel, item.show, season, episode) + + infoLabels['season'] = season + infoLabels['episode'] = episode date = name title = "%sx%s %s (%s)" % (season, str(episode).zfill(2), "Episodio %s" % episode, date) # title = str(temp)+"x"+cap+" "+name url = host + "/" + link if "NO DISPONIBLE" not in name: itemlist.append(Item(channel=item.channel, action="findvideos", title=title, thumbnail=scrapedthumbnail, - plot=scrapedplot, url=url, show=show)) + plot=scrapedplot, url=url, contentSeasonNumber=season, contentEpisodeNumber=episode, + contentSerieName=item.contentSerieName, infoLabels=infoLabels)) if config.get_videolibrary_support() and len(itemlist) > 0: itemlist.append(Item(channel=item.channel, title="[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]", url=item.url, - action="add_serie_to_library", extra="episodios", show=item.title)) + action="add_serie_to_library", extra="episodios", contentSerieName=item.contentSerieName)) + return itemlist @@ -149,15 +161,15 @@ def findvideos(item): scrapedthumbnail = scrapertools.find_single_match(data, '
    ') itemla = scrapertools.find_multiple_matches(data_vid, '"(.+?)"') for url in itemla: - url=url.replace('\/', '/') - server1=url.split('/') - server=server1[2] - if "." in server: - server1=server.split('.') - if len(server1)==3: - server=server1[1] - else: - server=server1[0] + url=url.replace('\/', '/') + server1=url.split('/') + server=server1[2] + if "." in server: + server1=server.split('.') + if len(server1)==3: + server=server1[1] + else: + server=server1[0] if "goo" in url: url = googl(url) server='netutv' @@ -168,6 +180,9 @@ def findvideos(item): itemlist.append(item.clone(url=url, action="play", thumbnail=scrapedthumbnail, server=server, plot=scrapedplot, title="Enlace encontrado en: %s [%s]" % (server.capitalize(), quality))) + if item.contentTitle!="" and config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append(Item(channel=item.channel, title="[COLOR yellow]Añadir esta película a la videoteca[/COLOR]", url=item.url, + action="add_pelicula_to_library", extra="episodios", show=item.contentTitle)) autoplay.start(itemlist, item) return itemlist diff --git a/plugin.video.alfa/channels/cuevana2.py b/plugin.video.alfa/channels/cuevana2.py index 938a1bda..95b63fcb 100644 --- a/plugin.video.alfa/channels/cuevana2.py +++ b/plugin.video.alfa/channels/cuevana2.py @@ -21,18 +21,9 @@ def mainlist(item): logger.info() autoplay.init(item.channel, list_servers, list_quality) itemlist = [] - itemlist.append(Item(channel = item.channel, title = "Peliculas", action = "movies_menu", - url = host + "pelicula", thumbnail = get_thumb("movies", auto = True))) - itemlist.append(Item(channel = item.channel, title = "Series", action = "shows_menu", - url = host + "pelicula", thumbnail = get_thumb("tvshows", auto = True) )) - itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search", - url = host + "search/", thumbnail = get_thumb("search", auto = True))) - autoplay.show_option(item.channel, itemlist) - - return itemlist - -def movies_menu(item): - itemlist = [] + # PELICULAS + itemlist.append(Item(channel = item.channel, title = "Peliculas", folder=False, + thumbnail = get_thumb("movies", auto = True), text_bold=True)) itemlist.append(Item(channel = item.channel, title = "Novedades", action = "movies", url = host + "pelicula", thumbnail = get_thumb("newest", auto = True))) @@ -42,18 +33,20 @@ def movies_menu(item): url = host + "pelicula", thumbnail = get_thumb("year", auto = True))) itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "movies", url = host + "peliculas-destacadas", thumbnail = get_thumb("favorites", auto = True) )) - itemlist.append(Item(channel = item.channel, title = "")) itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search", url = host + "search/", thumbnail = get_thumb("search", auto = True))) - return itemlist + # SERIES + itemlist.append(Item(channel = item.channel, title = "Series", folder=False, + thumbnail = get_thumb("tvshows", auto = True), text_bold=True)) -def shows_menu(item): - itemlist = [] itemlist.append(Item(channel = item.channel, title = "Todas las Series", action = "shows", url = host + "listar-series", thumbnail = get_thumb("tvshows", auto = True))) itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search", extra='1', url = host + "listar-series", thumbnail = get_thumb("search", auto = True))) + + autoplay.show_option(item.channel, itemlist) + return itemlist ### FIN MENUS ### @@ -98,7 +91,8 @@ def episodes(item): matches = scrapertools.find_multiple_matches(data, seasonsPattern) for season, title in matches: - itemlist.append(Item(channel = item.channel, title="[COLOR blue]%s[/COLOR]" % title)) + itemlist.append(Item(channel = item.channel, title="[COLOR blue]%s[/COLOR]" % title, + folder=False, text_bold=True)) episodeMatches = scrapertools.find_single_match(data, episodesPattern % season) put_episodes(itemlist, item, episodeMatches) @@ -166,7 +160,7 @@ def searchMovies(itemlist, item, texto): #coloca las peliculas encontradas en la lista, improvisando do while next_page = True while next_page: - put_movies(itemlist, data, pattern) + put_movies(itemlist, item, data, pattern) next_page = scrapertools.find_single_match(data, '' matches = re.compile(patron, re.DOTALL).findall(data) + if not matches: + logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.strip() @@ -106,6 +125,10 @@ def alfabeto(item): patron = ']+>([^>]+)' matches = re.compile(patron, re.DOTALL).findall(data) + if not matches: + logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos for scrapedurl, scrapedtitle in matches: title = scrapedtitle.upper() @@ -130,7 +153,12 @@ def listado(item): if item.totalItems: del item.totalItems - data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) + 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) + 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 #Establecemos los valores básicos en función del tipo de contenido if item.extra == "peliculas": @@ -150,6 +178,12 @@ def listado(item): patron = '
      (.*?)
    ' if data: fichas = scrapertools.get_match(data, patron) + if not fichas and not '

    ( 0 ) Resultados encontrados ' in data: #error + logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos + elif '

    ( 0 ) Resultados encontrados ' in data: #no hay vídeos + return itemlist else: return itemlist page_extra = clase @@ -157,10 +191,15 @@ def listado(item): #Scrapea los datos de cada vídeo. Título alternativo se mantiene, aunque no se usa de momento patron = '( 0 ) Resultados encontrados ' in data_alt: #error + logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + data_alt) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web. Reportar el error con el log')) + return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos #Ahora se hace una simulación para saber cuantas líneas podemos albergar en este Itemlist. #Se controlará cuantas páginas web se tienen que leer para rellenar la lista, sin pasarse + + title_lista_alt_for = [] #usamos está lista de urls para el FOR, luego la integramos en la del WHILE for scrapedurl, scrapedtitle, scrapedthumbnail, calidad, year, size in matches_alt: #Realiza un control de las series que se añaden, ya que el buscador devuelve episodios y no las series completas #Se analiza si la url de la serie ya se ha listado antes. Si es así, esa entrada se ignora #Cuando llega al num. máximo de entradas por página, la pinta y guarda los contadores y la lista de series + scrapedurl_alt = scrapedurl if "pelisyseries.com" in host: #Excepción para mispelisyseries.com. - scrapedurl_alt = scrapedurl scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie @@ -514,14 +567,12 @@ def listado_busqueda(item): if scrapedurl_alt in title_lista_alt: # si ya se ha tratado, pasamos al siguiente item continue # solo guardamos la url para series y docus - if scrapedurl in title_lista_alt: # si ya se ha tratado, pasamos al siguiente item + if scrapedurl_alt in title_lista_alt or scrapedurl_alt in title_lista_alt_for: # si ya se ha tratado, pasamos al siguiente item continue # solo guardamos la url para series y docus if ".com/serie" in scrapedurl or "/serie" in scrapedurl or "-serie" in scrapedurl or "varios/" in scrapedurl: - if "pelisyseries.com" in host: - title_lista_alt += [scrapedurl_alt] - else: - title_lista_alt += [scrapedurl] + title_lista_alt_for += [scrapedurl_alt] + if "juego/" in scrapedurl: # no mostramos lo que no sean videos continue cnt_title += 1 # Sería una línea real más para Itemlist @@ -537,6 +588,7 @@ def listado_busqueda(item): if cnt_title <= cnt_tot: matches.extend(matches_alt) #Acumulamos las entradas a tratar. Si nos hemos pasado ignoro última página + title_lista_alt.extend(title_lista_alt_for) #logger.debug("PATRON: " + pattern) #logger.debug(matches) @@ -811,7 +863,7 @@ def listado_busqueda(item): return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo #Pasamos a TMDB la lista completa Itemlist - tmdb.set_infoLabels(itemlist, True) + tmdb.set_infoLabels(itemlist, __modo_grafico__) # Pasada para maquillaje de los títulos obtenidos desde TMDB for item_local in itemlist: @@ -884,6 +936,8 @@ 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/") @@ -970,14 +1024,14 @@ def findvideos(item): except Exception, ex: #En caso de error, lo mostramos y reseteamos todas las variables logger.error("Error en la lectura de parámentros del .json del canal: " + item.channel + " \n%s" % ex) #Mostrar los errores - logger.debug(ver_enlaces_veronline) - logger.debug(verificar_enlaces_veronline) - logger.debug(verificar_enlaces_veronline_validos) - logger.debug(excluir_enlaces_veronline) - logger.debug(ver_enlaces_descargas) - logger.debug(verificar_enlaces_descargas) - logger.debug(verificar_enlaces_descargas_validos) - logger.debug(excluir_enlaces_descargas) + logger.error(ver_enlaces_veronline) + logger.error(verificar_enlaces_veronline) + logger.error(verificar_enlaces_veronline_validos) + logger.error(excluir_enlaces_veronline) + logger.error(ver_enlaces_descargas) + logger.error(verificar_enlaces_descargas) + logger.error(verificar_enlaces_descargas_validos) + logger.error(excluir_enlaces_descargas) #Resetear las variables a sus valores por defecto ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online @@ -1006,15 +1060,20 @@ def findvideos(item): # Obtener la información actualizada del Episodio, si no la hay if not item.infoLabels['tmdb_id'] or (not item.infoLabels['episodio_titulo'] and item.contentType == 'episode'): - tmdb.set_infoLabels(item, True) + tmdb.set_infoLabels(item, __modo_grafico__) elif (not item.infoLabels['tvdb_id'] and item.contentType == 'episode') or item.contentChannel == "videolibrary": - tmdb.set_infoLabels(item, True) + tmdb.set_infoLabels(item, __modo_grafico__) #Restauramos la información de max num. de episodios por temporada despues de TMDB if item.infoLabels['temporada_num_episodios'] and num_episodios > item.infoLabels['temporada_num_episodios']: item.infoLabels['temporada_num_episodios'] = num_episodios # Descarga la página - data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) + 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) + 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") data = data.replace("$!", "#!").replace("'", "\"").replace("ñ", "ñ").replace("//pictures", "/pictures") @@ -1029,10 +1088,9 @@ def findvideos(item): #Limpiamos de año y rating de episodios if item.infoLabels['episodio_titulo']: item.infoLabels['episodio_titulo'] = re.sub(r'\s?\[.*?\]', '', item.infoLabels['episodio_titulo']) - if item.infoLabels['episodio_titulo'] == item.contentSerieName: - item.infoLabels['episodio_titulo'] = '' + item.infoLabels['episodio_titulo'] = item.infoLabels['episodio_titulo'].replace(item.wanted, '') if item.infoLabels['aired'] and item.contentType == "episode": - item.infoLabels['year'] = scrapertools.find_single_match(str(item.infoLabels['aired']), r'\/(\d{4})') + item.infoLabels['year'] = scrapertools.find_single_match(str(item.infoLabels['aired']), r'\/(\d{4})') #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() @@ -1040,6 +1098,10 @@ def findvideos(item): # obtenemos la url torrent patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' item_local.url = scrapertools.find_single_match(data, patron) + if not item_local.url: #error + logger.error("ERROR 02: FINDVIDEOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: 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 item_local.url = item_local.url.replace(" ", "%20") #sustituimos espacios por %20, por si acaso #logger.debug("Patron: " + patron + " url: " + item_local.url) #logger.debug(data) @@ -1136,6 +1198,7 @@ def findvideos(item): item_local.alive = "??" #Se asume poe defecto que es link es dudoso if verificar_enlaces_veronline != 0: #Se quiere verificar si el link está activo? if cnt_enl_verif <= verificar_enlaces_veronline or verificar_enlaces_veronline == -1: #contador? + #Llama a la subfunción de check_list_links(itemlist) para cada link de servidor item_local.alive = servertools.check_video_link(enlace, servidor) #activo el link ? if verificar_enlaces_veronline_validos: #Los links tienen que ser válidos para contarlos? if item_local.alive == "Ok": #Sí @@ -1225,6 +1288,7 @@ def findvideos(item): item_local.alive = "??" #Se asume poe defecto que es link es dudoso if verificar_enlaces_descargas != 0: #Se quiere verificar si el link está activo? if cnt_enl_verif <= verificar_enlaces_descargas or verificar_enlaces_descargas == -1: #contador? + #Llama a la subfunción de check_list_links(itemlist) para primer link de servidor item_local.alive = servertools.check_video_link(enlace, servidor) #activo el link ? if verificar_enlaces_descargas_validos: #Los links tienen que ser válidos para contarlos? if item_local.alive == "Ok": #Sí @@ -1268,17 +1332,41 @@ def episodios(item): logger.info() itemlist = [] - data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + max_temp = 1 + y = [] + if modo_ultima_temp and item.library_playcounts: #Averiguar cuantas temporadas hay en Videoteca + patron = 'season (\d+)' + matches = re.compile(patron, re.DOTALL).findall(str(item.library_playcounts)) + for x in matches: + y += [int(x)] + max_temp = max(y) + + # Obtener la información actualizada de la Serie. TMDB es imprescindible para Videoteca + if not item.infoLabels['tmdb_id']: + tmdb.set_infoLabels(item, True) + + data = '' + 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") + 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 #Busca y pre-carga todas las páginas de episodios que componen las serie, para obtener la url de cada página pattern = '
      (.*?)
    ' % "pagination" # item.pattern pagination = scrapertools.find_single_match(data, pattern) if pagination: - pattern = '
  • Last<\/a>' #Busca última página + if "/pg/" in item.url: + act_page = int(scrapertools.find_single_match(item.url, r'\/pg\/(\d+)')) #Num página actual + else: + act_page = 1 + pattern = '
  • Last<\/a>' #Busca última página full_url = scrapertools.find_single_match(pagination, pattern) url, last_page = scrapertools.find_single_match(full_url, r'(.*?\/pg\/)(\d+)') + last_page = int(last_page) list_pages = [item.url] - for x in range(2, int(last_page) + 1): #carga cada página para obtener la url de la siguiente + for x in range(act_page + 1, last_page + 1): #carga cada página para obtener la url de la siguiente #LAS SIGUIENTES 3 LINEAS ANULADAS: no es necesario leer la pagína siguiente. Se supone que está activa #response = httptools.downloadpage('%s%s'% (url,x)) #if response.sucess: @@ -1287,28 +1375,39 @@ def episodios(item): else: list_pages = [item.url] - for index, page in enumerate(list_pages): #Recorre la lista de páginas - data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(page).data) - data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") - data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com - pattern = '
      (.*?)
    ' % "buscar-list" # item.pattern - if scrapertools.find_single_match(data, pattern): + for page in list_pages: #Recorre la lista de páginas + if not list_pages: + break + try: + if not data: + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(page).data) + data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com + pattern = '
      (.*?)
    ' % "buscar-list" # item.pattern data = scrapertools.get_match(data, pattern) - else: - logger.debug(item) - logger.debug("patron: " + pattern + " / data: " + data) - return itemlist + if not data: + raise + except: + 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 if "pelisyseries.com" in host: pattern = ']*>
    ]+>(?P.*?)?<\/h3>.*?<\/li>' else: pattern = ']*>]+>(?P.*?)?<\/h2>' matches = re.compile(pattern, re.DOTALL).findall(data) + if not matches: #error + 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 = "1" + season = max_temp for url, thumb, info in matches: if "pelisyseries.com" in host: #En esta web están en diferente orden interm = url @@ -1359,6 +1458,10 @@ def episodios(item): r = re.compile(pattern) match = [m.groupdict() for m in r.finditer(info)][0] + if not match: #error + logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + info) + 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 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" @@ -1379,13 +1482,37 @@ def episodios(item): 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: + list_pages = [] #Sale del bucle de leer páginas + break #Sale del bucle actual del FOR de episodios por página + #if ('%sx%s' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2))) in item.library_playcounts: + # continue + + if item_local.active: + del item_local.active + if item_local.category: + del item_local.category + if item_local.infoLabels['title']: + del item_local.infoLabels['title'] + item_local.context = "['buscar_trailer']" item_local.action = "findvideos" + item_local.contentType = "episode" item_local.extra = "episodios" + if item_local.library_playcounts: + del item_local.library_playcounts + if item_local.library_urls: + del item_local.library_urls + if item_local.path: + del item_local.path + if item_local.update_last: + del item_local.update_last + if item_local.update_next: + del item_local.update_next itemlist.append(item_local.clone()) - - logger.debug("title: " + item_local.title + " / url: " + item_local.url + " / calidad: " + item_local.quality + " / Season: " + str(item_local.contentSeason) + " / EpisodeNumber: " + str(item_local.contentEpisodeNumber)) - + # Pasada por TMDB y clasificación de lista por temporada y episodio tmdb.set_infoLabels(itemlist, seekTmdb = True) if len(itemlist) > 1: @@ -1393,7 +1520,9 @@ def episodios(item): # Pasada para maqullaje de los títulos obtenidos desde TMDB num_episodios = 1 + num_episodios_lista = [0] num_temporada = 1 + num_episodios_flag = True for item_local in itemlist: # Si no hay datos de TMDB, pongo los datos locales que conozco @@ -1416,7 +1545,7 @@ def episodios(item): if item_local.infoLabels['episodio_titulo']: if "al" in item_local.title: #Si son episodios múltiples, ponemos nombre de serie item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) - item_local.infoLabels['episodio_titulo'] = '%s %s' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName) + item_local.infoLabels['episodio_titulo'] = '%s - %s' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName) else: item_local.title = '%s %s' % (item_local.title, item_local.infoLabels['episodio_titulo']) if item_local.infoLabels['year']: @@ -1439,8 +1568,14 @@ def episodios(item): num_episodios = item_local.contentEpisodeNumber 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] - #logger.debug("title=[" + item_local.title + "], url=[" + item_local.url + "], item=[" + str(item_local) + "]") + #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] if config.get_videolibrary_support() and len(itemlist) > 0: title = '' diff --git a/plugin.video.alfa/channels/grantorrent.json b/plugin.video.alfa/channels/grantorrent.json new file mode 100644 index 00000000..d82d7313 --- /dev/null +++ b/plugin.video.alfa/channels/grantorrent.json @@ -0,0 +1,53 @@ +{ + "id": "grantorrent", + "name": "GranTorrent", + "active": true, + "adult": false, + "language": ["*"], + "thumbnail": "grantorrent.jpg", + "banner": "grantorrent.png", + "fanart": "grantorrent.png", + "categories": [ + "torrent", + "movie", + "tvshow" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "seleccionar_serie_temporada", + "type": "list", + "label": "Seleccionar agrupar por Serie o Temporada", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "Temporada", + "Serie" + ] + }, + { + "id": "seleccionar_ult_temporadda_activa", + "type": "bool", + "label": "Seleccionar para Videoteca si estará activa solo la última Temporada", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra (TMDB)", + "default": true, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py new file mode 100644 index 00000000..bde52446 --- /dev/null +++ b/plugin.video.alfa/channels/grantorrent.py @@ -0,0 +1,994 @@ +# -*- coding: utf-8 -*- + +import re +import sys +import urllib +import urlparse + +from channelselector import get_thumb +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from platformcode import config, logger +from core import tmdb + +host = "https://grantorrent.net/" + +dict_url_seasons = dict() +__modo_grafico__ = config.get_setting('modo_grafico', 'grantorrent') +modo_serie_temp = config.get_setting('seleccionar_serie_temporada', 'grantorrent') +modo_ultima_temp = config.get_setting('seleccionar_ult_temporadda_activa', 'grantorrent') + + +def mainlist(item): + logger.info() + + itemlist = [] + + thumb_pelis = get_thumb("channels_movie.png") + thumb_pelis_hd = get_thumb("channels_movie_hd.png") + thumb_series = get_thumb("channels_tvshow.png") + thumb_series_hd = get_thumb("channels_tvshow_hd.png") + thumb_buscar = get_thumb("search.png") + thumb_settings = get_thumb("setting_0.png") + + itemlist.append(Item(channel=item.channel, action="submenu", title="Películas", url=host, extra="peliculas", thumbnail=thumb_pelis)) + + #Buscar películas + itemlist.append(Item(channel=item.channel, action="search", title="Buscar en Películas >>", url=host, extra="peliculas", thumbnail=thumb_buscar)) + + itemlist.append(Item(channel=item.channel, action="submenu", title="Series", url=host, extra="series", thumbnail=thumb_series)) + + #Buscar series + itemlist.append(Item(channel=item.channel, action="search", title="Buscar en Series >>", url=host + "series/", extra="series", thumbnail=thumb_buscar)) + + itemlist.append( + Item(channel=item.channel, action="", title="[COLOR yellow]Configuración del Canal:[/COLOR]", url="", thumbnail=thumb_settings)) + itemlist.append( + Item(channel=item.channel, action="settingCanal", title="Opciones de Videoteca y TMDB", url="", thumbnail=thumb_settings)) + + return itemlist + + +def settingCanal(item): + from platformcode import platformtools + return platformtools.show_channel_settings() + + +def submenu(item): + logger.info() + itemlist = [] + + thumb_buscar = get_thumb("search.png") + + 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") + 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 + + if item.extra == "peliculas": + patron = '
  • ') + except: + logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de 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) + 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 + + #Obtiene la dirección de la próxima página, si la hay + try: + patron = '') #Seleccionamos la zona de links + + patron = '\/icono_.*?png" title="(?P.*?)?" [^>]+><\/td>(?P.*?)?.*?(?P.*?)?<\/td> 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and not "Temporada" in itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... + if itemlist[-1].quality: + itemlist[-1].quality += ", " + quality #... pero acumulamos las calidades + else: + itemlist[-1].quality = quality + continue #ignoramos el episodio duplicado + else: + item_local.quality = quality + + itemlist.append(item_local.clone()) #guardamos el episodio + + #logger.debug("EPISODIOS: " + temp_actual + " (" + str (item_local.contentSeason) + "x" + str (item_local.contentEpisodeNumber) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista Temps: " + str(temp_lista)) + #logger.debug(item_local) + + temp_lista += [temp_actual_num] + if temp_advance == 'back': + temp_actual = temp_previous #hay temporadas anteriores, iremos marcha atrás procesándolas + elif temp_advance == 'forw': + temp_actual = temp_next #hay temporadas posteriores. Las procesamos + else: + temp_actual = '' #No hay más temporadas, salimos + + data = '' #Limpiamos data para forzar la lectura en la próxima pasada + + 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, True) + + # Pasada para maquillaje de los títulos obtenidos desde TMDB + num_episodios = 1 + num_episodios_lista = [0] + num_temporada = 1 + num_episodios_flag = True + for item_local in itemlist: + + # Si no hay datos de TMDB, pongo los datos locales que conozco + if item_local.infoLabels['aired']: + item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})') + + rating = '' + if item_local.infoLabels['rating'] and item_local.infoLabels['rating'] != '0.0': + rating = float(item_local.infoLabels['rating']) + rating = round(rating, 1) + + #Salvamos en número de episodios de la temporada + if num_temporada != item_local.contentSeason: + num_temporada = item_local.contentSeason + num_episodios = 0 + if item_local.infoLabels['temporada_num_episodios']: + num_episodios = item_local.infoLabels['temporada_num_episodios'] + + #Preparamos el título para que sea compatible con Añadir Serie a Videoteca + if item_local.infoLabels['episodio_titulo'] and not "Temporada" in item_local.title: + if "al" in item_local.title: #Si son episodios múltiples, ponemos nombre de serie + item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) + item_local.infoLabels['episodio_titulo'] = '%s - %s' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName) + else: + item_local.title = '%s %s' % (item_local.title, item_local.infoLabels['episodio_titulo']) + if item_local.infoLabels['year']: + item_local.infoLabels['episodio_titulo'] = '%s [%s]' % (item_local.infoLabels['episodio_titulo'], item_local.infoLabels['year']) + if rating: + item_local.infoLabels['episodio_titulo'] = '%s [%s]' % (item_local.infoLabels['episodio_titulo'], rating) + else: + item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) + if "Temporada" in item_local.title: + item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(item_local.title, r'(Temporada \d+ Completa)'), item_local.contentSerieName, item_local.infoLabels['year'], rating) + else: + item_local.infoLabels['episodio_titulo'] = '%s [%s] [%s]' % (item_local.contentSerieName, item_local.infoLabels['year'], rating) + item_local.infoLabels['title'] = item_local.infoLabels['episodio_titulo'] + + item_local.title = '%s [%s] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.title, item_local.infoLabels['year'], rating, item_local.quality, str(item_local.language)) + + #Quitamos campos vacíos + item_local.infoLabels['episodio_titulo'] = item_local.infoLabels['episodio_titulo'].replace(" []", "").strip() + item_local.title = item_local.title.replace(" []", "").strip() + item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title).strip() + item_local.title = re.sub(r'\s\[COLOR \w+\]-\[\/COLOR\]', '', item_local.title).strip() + #logger.debug(str(num_episodios) + " / " + str(item_local.contentEpisodeNumber) + " / " + str(item_local.infoLabels['temporada_num_episodios']) + str(num_episodios_lista)) + if num_episodios < item_local.contentEpisodeNumber: + num_episodios = item_local.contentEpisodeNumber + 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] + + #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] + + if config.get_videolibrary_support() and len(itemlist) > 0: + title = '' + if item_local.infoLabels['temporada_num_episodios']: + title = ' [Temp. de %s ep.]' % item_local.infoLabels['temporada_num_episodios'] + + if item_local.quality: #La Videoteca no toma la calidad del episodio, sino de la serie. Pongo del episodio + item.quality = item_local.quality + + if item.action == 'get_seasons': #si es actualización de videoteca, título estándar + #Si hay una nueva Temporada, se activa como la actual + if item.library_urls[item.channel] != item.url and (item.contentType == "season" or modo_ultima_temp): + item.library_urls[item.channel] = item.url #Se actualiza la url apuntando a la última Temporada + try: + from core import videolibrarytools #Se fuerza la actualización de la url en el .nfo + itemlist_fake = [] #Se crea un Itemlist vacio para actualizar solo el .nfo + videolibrarytools.save_tvshow(item, itemlist_fake) #Se actualiza el .nfo + except: + logger.error("ERROR 08: EPISODIOS: No se ha podido actualizar la URL a la nueva Temporada") + itemlist.append(item.clone(title="[COLOR yellow]Añadir esta Serie a la Videoteca[/COLOR]" + title, action="add_serie_to_library")) + + elif modo_serie_temp == 1: #si es Serie damos la opción de guardar la última temporada o la serie completa + itemlist.append(item.clone(title="[COLOR yellow]Añadir última Temp. a Videoteca[/COLOR]" + title, action="add_serie_to_library", contentType="season", contentSeason=contentSeason, url=item_local.url)) + itemlist.append(item.clone(title="[COLOR yellow]Añadir esta Serie a Videoteca[/COLOR]" + title, action="add_serie_to_library", contentType="tvshow")) + + else: #si no, damos la opción de guardar la temporada actual o la serie completa + itemlist.append(item.clone(title="[COLOR yellow]Añadir esta Serie a Videoteca[/COLOR]" + title, action="add_serie_to_library", contentType="tvshow")) + item.contentSeason = contentSeason + itemlist.append(item.clone(title="[COLOR yellow]Añadir esta Temp. a Videoteca[/COLOR]" + title, action="add_serie_to_library", contentType="season", contentSeason=contentSeason)) + + return itemlist + + +def search(item, texto): + logger.info("texto:" + texto) + texto = texto.replace(" ", "+") + itemlist = [] + + item.url = "%s?s=%s" % (item.url, texto) + item.media = "search" #Marcar para "Listado": igual comportamiento que "Categorías" + + try: + if "series/" in item.url: + item.extra = "series" + item.title = "Series" + else: + item.extra = "peliculas" + item.title = "Películas" + + itemlist = listado(item) + + return itemlist + + # Se captura la excepción, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("ERROR: %s: SEARCH" % line) + return [] diff --git a/plugin.video.alfa/channels/hdfull.py b/plugin.video.alfa/channels/hdfull.py index 78c605b5..10982992 100644 --- a/plugin.video.alfa/channels/hdfull.py +++ b/plugin.video.alfa/channels/hdfull.py @@ -349,11 +349,16 @@ def fichas(item): bus = host[-4:] tag_type = scrapertools.find_single_match(url, '%s/([^/]+)/' %bus) title += " - [COLOR blue]" + tag_type.capitalize() + "[/COLOR]" - - itemlist.append( - Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail, - show=show, folder=True, contentType=contentType, contentTitle=contentTitle, - language =language, infoLabels=infoLabels)) + if "/serie" in url or "/tags-tv" in url: + itemlist.append( + Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail, + contentSerieName=show, folder=True, contentType=contentType, + language =language, infoLabels=infoLabels)) + else: + itemlist.append( + Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail, + folder=True, contentType=contentType, contentTitle=contentTitle, + language =language, infoLabels=infoLabels)) ## Paginación next_page_url = scrapertools.find_single_match(data, '.raquo;') if next_page_url != "": @@ -389,50 +394,41 @@ def episodios(item): str = get_status(status, "shows", id) if str != "" and account and item.category != "Series" and "XBMC" not in item.title: if config.get_videolibrary_support(): - title = " ( [COLOR gray][B]" + item.show + "[/B][/COLOR] )" + title = " ( [COLOR gray][B]" + item.contentSerieName + "[/B][/COLOR] )" itemlist.append( - Item(channel=item.channel, action="episodios", title=title, fulltitle=title, url=url_targets, - thumbnail=item.thumbnail, show=item.show, folder=False)) + Item(channel=item.channel, action="episodios", title=title, url=url_targets, + thumbnail=item.thumbnail, contentSerieName=item.contentSerieName, folder=False)) title = str.replace('green', 'red').replace('Siguiendo', 'Abandonar') - itemlist.append(Item(channel=item.channel, action="set_status", title=title, fulltitle=title, url=url_targets, - thumbnail=item.thumbnail, show=item.show, folder=True)) + itemlist.append(Item(channel=item.channel, action="set_status", title=title, url=url_targets, + thumbnail=item.thumbnail, contentSerieName=item.contentSerieName, folder=True)) elif account and item.category != "Series" and "XBMC" not in item.title: if config.get_videolibrary_support(): title = " ( [COLOR gray][B]" + item.show + "[/B][/COLOR] )" itemlist.append( - Item(channel=item.channel, action="episodios", title=title, fulltitle=title, url=url_targets, - thumbnail=item.thumbnail, show=item.show, folder=False)) + Item(channel=item.channel, action="episodios", title=title, url=url_targets, + thumbnail=item.thumbnail, contentSerieName=item.contentSerieName, folder=False)) title = " ( [COLOR orange][B]Seguir[/B][/COLOR] )" - itemlist.append(Item(channel=item.channel, action="set_status", title=title, fulltitle=title, url=url_targets, - thumbnail=item.thumbnail, show=item.show, folder=True)) - + itemlist.append(Item(channel=item.channel, action="set_status", title=title, url=url_targets, + thumbnail=item.thumbnail, contentSerieName=item.contentSerieName, folder=True)) patron = "
  • [^<]+
  • " - matches = re.compile(patron, re.DOTALL).findall(data) - for scrapedurl in matches: - + if "temporada-0" in scrapedurl: + continue ## Episodios data = agrupa_datos(httptools.downloadpage(scrapedurl).data) - sid = scrapertools.get_match(data, "
    ' + + patron = '
  • \d<\/span><\/span>([^<]+)<\/span>' + check = re.compile(patron, re.DOTALL).findall(data) + if not check: + patron = '
  • ' + check = re.compile(patron, re.DOTALL).findall(data) + for i, valor in enumerate(check): + check[i] = [valor, '', ''] + + patron = '
    (.*?)
    ' matches = re.compile(patron, re.DOTALL).findall(data) - if len(matches) == 0: - patron = '
    ' - matches = re.compile(patron, re.DOTALL).findall(data) - for check_tab, server, id in matches: - if check_tab in str(check): - idioma, calidad = scrapertools.find_single_match(str(check), "" + check_tab + "', '(.*?)', '(.*?)'") - servers_data_list.append([server, id, idioma, calidad]) - url = host + "/Js/videod.js" - data = httptools.downloadpage(url).data - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - data = data.replace('