diff --git a/plugin.video.alfa/channels/peliculasnu.py b/plugin.video.alfa/channels/peliculasnu.py index e829b664..edfe851f 100644 --- a/plugin.video.alfa/channels/peliculasnu.py +++ b/plugin.video.alfa/channels/peliculasnu.py @@ -89,7 +89,7 @@ def newest(categoria): except: import sys for line in sys.exc_info(): - logger.error("{0}".format(line)) + logger.error("%s" % line) return [] return itemlist @@ -215,14 +215,14 @@ def findvideos(item): url = url + '|' + item.url title = "%s - %s" % ('%s', title) - itemlist.append(Item (channel=item.channel, action="play", url=url, title=title, text_color=color3)) + itemlist.append(Item(channel=item.channel, action="play", url=url, title=title, text_color=color3)) itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) if item.extra != "findvideos" and config.get_videolibrary_support(): - itemlist.append(Item (channel=item.channel, title="Añadir película a la videoteca", \ - action="add_pelicula_to_library", - extra="findvideos", text_color="green")) + itemlist.append( + item.clone(title="Añadir película a la videoteca", action="add_pelicula_to_library", extra="findvideos", + text_color="green")) return itemlist diff --git a/plugin.video.alfa/channels/pelis24.json b/plugin.video.alfa/channels/pelis24.json index fd53d735..d20e28c6 100755 --- a/plugin.video.alfa/channels/pelis24.json +++ b/plugin.video.alfa/channels/pelis24.json @@ -1,7 +1,7 @@ { "id": "pelis24", "name": "Pelis24", - "active": true, + "active": false, "adult": false, "language": "es", "thumbnail": "pelis24.png", @@ -49,4 +49,4 @@ "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/peliscity.py b/plugin.video.alfa/channels/peliscity.py index daa198c0..78a924df 100755 --- a/plugin.video.alfa/channels/peliscity.py +++ b/plugin.video.alfa/channels/peliscity.py @@ -1,27 +1,38 @@ # -*- coding: utf-8 -*- import re -import urlparse +from core import httptools from core import scrapertools from core import servertools from core.item import Item -from platformcode import logger +from platformcode import config, logger +host = "http://peliscity.com" def mainlist(item): logger.info() - itemlist = [] + + data = httptools.downloadpage(host).data + patron = 'cat-item.*?span>([^<]+)' + matches = scrapertools.find_multiple_matches(data, patron) + can = 0 + for cantidad in matches: + can += int(cantidad.replace(".", "")) + + itemlist.append( - Item(channel=item.channel, title="Últimas agregadas", action="agregadas", url="http://peliscity.com", + Item(channel=item.channel, title="Películas: (%s)" %can, text_bold=True)) + itemlist.append( + Item(channel=item.channel, title=" Últimas agregadas", action="agregadas", url= host, viewmode="movie_with_plot")) - itemlist.append(Item(channel=item.channel, title="Peliculas HD", action="agregadas", - url="http://peliscity.com/calidad/hd-real-720", viewmode="movie_with_plot")) + itemlist.append(Item(channel=item.channel, title=" Peliculas HD", action="agregadas", + url= host + "/calidad/hd-real-720", viewmode="movie_with_plot")) itemlist.append( - Item(channel=item.channel, title="Listado por género", action="porGenero", url="http://peliscity.com")) - itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url="http://peliscity.com/?s=")) - itemlist.append(Item(channel=item.channel, title="Idioma", action="porIdioma", url="http://peliscity.com/")) + Item(channel=item.channel, title=" Listado por género", action="porGenero", url= host)) + itemlist.append(Item(channel=item.channel, title=" Buscar", action="search", url= host + "/?s=")) + itemlist.append(Item(channel=item.channel, title=" Idioma", action="porIdioma", url= host)) return itemlist @@ -29,12 +40,12 @@ def mainlist(item): def porIdioma(item): itemlist = [] itemlist.append(Item(channel=item.channel, title="Castellano", action="agregadas", - url="http://www.peliscity.com/idioma/espanol-castellano/", viewmode="movie_with_plot")) + url= host + "/idioma/espanol-castellano/", viewmode="movie_with_plot")) itemlist.append( - Item(channel=item.channel, title="VOS", action="agregadas", url="http://www.peliscity.com/idioma/subtitulada/", + Item(channel=item.channel, title="VOS", action="agregadas", url= host + "/idioma/subtitulada/", viewmode="movie_with_plot")) itemlist.append(Item(channel=item.channel, title="Latino", action="agregadas", - url="http://www.peliscity.com/idioma/espanol-latino/", viewmode="movie_with_plot")) + url= host + "/idioma/espanol-latino/", viewmode="movie_with_plot")) return itemlist @@ -43,15 +54,16 @@ def porGenero(item): logger.info() itemlist = [] - data = scrapertools.cache_page(item.url) + data = httptools.downloadpage(item.url).data - logger.info("data=" + data) - patron = 'cat-item.*?href="([^"]+).*?>(.*?)<' + patron = 'cat-item.*?href="([^"]+).*?>(.*?)<.*?span>([^<]+)' matches = re.compile(patron, re.DOTALL).findall(data) - for urlgen, genero in matches: - itemlist.append(Item(channel=item.channel, action="agregadas", title=genero, url=urlgen, folder=True, + for urlgen, genero, cantidad in matches: + cantidad = cantidad.replace(".", "") + titulo = genero + " (" + cantidad + ")" + itemlist.append(Item(channel=item.channel, action="agregadas", title=titulo, url=urlgen, folder=True, viewmode="movie_with_plot")) return itemlist @@ -60,7 +72,7 @@ def porGenero(item): def search(item, texto): logger.info() texto_post = texto.replace(" ", "+") - item.url = "http://www.peliscity.com/?s=" + texto_post + item.url = host + "/?s=" + texto_post try: return listaBuscar(item) @@ -76,7 +88,7 @@ def agregadas(item): logger.info() itemlist = [] - data = scrapertools.cache_page(item.url) + data = httptools.downloadpage(item.url).data data = re.sub(r'\n|\r|\t|\s{2}| |"', "", data) patron = scrapertools.find_multiple_matches (data,'.*?Duración') @@ -92,10 +104,18 @@ def agregadas(item): plot = info[4] year = info[5].strip() - itemlist.append(Item(channel=item.channel, title=title, url=url, action='findvideos',thumbnail=thumbnail, + itemlist.append(Item(channel=item.channel, + action='findvideos', + contentType = "movie", + fulltitle = title, + infoLabels={'year':year}, plot=plot, - quality=quality, infoLabels={'year':year})) - + quality=quality, + thumbnail=thumbnail, + title=title, + contentTitle = title, + url=url + )) # Paginación try: next_page = scrapertools.find_single_match(data,'tima>.*?href=(.*?) >(.*?)<.*?width.*?class="q">(.*?)> Página siguiente": @@ -80,9 +70,9 @@ def newest(categoria): item = Item() try: if categoria == 'peliculas': - item.url = HOST + "/ultimas-y-actualizadas" + item.url = HOST elif categoria == 'infantiles': - item.url = HOST + "/search/?q=&genre%5B%5D=animation" + item.url = HOST + "/genre/16/" else: return [] @@ -103,59 +93,46 @@ def newest(categoria): def peliculas(item): logger.info() itemlist = [] - url_next_page = "" data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - patron = '
30: - url_next_page = item.url - matches = matches[:30] - next_page = 'b' - else: - matches = matches[30:] - next_page = 'a' - patron_next_page = 'Anteriores 0: - url_next_page = matches_next_page[0] - - for scrapedurl, scrapedthumbnail, idiomas, year, scrapedtitle in matches: - patronidiomas = " 0: + url_next_page = item.url + matches_next_page + for scrapedurl, scrapedthumbnail, year, idiomas, scrapedtitle in matches: + year = year.strip() + patronidiomas = '' - data = scrapertoolsV2.get_match(data, patron) - + patron = 'Generos.*?' + data = scrapertools.find_single_match(data, patron) # Extrae las entradas - patron = "" - matches = re.compile(patron, re.DOTALL).findall(data) - - itemlist = [] - for scrapedvalue, scrapedtitle in matches: - thumbnail = "" - - if item.extra == 'genre': - if scrapedtitle.strip() in ['Documental', 'Short', 'News']: - continue - - url = HOST + "/search/?q=&genre%5B%5D=" + scrapedvalue - filename = scrapedtitle.lower().replace(' ', '%20') - if filename == "ciencia%20ficción": - filename = "ciencia%20ficcion" - thumbnail = "https://raw.githubusercontent.com/master-1970/resources/master/images/genres/4/verdes/%s.png" \ - % filename - - elif item.extra == 'year': - url = HOST + "/search/?q=&year=" + scrapedvalue - thumbnail = item.thumbnail - else: - # http://www.yaske.ro/search/?q=&quality%5B%5D=c9 - # http://www.yaske.ro/search/?q=&audio%5B%5D=es - url = HOST + "/search/?q=&" + item.extra + "%5B%5D=" + scrapedvalue - thumbnail = item.thumbnail - - itemlist.append(Item(channel=item.channel, action="peliculas", title=scrapedtitle, url=url, text_color=color1, - thumbnail=thumbnail, contentType='movie', folder=True, viewmode="movie_with_plot")) + patron = 'href="([^"]+)">([^<]+)' + matches = scrapertools.find_multiple_matches(data, patron) + for scrapedurl, scrapedtitle in matches: + url = HOST + scrapedurl + itemlist.append(Item(channel = item.channel, + action = "peliculas", + title = scrapedtitle, + url = url, + text_color = color1, + contentType = 'movie', + folder = True, + viewmode = "movie_with_plot" + )) if item.extra in ['genre', 'audio', 'year']: return sorted(itemlist, key=lambda i: i.title.lower(), reverse=item.extra == 'year') @@ -214,29 +175,28 @@ def menu_buscar_contenido(item): def findvideos(item): logger.info() - itemlist = list() - sublist = list() + itemlist = [] + sublist = [] # Descarga la página - data = httptools.downloadpage(item.url).data - + url = "http://widget.olimpo.link/playlist/?tmdb=" + scrapertools.find_single_match(item.url, 'yaske.ro/([0-9]+)') + data = httptools.downloadpage(url).data if not item.plot: item.plot = scrapertoolsV2.find_single_match(data, '>Sinopsis
([^<]+)
') item.plot = scrapertoolsV2.decodeHtmlentities(item.plot) - patron = '