diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index db15e620..4bccd512 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@  - + @@ -19,12 +19,11 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - » divxatope » torrentlocura - » peliculasrey » pelismundo - » gvideo » kingvid - » mailru » vidlox - » thevideome » bitp - ¤ fix internos + » pedropolis » cinecalidad + » openload » cloudy + » uptobox ¤ arreglos internos + + [COLOR green]Gracias a [COLOR yellow]msdos[/COLOR] y [COLOR yellow]prpeaprendiz[/COLOR] por su colaboración en esta versión[/COLOR] Navega con Kodi por páginas web para ver sus videos de manera fácil. Browse web pages using Kodi diff --git a/plugin.video.alfa/channels/cinecalidad.py b/plugin.video.alfa/channels/cinecalidad.py index c968bcc5..f2b44121 100644 --- a/plugin.video.alfa/channels/cinecalidad.py +++ b/plugin.video.alfa/channels/cinecalidad.py @@ -298,7 +298,7 @@ def findvideos(item): if server_id in server_url: server = server_id.lower() - thumbnail = servertools.guess_server_thumbnail(server_id) + thumbnail = item.contentThumbnail if server_id == 'TVM': server = 'thevideo.me' url = server_url[server_id] + video_id + '.html' @@ -367,7 +367,7 @@ def play(item): for videoitem in itemlist: videoitem.title = item.fulltitle videoitem.fulltitle = item.fulltitle - videoitem.thumbnail = item.extra + videoitem.thumbnail = item.contentThumbnail videoitem.channel = item.channel else: itemlist.append(item) @@ -463,3 +463,4 @@ def search(item, texto): for line in sys.exc_info(): logger.error("%s" % line) return [] + diff --git a/plugin.video.alfa/channels/doomtv.json b/plugin.video.alfa/channels/doomtv.json index 7e45d32d..f51eb8e8 100755 --- a/plugin.video.alfa/channels/doomtv.json +++ b/plugin.video.alfa/channels/doomtv.json @@ -10,31 +10,10 @@ "thumbnail": "https://s2.postimg.org/jivgi4ak9/doomtv.png", "banner": "https://s32.postimg.org/6gxyripvp/doomtv_banner.png", "version": 1, - "changes": [ - { - "date": "24/06/2017", - "description": "Cambios para autoplay" - }, - { - "date": "06/06/2017", - "description": "COmpatibilida con AutoPlay" - }, - { - "date": "12/05/2017", - "description": "Fix generos y enlaces" - }, - { - "date": "15/03/2017", - "description": "limpieza código" - }, - { - "date": "01/02/2017", - "description": "Release." - } - ], "categories": [ "latino", - "movie" + "movie", + "direct" ], "settings": [ { diff --git a/plugin.video.alfa/channels/doomtv.py b/plugin.video.alfa/channels/doomtv.py old mode 100755 new mode 100644 index 35df32a3..0ab1fe6e --- a/plugin.video.alfa/channels/doomtv.py +++ b/plugin.video.alfa/channels/doomtv.py @@ -18,7 +18,7 @@ list_language = IDIOMAS.values() CALIDADES = {'1080p': '1080p', '720p': '720p', '480p': '480p', '360p': '360p'} list_quality = CALIDADES.values() -list_servers = ['directo'] +list_servers = ['directo', 'openload'] host = 'http://doomtv.net/' headers = { @@ -32,10 +32,10 @@ tgenero = {"Comedia": "https://s7.postimg.org/ne9g9zgwb/comedia.png", "Aventura": "https://s10.postimg.org/6su40czih/aventura.png", "Romance": "https://s15.postimg.org/fb5j8cl63/romance.png", "Animación": "https://s13.postimg.org/5on877l87/animacion.png", - "Ciencia Ficción": "https://s9.postimg.org/diu70s7j3/cienciaficcion.png", + "Ciencia ficción": "https://s9.postimg.org/diu70s7j3/cienciaficcion.png", "Terror": "https://s7.postimg.org/yi0gij3gb/terror.png", - "Documentales": "https://s16.postimg.org/7xjj4bmol/documental.png", - "Musical": "https://s29.postimg.org/bbxmdh9c7/musical.png", + "Documental": "https://s16.postimg.org/7xjj4bmol/documental.png", + "Música": "https://s29.postimg.org/bbxmdh9c7/musical.png", "Fantasía": "https://s13.postimg.org/65ylohgvb/fantasia.png", "Bélico Guerra": "https://s23.postimg.org/71itp9hcr/belica.png", "Misterio": "https://s1.postimg.org/w7fdgf2vj/misterio.png", @@ -56,7 +56,6 @@ tgenero = {"Comedia": "https://s7.postimg.org/ne9g9zgwb/comedia.png", def mainlist(item): logger.info() - autoplay.init(item.channel, list_servers, list_quality) itemlist = [] itemlist.append( @@ -64,7 +63,7 @@ def mainlist(item): action="lista", thumbnail='https://s18.postimg.org/fwvaeo6qh/todas.png', fanart='https://s18.postimg.org/fwvaeo6qh/todas.png', - url=host + url='%s%s'%(host,'peliculas/page/1') )) itemlist.append( @@ -72,34 +71,15 @@ def mainlist(item): action="seccion", thumbnail='https://s3.postimg.org/5s9jg2wtf/generos.png', fanart='https://s3.postimg.org/5s9jg2wtf/generos.png', - url=host, - extra='generos' + url='%s%s' % (host, 'peliculas/page/1'), )) itemlist.append( - item.clone(title="Mas vistas", - action="seccion", + item.clone(title="Mas Vistas", + action="lista", thumbnail='https://s9.postimg.org/wmhzu9d7z/vistas.png', fanart='https://s9.postimg.org/wmhzu9d7z/vistas.png', - url=host, - extra='masvistas' - )) - - itemlist.append( - item.clone(title="Recomendadas", - action="lista", - thumbnail='https://s12.postimg.org/s881laywd/recomendadas.png', - fanart='https://s12.postimg.org/s881laywd/recomendadas.png', - url=host, - extra='recomendadas' - )) - - itemlist.append( - item.clone(title="Por año", - action="seccion", - thumbnail='https://s8.postimg.org/7eoedwfg5/pora_o.png', - fanart='https://s8.postimg.org/7eoedwfg5/pora_o.png', - url=host, extra='poraño' + url='%s%s'%(host,'top-imdb/page/1'), )) itemlist.append( @@ -110,8 +90,6 @@ def mainlist(item): fanart='https://s30.postimg.org/pei7txpa9/buscar.png' )) - autoplay.show_option(item.channel, itemlist) - return itemlist @@ -123,23 +101,11 @@ def lista(item): next_page_url = '' data = httptools.downloadpage(item.url).data + data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) + + patron = 'movie-id=.*?href=(.*?) data-url.*?quality>(.*?)' + patron += '(.*?)<\/h2>.*?

(.*?)<\/p>' - if item.extra == 'recomendadas': - patron = '.*?' - patron += '

.*?' - patron += '(.*?)(?:–.*?|\(.*?|–| 0: - next_page_url = urlparse.urljoin(item.url, matches_next_page[0]) + next_page_str = scrapertools.find_single_match(data,"
  • (\d+)") + next_page_num = int(next_page_str)+1 + page_base = re.sub(r'(page\/\d+)','', item.url) + next_page_url = '%s%s%s'%(page_base,'page/',next_page_num) - for scrapedthumbnail, scrapedtitle, scrapedurl, scrapedyear in matches: - if item.extra == 'recomendadas': - url = scrapedthumbnail - title = scrapedurl - thumbnail = scrapedtitle - else: - url = scrapedurl - thumbnail = scrapedthumbnail - title = scrapedtitle - year = scrapedyear + if next_page_url: + next_page_url = next_page_url + + for scrapedurl, quality, scrapedthumbnail, scrapedtitle, plot in matches: + + url = scrapedurl + thumbnail = scrapedthumbnail + filtro_thumb = scrapedthumbnail.replace("https://image.tmdb.org/t/p/w185", "") + filtro_list = {"poster_path": filtro_thumb.strip()} + filtro_list = filtro_list.items() + title = scrapedtitle fanart = '' - plot = '' - - if 'serie' not in url: - itemlist.append( - Item(channel=item.channel, - action='findvideos', - title=title, - url=url, - thumbnail=thumbnail, - plot=plot, - fanart=fanart, - contentTitle=title, - infoLabels={'year': year}, - context=autoplay.context - )) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + plot = plot + itemlist.append( + Item(channel=item.channel, + action='findvideos', + title=title, + url=url, + thumbnail=thumbnail, + plot=plot, + infoLabels={'filtro': filtro_list}, + fanart=fanart, + contentTitle=title + )) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb = True) # Paginacion if next_page_url != '': itemlist.append( @@ -203,17 +166,8 @@ def seccion(item): itemlist = [] duplicado = [] data = httptools.downloadpage(item.url).data - - if item.extra == 'generos': - data = re.sub(r'"|\n|\r|\t| |
    |\s{2,}', "", data) - accion = 'lista' - if item.extra == 'masvistas': - patron = '\d*<\/b>\s*(.*?<\/a>\s*.*?<\/span>\s*.*?<\/i><\/li>)' - accion = 'findvideos' - elif item.extra == 'poraño': - patron = '
  • (.*?)<\/a><\/li>' - else: - patron = '
  • (.*?)<\/i>' + data = re.sub(r'"|\n|\r|\t| |
    |\s{2,}', "", data) + patron = 'menu-item-object-category menu-item-\d+>
    (.*?)<\/a><\/li>' matches = re.compile(patron, re.DOTALL).findall(data) @@ -221,61 +175,19 @@ def seccion(item): url = scrapedurl title = scrapedtitle thumbnail = '' - fanart = '' - plot = '' - year = '' - contentTitle = '' - if item.extra == 'masvistas': - year = re.findall(r'\b\d{4}\b', scrapedtitle) - title = re.sub(r'<\/a>\s*.*?<\/span>\s*.*?<\/i><\/li>', '', scrapedtitle) - contentTitle = title - title = title + ' (' + year[0] + ')' - - elif item.extra == 'generos': - title = re.sub(r'<\/a> \d+', '', scrapedtitle) - cantidad = re.findall(r'.*?<\/a> (\d+)', scrapedtitle) - th_title = title - title = title + ' (' + cantidad[0] + ')' - thumbnail = tgenero[th_title] - fanart = thumbnail - + if title in tgenero: + thumbnail = tgenero[title] if url not in duplicado: itemlist.append( Item(channel=item.channel, - action=accion, + action='lista', title=title, url=url, - thumbnail=thumbnail, - plot=plot, - fanart=fanart, - contentTitle=contentTitle, - infoLabels={'year': year} + thumbnail = thumbnail )) - duplicado.append(url) - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist -def unpack(packed): - p, c, k = re.search("}\('(.*)', *\d+, *(\d+), *'(.*)'\.", packed, re.DOTALL).groups() - for c in reversed(range(int(c))): - if k.split('|')[c]: p = re.sub(r'(\b%s\b)' % c, k.split('|')[c], p) - p = p.replace('\\', '') - p = p.decode('string_escape') - return p - - -def getinfo(page_url): - info = () - logger.info() - data = httptools.downloadpage(page_url).data - thumbnail = scrapertools.find_single_match(data, '
    .*?(eval\(function\(p,a,c,k.*?\)\)\))") - if packed: - unpacked = unpack(packed) - video_urls = [] - if "vimeocdn" in unpacked: - - streams = scrapertools.find_multiple_matches(unpacked, - "{file:'(.*?)',type:'video/.*?',label:'(.*?)'") - for video_url, quality in streams: - video_urls.append([video_url, quality]) - else: - doc_id = scrapertools.find_single_match(unpacked, 'driveid=(.*?)&') - doc_url = "http://docs.google.com/get_video_info?docid=%s" % doc_id - response = httptools.downloadpage(doc_url, cookies=False) - cookies = "" - cookie = response.headers["set-cookie"].split("HttpOnly, ") - for c in cookie: - cookies += c.split(";", 1)[0] + "; " - - data = response.data.decode('unicode-escape') - data = urllib.unquote_plus(urllib.unquote_plus(data)) - headers_string = "|Cookie=" + cookies - - url_streams = scrapertools.find_single_match(data, 'url_encoded_fmt_stream_map=(.*)') - streams = scrapertools.find_multiple_matches(url_streams, - 'itag=(\d+)&url=(.*?)(?:;.*?quality=.*?(?:,|&)|&quality=.*?(?:,|&))') - - itags = {'18': '360p', '22': '720p', '34': '360p', '35': '480p', '37': '1080p', '59': '480p'} - for itag, video_url in streams: - video_url += headers_string - video_urls.append([video_url, itags[itag]]) - - for video_item in video_urls: - calidad = video_item[1] - title = '%s [%s]' % (item.contentTitle, calidad) - url = video_item[0] - - if url not in duplicado: - itemlist.append( - Item(channel=item.channel, - action='play', - title=title, - url=url, - thumbnail=item.thumbnail, - plot=item.plot, - fanart=item.fanart, - contentTitle=item.contentTitle, - language=IDIOMAS['latino'], - server='directo', - quality=CALIDADES[calidad], - context=item.context - )) - duplicado.append(url) - else: - itemlist.extend(servertools.find_video_items(data=option)) - - for videoitem in itemlist: - - if 'Enlace' in videoitem.title: - videoitem.channel = item.channel - videoitem.title = item.contentTitle + ' (' + videoitem.server + ')' - videoitem.language = 'latino' - videoitem.quality = 'default' - return itemlist - - def findvideos(item): logger.info() itemlist = [] - itemlist = get_url(item) + #itemlist = get_url(item) + data = httptools.downloadpage(item.url).data + data = re.sub(r'"|\n|\r|\t| |
    |\s{2,}', "", data) + patron = 'id=(tab\d+)>
    <(?:iframe|script) src=(.*?)(?:scrolling|><\/script>)' + matches = re.compile(patron, re.DOTALL).findall(data) - # Requerido para FilterTools + for option, urls in matches: + quality = scrapertools.find_single_match(data, '
    (.*?)<\/a><\/div>'%option) + title = '%s (%s)' % (item.title, quality) + if 'content' in urls: + urls = '%s%s'%('http:',urls) + hidden_data = httptools.downloadpage(urls).data + hidden_data = re.sub(r'"|\n|\r|\t| |
    |\s{2,}', "", hidden_data) + patron = 'sources: \[{file: (.*?),' + matches = re.compile(patron, re.DOTALL).findall(hidden_data) - itemlist = filtertools.get_links(itemlist, item, list_language) + for videoitem in matches: - # Requerido para AutoPlay - - autoplay.start(itemlist, item) + new_item = Item( + channel = item.channel, + url = videoitem, + title = title, + contentTitle = item.title, + action = 'play', + quality = quality + ) + itemlist.append(new_item) + else: + new_item = Item( + channel=item.channel, + url=urls, + title=title, + contentTitle=item.title, + action='play', + quality = quality + ) + itemlist.append(new_item) + itemlist = servertools.get_servers_itemlist(itemlist) if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': itemlist.append( diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index b0a9b36f..009ea8c6 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -412,8 +412,6 @@ def episodios(item): season = match['season'] episode = match['episode'] - infoLabels['season']= season - infoLabels['episode'] = episode itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumb, quality=item.quality, multi=multi, contentSeason=season, contentEpisodeNumber=episode, infoLabels = infoLabels)) @@ -421,8 +419,12 @@ def episodios(item): # order list tmdb.set_infoLabels_itemlist(itemlist, seekTmdb = True) if len(itemlist) > 1: - return sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + if config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append( + item.clone(title="Añadir esta serie a la videoteca", action="add_serie_to_library", extra="episodios")) + return itemlist def search(item, texto): diff --git a/plugin.video.alfa/channels/pedropolis.json b/plugin.video.alfa/channels/pedropolis.json new file mode 100644 index 00000000..23a8450d --- /dev/null +++ b/plugin.video.alfa/channels/pedropolis.json @@ -0,0 +1,73 @@ +{ + "id": "pedropolis", + "name": "PedroPolis", + "active": true, + "adult": false, + "language": "es", + "fanart": "https://scontent-lht6-1.xx.fbcdn.net/v/t31.0-8/21056316_670362456502498_8317422545691005578_o.png?oh=1f13a23a931d82e944a7ec743a19f583&oe=5A599F4D", + "thumbnail": "https://scontent-lht6-1.xx.fbcdn.net/v/t1.0-9/20292600_467501756957771_6794721577753226614_n.jpg?oh=bba1479eccf0adceeb8c0d3450cc2531&oe=5A4EE0F5", + "banner": "", + "version": 1, + "changes": [ + { + "date": "15/08/17", + "description": "Nuevo Canal" + } + ], + "categories": [ + "latino", + "movie", + "tvshow", + "vos" + ], + "settings": [ + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 3, + "enabled": true, + "visible": true, + "lvalues": [ + "Sin color", + "Perfil 5", + "Perfil 4", + "Perfil 3", + "Perfil 2", + "Perfil 1" + ] + }, + { + "id": "orden_episodios", + "type": "bool", + "label": "Mostrar los episodios de las series en orden descendente", + "default": false, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Peliculas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/pedropolis.py b/plugin.video.alfa/channels/pedropolis.py new file mode 100644 index 00000000..c5a01871 --- /dev/null +++ b/plugin.video.alfa/channels/pedropolis.py @@ -0,0 +1,464 @@ +# -*- coding: utf-8 -*- +# -*- Channel PedroPolis -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import sys +import urllib +import urlparse + +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from core import channeltools +from core import tmdb +from platformcode import config, logger +from channelselector import get_thumb + +__channel__ = "pedropolis" + +host = "http://pedropolis.com/" + +try: + __modo_grafico__ = config.get_setting('modo_grafico', __channel__) + __perfil__ = int(config.get_setting('perfil', __channel__)) +except: + __modo_grafico__ = True + __perfil__ = 0 + +# Fijar perfil de color +perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFFFFD700']] +if __perfil__ < 3: + color1, color2, color3, color4, color5 = perfil[__perfil__] +else: + color1 = color2 = color3 = color4 = color5 = "" + +headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'], + ['Referer', host]] + +parameters = channeltools.get_channel_parameters(__channel__) +fanart_host = parameters['fanart'] +thumbnail_host = parameters['thumbnail'] + + +def mainlist(item): + logger.info() + + itemlist = [item.clone(title="Peliculas", action="menumovies", text_blod=True, + viewcontent='movies', viewmode="movie_with_plot", thumbnail=get_thumb("channels_movie.png")), + + item.clone(title="Series", action="menuseries", text_blod=True, extra='serie', mediatype="tvshow", + viewcontent='tvshows', url=host + 'tvshows/', viewmode="movie_with_plot", + thumbnail=get_thumb("channels_tvshow.png")), + + item.clone(title="Buscar", action="search", text_blod=True, extra='buscar', + thumbnail=get_thumb('search.png'), url=host)] + + return itemlist + + +def menumovies(item): + logger.info() + itemlist = [item.clone(title="Todas", action="peliculas", text_blod=True, url=host + 'movies/', + viewcontent='movies', viewmode="movie_with_plot"), + + item.clone(title="Más Vistas", action="peliculas", text_blod=True, + viewcontent='movies', url=host + 'tendencias/?get=movies', viewmode="movie_with_plot"), + + item.clone(title="Más Valoradas", action="peliculas", text_blod=True, viewcontent='movies', + url=host + 'calificaciones/?get=movies', viewmode="movie_with_plot"), + + item.clone(title="Géneros", action="generos", text_blod=True, viewmode="movie_with_plot", + viewcontent='movies', url=host)] + + return itemlist + + +def menuseries(item): + logger.info() + itemlist = [item.clone(title="Todas", action="series", text_blod=True, extra='serie', mediatype="tvshow", + viewcontent='tvshows', url=host + 'tvshows/', viewmode="movie_with_plot"), + + item.clone(title="Más Vistas", action="series", text_blod=True, extra='serie', mediatype="tvshow", + viewcontent='tvshows', url=host + 'tendencias/?get=tv', viewmode="movie_with_plot"), + + item.clone(title="Mejor Valoradas", action="series", text_blod=True, extra='serie', mediatype="tvshow", + viewcontent='tvshows', url=host + 'calificaciones/?get=tv', viewmode="movie_with_plot")] + + return itemlist + + +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 = '
    ([^.*?' # img, title + patron += '
    ([^<]+).*?' # rating + patron += '([^<]+).*?' # calidad, url + patron += '([^<]+)' # year + + matches = scrapertools.find_multiple_matches(data, patron) + + # Paginación + if item.next_page != 'b': + if len(matches) > 19: + url_next_page = item.url + matches = matches[:19] + next_page = 'b' + else: + matches = matches[19:] + next_page = 'a' + patron_next_page = "\d+ 0: + url_next_page = urlparse.urljoin(item.url, matches_next_page[0]) + + for scrapedthumbnail, scrapedtitle, rating, calidad, scrapedurl, year in matches: + if 'Proximamente' not in calidad: + scrapedtitle = scrapedtitle.replace('Ver ', '').partition(' /')[0].partition(':')[0].replace( + 'Español Latino', '').strip() + title = "%s [COLOR green][%s][/COLOR] [COLOR yellow][%s][/COLOR]" % (scrapedtitle, year, calidad) + + new_item = Item(channel=__channel__, action="findvideos", contentTitle=scrapedtitle, + infoLabels={'year': year, 'rating': rating}, thumbnail=scrapedthumbnail, + url=scrapedurl, next_page=next_page, quality=calidad, title=title) + if year: + tmdb.set_infoLabels_item(new_item, __modo_grafico__) + itemlist.append(new_item) + + if url_next_page: + itemlist.append(Item(channel=__channel__, action="peliculas", title="» Siguiente »", + url=url_next_page, next_page=next_page, folder=True, text_blod=True, + thumbnail=get_thumb("next.png"))) + + for item in itemlist: + if item.infoLabels['plot'] == '': + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + # logger.info(data) + item.fanart = scrapertools.find_single_match(data, + "").replace( + 'w780', 'original') + item.plot = scrapertools.find_single_match(data, '
    .*?

    ([' + '^<]+)

    ') + item.plot = scrapertools.htmlclean(item.plot) + item.infoLabels['director'] = scrapertools.find_single_match(data, + '
    ([^<]+)') + item.infoLabels['rating'] = scrapertools.find_single_match(data, '([^<]+)') + item.infoLabels['votes'] = scrapertools.find_single_match(data, '[' + '^<]+\s(.*?) votos') + + return itemlist + + +def search(item, texto): + logger.info() + + texto = texto.replace(" ", "+") + item.url = urlparse.urljoin(item.url, "?s={0}".format(texto)) + + try: + return sub_search(item) + + # 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("{0}".format(line)) + return [] + + +def sub_search(item): + logger.info() + + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + + patron = '([^' # url, img, title + patron += '([^<]+).*?' # tipo + patron += '([^"]+).*?

    ([^<]+)

    ' # year, plot + + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumbnail, scrapedtitle, tipo, year, plot in matches: + title = scrapedtitle + if tipo == 'Serie': + contentType = 'tvshow' + action = 'temporadas' + title += ' [COLOR red](' + tipo + ')[/COLOR]' + else: + contentType = 'movie' + action = 'findvideos' + title += ' [COLOR green](' + tipo + ')[/COLOR]' + + itemlist.append(item.clone(title=title, url=scrapedurl, contentTitle=scrapedtitle, extra='buscar', + action=action, infoLabels={"year": year}, contentType=contentType, + thumbnail=scrapedthumbnail, text_color=color1, contentSerieName=scrapedtitle)) + + tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) + paginacion = scrapertools.find_single_match(data, '') + + if paginacion: + itemlist.append(Item(channel=item.channel, action="sub_search", + title="» Siguiente »", url=paginacion, thumbnail=get_thumb("next.png"))) + + return itemlist + + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + 'movies/' + elif categoria == 'infantiles': + item.url = host + "genre/animacion/" + else: + return [] + + itemlist = peliculas(item) + if itemlist[-1].title == "» Siguiente »": + itemlist.pop() + + # Se captura la excepción, para no interrumpir al canal novedades si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist + + +def generos(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + # logger.info(data) + data = scrapertools.find_single_match(data, 'Genero
    (.*?)
  • ", "", data) + # logger.info(data) + + patron = '
    ([^.*?' + + matches = scrapertools.find_multiple_matches(data, patron) + + if item.next_page != 'b': + if len(matches) > 19: + url_next_page = item.url + matches = matches[:19] + next_page = 'b' + else: + matches = matches[19:] + next_page = 'a' + patron_next_page = '' + matches_next_page = re.compile(patron_next_page, re.DOTALL).findall(data) + if len(matches_next_page) > 0: + url_next_page = urlparse.urljoin(item.url, matches_next_page[0]) + + for scrapedthumbnail, scrapedtitle, scrapedurl in matches: + scrapedtitle = scrapedtitle.replace('’', "'") + itemlist.append(Item(channel=__channel__, title=scrapedtitle, extra='serie', + url=scrapedurl, thumbnail=scrapedthumbnail, + contentSerieName=scrapedtitle, show=scrapedtitle, + next_page=next_page, action="temporadas", contentType='tvshow')) + + tmdb.set_infoLabels(itemlist, __modo_grafico__) + tmdb.set_infoLabels(itemlist, __modo_grafico__) + + if url_next_page: + itemlist.append(Item(channel=__channel__, action="series", title="» Siguiente »", url=url_next_page, + next_page=next_page, thumbnail=get_thumb("next.png"))) + + for item in itemlist: + if item.infoLabels['plot'] == '': + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + # logger.info(data) + item.fanart = scrapertools.find_single_match(data, + "").replace( + 'w780', 'original') + item.plot = scrapertools.find_single_match(data, '

    Sinopsis

    ' # capítulos + + matches = scrapertools.find_multiple_matches(data, patron) + if len(matches) > 1: + for scrapedseason, scrapedthumbnail in matches: + scrapedseason = " ".join(scrapedseason.split()) + temporada = scrapertools.find_single_match(scrapedseason, '(\d+)') + new_item = item.clone(action="episodios", season=temporada, thumbnail=scrapedthumbnail, extra='serie') + new_item.infoLabels['season'] = temporada + new_item.extra = "" + itemlist.append(new_item) + + tmdb.set_infoLabels(itemlist, __modo_grafico__) + for i in itemlist: + i.title = "%s. %s" % (i.infoLabels['season'], i.infoLabels['tvshowtitle']) + if i.infoLabels['title']: + # Si la temporada tiene nombre propio añadírselo al titulo del item + i.title += " - %s" % (i.infoLabels['title']) + if i.infoLabels.has_key('poster_path'): + # Si la temporada tiene poster propio remplazar al de la serie + i.thumbnail = i.infoLabels['poster_path'] + + itemlist.sort(key=lambda it: it.title) + + if config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append(Item(channel=__channel__, title="Añadir esta serie a la videoteca", url=item.url, + action="add_serie_to_library", extra="episodios", show=item.show, category="Series", + text_color=color1, thumbnail=get_thumb("videolibrary_tvshow.png"), fanart=fanart_host)) + + return itemlist + else: + return episodios(item) + + +def episodios(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + # logger.info(data) + patron = '
    .*?' # url cap, img + patron += '
    (.*?)
    .*?' # numerando cap + patron += '
    ([^<]+)' # title de episodios + + matches = scrapertools.find_multiple_matches(data, patron) + + for scrapedurl, scrapedtitle, scrapedname in matches: + scrapedtitle = scrapedtitle.replace('--', '0') + patron = '(\d+) - (\d+)' + match = re.compile(patron, re.DOTALL).findall(scrapedtitle) + season, episode = match[0] + + if 'season' in item.infoLabels and int(item.infoLabels['season']) != int(season): + continue + + title = "%sx%s: %s" % (season, episode.zfill(2), scrapertools.unescape(scrapedname)) + new_item = item.clone(title=title, url=scrapedurl, action="findvideos", text_color=color3, fulltitle=title, + contentType="episode", extra='serie') + if 'infoLabels' not in new_item: + new_item.infoLabels = {} + + new_item.infoLabels['season'] = season + new_item.infoLabels['episode'] = episode.zfill(2) + + itemlist.append(new_item) + tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) + + # TODO no hacer esto si estamos añadiendo a la videoteca + if not item.extra: + # Obtenemos los datos de todos los capítulos de la temporada mediante multihilos + tmdb.set_infoLabels(itemlist, __modo_grafico__) + for i in itemlist: + if i.infoLabels['title']: + # Si el capitulo tiene nombre propio añadírselo al titulo del item + i.title = "%sx%s: %s" % (i.infoLabels['season'], i.infoLabels['episode'], i.infoLabels['title']) + if i.infoLabels.has_key('poster_path'): + # Si el capitulo tiene imagen propia remplazar al poster + i.thumbnail = i.infoLabels['poster_path'] + + itemlist.sort(key=lambda it: int(it.infoLabels['episode']), + reverse=config.get_setting('orden_episodios', __channel__)) + + # Opción "Añadir esta serie a la videoteca" + if config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append(Item(channel=__channel__, title="Añadir esta serie a la videoteca", url=item.url, + action="add_serie_to_library", extra="episodios", show=item.show, category="Series", + text_color=color1, thumbnail=get_thumb("videolibrary_tvshow.png"), fanart=fanart_host)) + + return itemlist + + +def findvideos(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + # logger.info(data) + patron = '
    ' # lang, url + matches = re.compile(patron, re.DOTALL).findall(data) + + for option, url in matches: + lang = scrapertools.find_single_match(data, '
  • .*? 0 and item.extra != 'serie': + itemlist.append(Item(channel=__channel__, + title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', + url=item.url, action="add_pelicula_to_library", + thumbnail=get_thumb("videolibrary_movie.png"), + extra="findvideos", contentTitle=item.contentTitle)) + + return itemlist diff --git a/plugin.video.alfa/channels/peliculasaudiolatino.py b/plugin.video.alfa/channels/peliculasaudiolatino.py index ad495cdc..d5a021ac 100644 --- a/plugin.video.alfa/channels/peliculasaudiolatino.py +++ b/plugin.video.alfa/channels/peliculasaudiolatino.py @@ -7,7 +7,7 @@ from core import httptools from core import scrapertools from core import servertools from core.item import Item -from platformcode import logger +from platformcode import logger, config HOST = 'http://peliculasaudiolatino.com' @@ -154,9 +154,18 @@ def findvideos(item): for servidor, idioma, calidad, scrapedurl in matches: url = scrapedurl server = servertools.get_server_name(servidor) - title = item.title + title = "Enlace encontrado en %s" % (server) itemlist.append(Item(channel=item.channel, action="play", title=title, fulltitle=item.fulltitle, url=url, thumbnail=scrapedthumbnail, language=idioma, quality=calidad, server=server)) + if itemlist: + itemlist.append(Item(channel=item.channel)) + itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", + text_color="magenta")) + # Opción "Añadir esta película a la biblioteca de KODI" + if config.get_videolibrary_support(): + itemlist.append(Item(channel=item.channel, title="Añadir pelicula a la videoteca", text_color="green", + action="add_pelicula_to_library", url=item.url, thumbnail=item.thumbnail, + fulltitle=item.fulltitle)) return itemlist 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/peliculasrey.py b/plugin.video.alfa/channels/peliculasrey.py index aae92931..bcaa5abd 100755 --- a/plugin.video.alfa/channels/peliculasrey.py +++ b/plugin.video.alfa/channels/peliculasrey.py @@ -198,6 +198,15 @@ def findvideos(item): quality = quality )) itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) + if itemlist: + itemlist.append(Item(channel=item.channel)) + itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", + text_color="magenta")) + # Opción "Añadir esta película a la biblioteca de KODI" + if config.get_videolibrary_support(): + itemlist.append(Item(channel=item.channel, title="Añadir pelicula a la videoteca", text_color="green", + action="add_pelicula_to_library", url=item.url, thumbnail=item.thumbnail, + fulltitle=item.fulltitle)) 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">(.*?)|\s{2,}', "", data) - id = scrapertools.find_single_match(data, 'var _SOURCE =.*?source:(.*?),') - if videoitem.language == 'SUB': - sub = scrapertools.find_single_match(data, 'var _SOURCE =.*?srt:(.*?),') - sub = sub.replace('\\', '') - else: - sub = '' - new_url = 'https://onevideo.tv/api/player?key=90503e3de26d45e455b55e9dc54f015b3d1d4150&link' \ - '=%s&srt=%s' % (id, sub) + urls_list = scrapertools.find_multiple_matches(data, '({"type":.*?})') + for element in urls_list: + json_data=jsontools.load(element) - data = httptools.downloadpage(new_url).data + id = json_data['id'] + sub = json_data['srt'] + url = json_data['source'] - url = scrapertools.find_single_match(data, '