diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index 719da0f7..3f8b9b0e 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@  - + @@ -19,15 +19,11 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - » anitoonstv » asialiveaction - » cinehindi » danimados - » mundiseries » pelisculashndu - » seodiv » serieslan - » crunchyroll » pelisfox - » stormo ¤ arreglos internos - [COLOR green]Gracias a [COLOR yellow]Danielr460, numa00009 y numa00009[/COLOR] - por su colaboración en esta versión[/COLOR] - + » pelisplus » cinetux + » powvideo » streamplay + » gvideo ¤ arreglos internos + [COLOR green]Gracias a [COLOR yellow]caperucitaferoz[/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 Browse web pages using Kodi, you can easily watch their video content. diff --git a/plugin.video.alfa/channels/allcalidad.json b/plugin.video.alfa/channels/allcalidad.json index 5c35e0cf..1d553516 100755 --- a/plugin.video.alfa/channels/allcalidad.json +++ b/plugin.video.alfa/channels/allcalidad.json @@ -19,6 +19,14 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_global_search", "type": "bool", diff --git a/plugin.video.alfa/channels/allcalidad.py b/plugin.video.alfa/channels/allcalidad.py index 8a64360a..04d73f46 100755 --- a/plugin.video.alfa/channels/allcalidad.py +++ b/plugin.video.alfa/channels/allcalidad.py @@ -33,7 +33,7 @@ def newest(categoria): itemlist = [] item = Item() try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host elif categoria == 'infantiles': item.url = host + 'category/animacion/' diff --git a/plugin.video.alfa/channels/allpeliculas.json b/plugin.video.alfa/channels/allpeliculas.json index 2574c95b..5338fb45 100755 --- a/plugin.video.alfa/channels/allpeliculas.json +++ b/plugin.video.alfa/channels/allpeliculas.json @@ -20,6 +20,14 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", @@ -50,4 +58,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/allpeliculas.py b/plugin.video.alfa/channels/allpeliculas.py index 06175ca6..591163c3 100644 --- a/plugin.video.alfa/channels/allpeliculas.py +++ b/plugin.video.alfa/channels/allpeliculas.py @@ -217,7 +217,7 @@ def newest(categoria): itemlist = [] item = Item() try: - if categoria == "peliculas": + if categoria in ['peliculas','latino']: item.url = host + "movies/newmovies?page=1" item.action = "lista" itemlist = lista(item) diff --git a/plugin.video.alfa/channels/alltorrent.json b/plugin.video.alfa/channels/alltorrent.json index e279dbd3..c627ebbb 100755 --- a/plugin.video.alfa/channels/alltorrent.json +++ b/plugin.video.alfa/channels/alltorrent.json @@ -25,6 +25,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/alltorrent.py b/plugin.video.alfa/channels/alltorrent.py index 85190bb6..34869367 100755 --- a/plugin.video.alfa/channels/alltorrent.py +++ b/plugin.video.alfa/channels/alltorrent.py @@ -54,6 +54,7 @@ def browser(url): api_key = "2e2160006592024ba87ccdf78c28f49f" api_fankey = "dffe90fba4d02c199ae7a9e71330c987" +host = 'http://alltorrent.net/' def mainlist(item): logger.info() @@ -392,3 +393,26 @@ def get_art(item): item.extra = item.extra + "|" + item.thumbnail else: item.extra = item.extra + "|" + item.thumbnail + + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = host + + itemlist = scraper(item) + + if itemlist[-1].action == "[COLOR olivedrab][B]Siguiente >>[/B][/COLOR]": + 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 diff --git a/plugin.video.alfa/channels/cinecalidad.json b/plugin.video.alfa/channels/cinecalidad.json index 3db32aac..9f31cf60 100755 --- a/plugin.video.alfa/channels/cinecalidad.json +++ b/plugin.video.alfa/channels/cinecalidad.json @@ -55,6 +55,22 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } diff --git a/plugin.video.alfa/channels/cinecalidad.py b/plugin.video.alfa/channels/cinecalidad.py index 25902a51..34407b61 100644 --- a/plugin.video.alfa/channels/cinecalidad.py +++ b/plugin.video.alfa/channels/cinecalidad.py @@ -378,12 +378,14 @@ def newest(categoria): itemlist = [] item = Item() try: - if categoria == 'peliculas': - item.url = 'http://www.cinecalidad.to' + if categoria in ['peliculas','latino']: + item.url = 'http://www.cinecalidad.com' elif categoria == 'infantiles': - item.url = 'http://www.cinecalidad.to/genero-peliculas/infantil/' + item.url = 'http://www.cinecalidad.com/genero-peliculas/infantil/' elif categoria == 'terror': - item.url = 'http://www.cinecalidad.to/genero-peliculas/terror/' + item.url = 'http://www.cinecalidad.com/genero-peliculas/terror/' + elif categoria == 'castellano': + item.url = 'http://www.cinecalidad.com/espana/' itemlist = peliculas(item) if itemlist[-1].title == 'Página siguiente >>': itemlist.pop() diff --git a/plugin.video.alfa/channels/cinefoxtv.json b/plugin.video.alfa/channels/cinefoxtv.json index dfa107be..54bb5891 100755 --- a/plugin.video.alfa/channels/cinefoxtv.json +++ b/plugin.video.alfa/channels/cinefoxtv.json @@ -18,6 +18,14 @@ "enabled": false, "visible": false }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", @@ -35,4 +43,4 @@ "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/cinefoxtv.py b/plugin.video.alfa/channels/cinefoxtv.py index 5a33d19a..ef97f240 100644 --- a/plugin.video.alfa/channels/cinefoxtv.py +++ b/plugin.video.alfa/channels/cinefoxtv.py @@ -193,7 +193,7 @@ def newest(categoria): item = Item() # categoria='peliculas' try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + 'page/1.html' elif categoria == 'infantiles': item.url = host + 'peliculas-de-genero/infantil/1.html' diff --git a/plugin.video.alfa/channels/cinetux.json b/plugin.video.alfa/channels/cinetux.json index bf4d08eb..b3e3a7bd 100755 --- a/plugin.video.alfa/channels/cinetux.json +++ b/plugin.video.alfa/channels/cinetux.json @@ -44,6 +44,30 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "modo_grafico", "type": "bool", diff --git a/plugin.video.alfa/channels/cinetux.py b/plugin.video.alfa/channels/cinetux.py index 3bcc11e5..8dfa267b 100644 --- a/plugin.video.alfa/channels/cinetux.py +++ b/plugin.video.alfa/channels/cinetux.py @@ -90,26 +90,30 @@ def newest(categoria): if categoria == 'peliculas': item.url = CHANNEL_HOST item.action = "peliculas" - itemlist = peliculas(item) - - if itemlist[-1].action == "peliculas": - itemlist.pop() elif categoria == 'documentales': item.url = CHANNEL_HOST + "genero/documental/" item.action = "peliculas" - itemlist = peliculas(item) - - if itemlist[-1].action == "peliculas": - itemlist.pop() elif categoria == 'infantiles': - item.url = CHANNEL_HOST + "genero/infantil/" + item.url = CHANNEL_HOST + "genero/animacion/" item.action = "peliculas" - itemlist = peliculas(item) - if itemlist[-1].action == "peliculas": - itemlist.pop() + elif categoria == 'terror': + item.url = CHANNEL_HOST + "genero/terror/" + item.action = "peliculas" + + elif categoria == 'castellano': + item.url = CHANNEL_HOST + "idioma/espanol/" + item.action = "peliculas" + + elif categoria == 'latino': + item.url = CHANNEL_HOST + "idioma/latino/" + item.action = "peliculas" + + itemlist = peliculas(item) + if itemlist[-1].action == "peliculas": + itemlist.pop() # Se captura la excepción, para no interrumpir al canal novedades si un canal falla except: @@ -263,15 +267,11 @@ def findvideos(item): if itemlist: itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="", text_color="magenta")) - # Opción "Añadir esta película a la videoteca" if item.extra != "library": if config.get_videolibrary_support(): itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green", action="add_pelicula_to_library", url=item.url, fulltitle = item.fulltitle )) - - else: - itemlist.append(item.clone(title="No hay enlaces disponibles", action="", text_color=color3)) return itemlist @@ -296,6 +296,8 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): url = scrapertools.find_single_match(bloque1, patron) if "goo.gl" in url: url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") + if "drive.php" in url: + scrapedserver = "gvideo" if "player" in url: scrapedserver = scrapertools.find_single_match(url, 'player/(\w+)') if "ok" in scrapedserver: scrapedserver = "okru" @@ -348,10 +350,10 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): def play(item): logger.info() itemlist = [] - if "api.cinetux" in item.url or item.server == "okru": + if "api.cinetux" in item.url or item.server == "okru" or "drive.php" in item.url: data = httptools.downloadpage(item.url, headers={'Referer': item.extra}).data.replace("\\", "") id = scrapertools.find_single_match(data, 'img src="[^#]+#(.*?)"') - item.url = "https://youtube.googleapis.com/embed/?status=ok&hl=es&allow_embed=1&ps=docs&partnerid=30&hd=1&autoplay=0&cc_load_policy=1&showinfo=0&docid=" + id + item.url = "http://docs.google.com/get_video_info?docid=" + id if item.server == "okru": item.url = "https://ok.ru/videoembed/" + id elif "links" in item.url or "www.cinetux.me" in item.url: diff --git a/plugin.video.alfa/channels/cuelgame.json b/plugin.video.alfa/channels/cuelgame.json index 8e964bbf..0a40b064 100755 --- a/plugin.video.alfa/channels/cuelgame.json +++ b/plugin.video.alfa/channels/cuelgame.json @@ -21,6 +21,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/cuelgame.py b/plugin.video.alfa/channels/cuelgame.py index 0760121a..7e323deb 100755 --- a/plugin.video.alfa/channels/cuelgame.py +++ b/plugin.video.alfa/channels/cuelgame.py @@ -1223,3 +1223,25 @@ def browser(url): response = r.read() return response + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = 'http://cuelgame.net/?category=4' + + itemlist = scraper(item) + + if itemlist[-1].action == "Página 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 diff --git a/plugin.video.alfa/channels/descargasmix.json b/plugin.video.alfa/channels/descargasmix.json index c20c42a9..95890119 100644 --- a/plugin.video.alfa/channels/descargasmix.json +++ b/plugin.video.alfa/channels/descargasmix.json @@ -43,6 +43,14 @@ "default": false, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/descargasmix.py b/plugin.video.alfa/channels/descargasmix.py index cc49d16a..1fac7664 100644 --- a/plugin.video.alfa/channels/descargasmix.py +++ b/plugin.video.alfa/channels/descargasmix.py @@ -535,3 +535,38 @@ def get_data(url_orig, get_host=False): break return response.data + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = host+'/peliculas' + + itemlist = entradas(item) + if itemlist[-1].title == ">> Siguiente": + itemlist.pop() + + item.url = host + '/series' + + itemlist.extend(entradas(item)) + if itemlist[-1].title == ">> Siguiente": + itemlist.pop() + + item.url = host + '/anime' + + itemlist.extend(entradas(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 diff --git a/plugin.video.alfa/channels/divxatope.json b/plugin.video.alfa/channels/divxatope.json index 9c2603b5..8f70eb4a 100755 --- a/plugin.video.alfa/channels/divxatope.json +++ b/plugin.video.alfa/channels/divxatope.json @@ -35,6 +35,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/divxatope.py b/plugin.video.alfa/channels/divxatope.py index 71965fc9..276dd858 100644 --- a/plugin.video.alfa/channels/divxatope.py +++ b/plugin.video.alfa/channels/divxatope.py @@ -94,7 +94,7 @@ def newest(categoria): itemlist = [] item = Item() try: - if categoria == 'peliculas': + if categoria in ['peliculas', 'torrent']: item.url = "http://www.divxatope1.com/peliculas" elif categoria == 'series': diff --git a/plugin.video.alfa/channels/divxtotal.json b/plugin.video.alfa/channels/divxtotal.json index 208a9a23..56a954e0 100755 --- a/plugin.video.alfa/channels/divxtotal.json +++ b/plugin.video.alfa/channels/divxtotal.json @@ -26,6 +26,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/divxtotal.py b/plugin.video.alfa/channels/divxtotal.py index 889bd667..0163a61b 100644 --- a/plugin.video.alfa/channels/divxtotal.py +++ b/plugin.video.alfa/channels/divxtotal.py @@ -1020,3 +1020,26 @@ def ext_size(url): ext_v = ext_v + " -- No reproducible" size = "" return ext_v, size + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = 'http://www.divxtotal.com/peliculas/' + item.contentType="movie" + + itemlist = scraper(item) + + if itemlist[-1].title == "[COLOR springgreen][B]Siguiente >>[/B][/COLOR]": + 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 diff --git a/plugin.video.alfa/channels/doomtv.json b/plugin.video.alfa/channels/doomtv.json index f972754b..9845847f 100644 --- a/plugin.video.alfa/channels/doomtv.json +++ b/plugin.video.alfa/channels/doomtv.json @@ -55,6 +55,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/doomtv.py b/plugin.video.alfa/channels/doomtv.py index db8bf102..2bc1209f 100644 --- a/plugin.video.alfa/channels/doomtv.py +++ b/plugin.video.alfa/channels/doomtv.py @@ -202,7 +202,7 @@ def newest(categoria): item = Item() # categoria='peliculas' try: - if categoria == 'peliculas': + if categoria in ['peliculas', 'latino']: item.url = host +'peliculas/page/1' elif categoria == 'infantiles': item.url = host + 'categoria/animacion/' diff --git a/plugin.video.alfa/channels/elitetorrent.json b/plugin.video.alfa/channels/elitetorrent.json index b81aff68..a0044960 100644 --- a/plugin.video.alfa/channels/elitetorrent.json +++ b/plugin.video.alfa/channels/elitetorrent.json @@ -12,5 +12,15 @@ "tvshow", "documentary", "vos" + ], + "settings":[ + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true + } ] } diff --git a/plugin.video.alfa/channels/elitetorrent.py b/plugin.video.alfa/channels/elitetorrent.py index bd3c993e..66181660 100644 --- a/plugin.video.alfa/channels/elitetorrent.py +++ b/plugin.video.alfa/channels/elitetorrent.py @@ -105,3 +105,24 @@ def play(item): thumbnail=item.thumbnail, plot=item.plot, folder=False)) return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = 'http://www.elitetorrent.wesconference.net/categoria/2/peliculas/modo:mini' + + itemlist = peliculas(item) + if itemlist[-1].title == "Página 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 diff --git a/plugin.video.alfa/channels/estadepelis.json b/plugin.video.alfa/channels/estadepelis.json index 0a9c7ec0..5c75dc13 100755 --- a/plugin.video.alfa/channels/estadepelis.json +++ b/plugin.video.alfa/channels/estadepelis.json @@ -31,6 +31,14 @@ "VOS" ] }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", @@ -56,4 +64,4 @@ "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/estadepelis.py b/plugin.video.alfa/channels/estadepelis.py index a592c8f3..1b4fc936 100755 --- a/plugin.video.alfa/channels/estadepelis.py +++ b/plugin.video.alfa/channels/estadepelis.py @@ -457,7 +457,7 @@ def newest(categoria): item = Item() # categoria='peliculas' try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host elif categoria == 'infantiles': item.url = host + 'search?q=animación' diff --git a/plugin.video.alfa/channels/gmobi.json b/plugin.video.alfa/channels/gmobi.json index 3c144db9..7407eb83 100644 --- a/plugin.video.alfa/channels/gmobi.json +++ b/plugin.video.alfa/channels/gmobi.json @@ -18,6 +18,22 @@ "default": false, "enabled": false, "visible": false + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } diff --git a/plugin.video.alfa/channels/gmobi.py b/plugin.video.alfa/channels/gmobi.py index ebe6145e..bbf3a0c9 100644 --- a/plugin.video.alfa/channels/gmobi.py +++ b/plugin.video.alfa/channels/gmobi.py @@ -12,10 +12,11 @@ from core import tmdb from core.item import Item from platformcode import logger +host = 'http://gnula.mobi/' def mainlist(item): logger.info() itemlist = list() - itemlist.append(item.clone(title="Novedades", action="peliculas", url="http://gnula.mobi/")) + itemlist.append(item.clone(title="Novedades", action="peliculas", url=host)) itemlist.append(item.clone(title="Castellano", action="peliculas", url="http://www.gnula.mobi/tag/espanol/")) itemlist.append(item.clone(title="Latino", action="peliculas", url="http://gnula.mobi/tag/latino/")) @@ -113,3 +114,25 @@ def findvideos(item): def play(item): item.thumbnail = item.contentThumbnail return [item] + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + elif categoria == 'castellano': + item.url = host +'tag/espanol/' + elif categoria == 'latino': + item.url = host +'tag/latino/' + itemlist = peliculas(item) + if "Pagina" in itemlist[-1].title: + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist diff --git a/plugin.video.alfa/channels/pasateatorrent.json b/plugin.video.alfa/channels/grantorrent.json old mode 100755 new mode 100644 similarity index 70% rename from plugin.video.alfa/channels/pasateatorrent.json rename to plugin.video.alfa/channels/grantorrent.json index 5b0b90b9..fe8c7bd7 --- a/plugin.video.alfa/channels/pasateatorrent.json +++ b/plugin.video.alfa/channels/grantorrent.json @@ -1,33 +1,33 @@ -{ - "id": "pasateatorrent", - "name": "PasateaTorrent", - "active": true, - "adult": false, - "language": ["cast"], - "thumbnail": "http://imgur.com/iLeISt0.png", - "banner": "pasateatorrent.png", - "fanart": "http://imgur.com/uexmGEg.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": "modo_grafico", - "type": "bool", - "label": "Buscar información extra (TMDB)", - "default": true, - "enabled": true, - "visible": true - } - ] -} +{ + "id": "grantorrent", + "name": "GranTorrent", + "active": true, + "adult": false, + "language": ["cast"], + "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": "modo_grafico", + "type": "bool", + "label": "Buscar información extra (TMDB)", + "default": true, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/pasateatorrent.py b/plugin.video.alfa/channels/grantorrent.py old mode 100755 new mode 100644 similarity index 84% rename from plugin.video.alfa/channels/pasateatorrent.py rename to plugin.video.alfa/channels/grantorrent.py index 5e2671ea..dc28ca54 --- a/plugin.video.alfa/channels/pasateatorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -1,273 +1,273 @@ -# -*- coding: utf-8 -*- - -import re - -from channelselector import get_thumb -from core import httptools -from core import scrapertools -from core.item import Item -from platformcode import config, logger - -host = "https://pasateatorrent.com/" - -dict_url_seasons = dict() -__modo_grafico__ = config.get_setting('modo_grafico', 'pasateatorrent') - - -def mainlist(item): - logger.info() - - thumb_movie = get_thumb("channels_movie.png") - thumb_tvshow = get_thumb("channels_tvshow.png") - - itemlist = list() - itemlist.append( - Item(channel=item.channel, title="Peliculas", action="peliculas", thumbnail=thumb_movie)) - itemlist.append( - Item(channel=item.channel, title="Series", action="series", thumbnail=thumb_tvshow)) - - return itemlist - - -def peliculas(item): - logger.info() - - thumb_search = get_thumb("search.png") - - itemlist = list() - itemlist.append(item.clone(channel=item.channel, title="Novedades", action="listado", url=host)) - # itemlist.append(item.clone(channel=item.channel, title="Filtrar películas", action="listado", url=host)) - itemlist.append(item.clone(channel=item.channel, title="Buscar", action="search", url=host, media="película", - thumbnail=thumb_search)) - - return itemlist - - -def series(item): - logger.info() - - thumb_search = get_thumb("search.png") - - itemlist = list() - itemlist.append(item.clone(channel=item.channel, title="Novedades", action="listado", url=host + "series/")) - # itemlist.append(item.clone(channel=item.channel, title="Filtrar series", action="listado", url=host)) - itemlist.append(item.clone(channel=item.channel, title="Buscar", action="search", url=host + "series/", - media="serie", thumbnail=thumb_search)) - - return itemlist - - -def search(item, texto): - logger.info("texto:" + texto) - texto = texto.replace(" ", "+") - itemlist = [] - - try: - url = "%s?s=%s&post_type=Buscar+%s" % (item.url, texto, item.media) - data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url).data) - # logger.debug("data %s \n\n" % data) - - video_section = scrapertools.find_single_match(data, '
(.*?)
') - - pattern = '.*?[^"]+)".*?class="bloque_inferior">' \ - '(?P.*?)</div>' - - matches = re.compile(pattern, re.DOTALL).findall(video_section) - - for url, thumb, title in matches: - if item.media == "serie": - action = "episodios" - else: - action = "findvideos" - itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumb, - contentTitle=title, contentType="movie")) - - 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("%s" % line) - return [] - - -def listado(item): - logger.info() - - itemlist = [] - - data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) - # logger.debug("data %s \n\n" % data) - - video_section = scrapertools.find_single_match(data, '<div class="contenedor_imagenes">(.*?)</div><center>') - # logger.debug("data %s \n\n" % video_section) - - pattern = '<a href="(?P<url>[^"]+)">.*?<img.*?src="(?P<thumb>[^"]+)".*?class="bloque_superior">\s*' \ - '(?P<quality>.*?)\s*</div>.*?src="(?P<lang>[^"]+)".*?class="bloque_inferior">\s*(?P<title>.*?)\s*' \ - '</div>.*?class="div_inferior_date">\s*(?P<date>.*?)\s*</div>' - - matches = re.compile(pattern, re.DOTALL).findall(video_section) - - for url, thumb, quality, lang, title, date in matches: - title = scrapertools.htmlclean(title) - title = re.sub(r"\s{2}", " ", title) - - if "/series" in item.url: - if quality: - title2 = "%s [%s]" % (title, quality) - - itemlist.append(Item(channel=item.channel, action="episodios", title=title2, url=url, thumbnail=thumb, - quality=quality, contentTitle=title, contentType="tvshow")) - else: - - if quality: - title2 = "%s [%s]" % (title, quality) - - itemlist.append(Item(channel=item.channel, action="findvideos", title=title2, url=url, thumbnail=thumb, - quality=quality, contentTitle=title, contentType="movie")) - - pagination = scrapertools.find_single_match(data, '<div class="navigation">(.*?)</ul>') - if pagination: - next_page = scrapertools.find_single_match(pagination, 'class="active"><a.*?<a.*?href="([^"]+)') - # logger.debug("next %s" % next_page) - if next_page: - itemlist.append(Item(channel=item.channel, action="listado", title=">> Página siguiente", url=next_page, - thumbnail=get_thumb("next.png"))) - - return itemlist - - -def episodios(item): - logger.info() - - itemlist = [] - dict_data = dict() - dict_data, item = get_episodes(item, dict_data) - - for key in dict_data.keys(): - d = dict_data[key] - quality = "[%s]" % "][".join(d["quality"]) - - d["s_e"] = re.sub(r"\(Contrase.*?\)\s*", "NO REPRODUCIBLE-RAR", d["s_e"]) - title = "%s [%s] %s" % (d["s_e"], d["lang"], quality) - logger.debug("bla %s" % d["s_e"]) - - if "temporada" in d["s_e"].lower(): - regex = re.compile('temporada\s*', re.I) - d["s_e"] = regex.sub("", d["s_e"]) - season = scrapertools.find_single_match(d["s_e"], "(\d+)") - episode = 1 - else: - season, episode = scrapertools.find_single_match(d["s_e"], "(\d+)×(\d+)") - - itemlist.append(item.clone(action="findvideos", title=title, thumbnail=item.thumbnail, url=d["url"], - server="torrent", contentSeason=season, contentEpisodeNumber=episode, - contentType="tvshow", fulltitle=item.title, quality=d["quality"], lang=d["lang"])) - - # order list - if len(itemlist) > 1: - itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) - - try: - from core import tmdb - tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - except: - pass - - return itemlist - - -def get_episodes(item, dict_data): - global dict_url_seasons - - data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) - # logger.debug("data %s \n\n" % data) - if item.contentTitle != "": - title = scrapertools.find_single_match(data, '<div class="titulo_page_exit">(.*?)[.]</div>') - year = scrapertools.find_single_match(data, '<div class="ano_page_exit">(\d+)</div>') - # logger.debug("title es %s" % title) - if title: - item.contentTitle = title - item.show = title - if year: - item.infoLabels['year'] = year - - links_section = scrapertools.find_single_match(data, 'div id="Tokyo" [^>]+>(.*?)</div>') - # logger.debug("data %s \n\n" % data) - - pattern = 'icono_.*?png" title="(?P<lang>.*?)" [^>]+></td><td>(?P<s_e>.*?)</td><td>(?P<quality>.*?)</td><td>' \ - '<a href="(?P<url>[^"]+)"' - matches = re.compile(pattern, re.DOTALL).findall(links_section) - for lang, s_e, quality, url in matches: - if s_e + lang not in dict_data: - dict_data[s_e + lang] = {"url": [url], "lang": lang, "s_e": s_e, - "quality": [quality]} - else: - if quality not in dict_data[s_e+lang]["quality"]: - dict_data[s_e + lang]["quality"].append(quality) - dict_data[s_e + lang]["url"].append(url) - - url_to_check = scrapertools.find_single_match(links_section, '</table><p><a .*?href="([^"]+)">Temporada.*?</a>') - # logger.debug("url es %s " % url_to_check) - - # if url doesn't exist we add it into the dict - if url_to_check not in dict_url_seasons: - dict_url_seasons[url_to_check] = False - - for key, value in dict_url_seasons.items(): - if not value: - item.url = key - dict_url_seasons[key] = True - dict_data, item = get_episodes(item, dict_data) - - # logger.debug("URL_LIST es %s " % dict_url_seasons) - - return dict_data, item - - -def findvideos(item): - logger.info() - itemlist = [] - - if item.contentType == "movie": - - data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) - # logger.debug("data %s \n\n" % data) - - if item.contentTitle != "": - title = scrapertools.find_single_match(data, '<div class="titulo_page_exit">(.*?)[.]</div>') - year = scrapertools.find_single_match(data, '<div class="ano_page_exit">(\d+)</div>') - logger.debug("title es %s" % title) - if title: - item.contentTitle = title - item.show = title - if year: - item.infoLabels['year'] = year - - links_section = scrapertools.find_single_match(data, 'div id="Tokyo" [^>]+>(.*?)</div>') - # logger.debug("data %s \n\n" % data) - - pattern = 'icono_.*?png" title="(?P<lang>.*?)" [^>]+></td><td>(?P<quality>.*?)</td><td>(?P<size>.*?)</td><td>' \ - '<a href="(?P<url>[^"]+)"' - matches = re.compile(pattern, re.DOTALL).findall(links_section) - - for lang, quality, size, url in matches: - title = "[%s] [%s] (%s)" % (lang, quality, size) - - itemlist.append(item.clone(action="play", title=title, url=url, thumbnail=item.thumbnail, server="torrent", - fulltitle=item.title)) - - try: - from core import tmdb - tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - except: - pass - - else: - for index, url in enumerate(item.url): - title = "%sx%s [%s] [%s]" % (item.contentSeason, item.contentEpisodeNumber, item.lang, item.quality[index]) - itemlist.append(item.clone(action="play", title=title, url=url, thumbnail=item.thumbnail, server="torrent", - quality=item.quality[index])) - - return itemlist +# -*- coding: utf-8 -*- + +import re + +from channelselector import get_thumb +from core import httptools +from core import scrapertools +from core.item import Item +from platformcode import config, logger + +host = "https://grantorrent.com/" + +dict_url_seasons = dict() +__modo_grafico__ = config.get_setting('modo_grafico', 'grantorrent') + + +def mainlist(item): + logger.info() + + thumb_movie = get_thumb("channels_movie.png") + thumb_tvshow = get_thumb("channels_tvshow.png") + + itemlist = list() + itemlist.append( + Item(channel=item.channel, title="Peliculas", action="peliculas", thumbnail=thumb_movie)) + itemlist.append( + Item(channel=item.channel, title="Series", action="series", thumbnail=thumb_tvshow)) + + return itemlist + + +def peliculas(item): + logger.info() + + thumb_search = get_thumb("search.png") + + itemlist = list() + itemlist.append(item.clone(channel=item.channel, title="Novedades", action="listado", url=host)) + # itemlist.append(item.clone(channel=item.channel, title="Filtrar películas", action="listado", url=host)) + itemlist.append(item.clone(channel=item.channel, title="Buscar", action="search", url=host, media="película", + thumbnail=thumb_search)) + + return itemlist + + +def series(item): + logger.info() + + thumb_search = get_thumb("search.png") + + itemlist = list() + itemlist.append(item.clone(channel=item.channel, title="Novedades", action="listado", url=host + "series/")) + # itemlist.append(item.clone(channel=item.channel, title="Filtrar series", action="listado", url=host)) + itemlist.append(item.clone(channel=item.channel, title="Buscar", action="search", url=host + "series/", + media="serie", thumbnail=thumb_search)) + + return itemlist + + +def search(item, texto): + logger.info("texto:" + texto) + texto = texto.replace(" ", "+") + itemlist = [] + + try: + url = "%s?s=%s" % (item.url, texto) + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url).data) + # logger.debug("data %s \n\n" % data) + + video_section = scrapertools.find_single_match(data, '<div class="contenedor-imagen">(.*?</div>)</div></div>') + + pattern = '<a href="(?P<url>[^"]+)"><img.*?src="(?P<thumb>[^"]+)".*?class="bloque-inferior">' \ + '\s*(?P<title>.*?)\s*</div>' + + matches = re.compile(pattern, re.DOTALL).findall(video_section) + + for url, thumb, title in matches: + if item.media == "serie": + action = "episodios" + else: + action = "findvideos" + itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumb, + contentTitle=title, contentType="movie")) + + 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("%s" % line) + return [] + + +def listado(item): + logger.info() + + itemlist = [] + + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + # logger.debug("data %s \n\n" % data) + + video_section = scrapertools.find_single_match(data, '<br><div class="contenedor-home">(.*?</div>)</div></div>') + # logger.debug("data %s \n\n" % video_section) + + pattern = '<a href="(?P<url>[^"]+)"><img.*?src="(?P<thumb>[^"]+)".*?.*?class="bloque-superior">\s*' \ + '(?P<quality>.*?)\s*<div class="imagen-idioma">\s*<img src=".*?icono_(?P<lang>[^\.]+).*?<div class=' \ + '"bloque-inferior">\s*(?P<title>.*?)\s*</div><div class="bloque-date">\s*(?P<date>.*?)\s*</div>' + + matches = re.compile(pattern, re.DOTALL).findall(video_section) + + for url, thumb, quality, lang, title, date in matches: + title = scrapertools.htmlclean(title) + title = re.sub(r"\s{2}", " ", title) + + if "/series" in item.url: + if quality: + title2 = "%s [%s]" % (title, quality) + + itemlist.append(Item(channel=item.channel, action="episodios", title=title2, url=url, thumbnail=thumb, + quality=quality, contentTitle=title, contentType="tvshow")) + else: + + if quality: + title2 = "%s [%s]" % (title, quality) + + itemlist.append(Item(channel=item.channel, action="findvideos", title=title2, url=url, thumbnail=thumb, + quality=quality, contentTitle=title, contentType="movie")) + + pagination = scrapertools.find_single_match(data, '<div class="nav-links">(.*?)</ul>') + if pagination: + next_page = scrapertools.find_single_match(pagination, "class='page-numbers current'.*?<a.*?href='([^']+)'") + # logger.debug("next %s" % next_page) + if next_page: + itemlist.append(Item(channel=item.channel, action="listado", title=">> Página siguiente", url=next_page, + thumbnail=get_thumb("next.png"))) + + return itemlist + + +def episodios(item): + logger.info() + + itemlist = [] + dict_data = dict() + dict_data, item = get_episodes(item, dict_data) + + for key in dict_data.keys(): + d = dict_data[key] + quality = "[%s]" % "][".join(d["quality"]) + + d["s_e"] = re.sub(r"\(Contrase.*?\)\s*", "NO REPRODUCIBLE-RAR", d["s_e"]) + title = "%s [%s] %s" % (d["s_e"], d["lang"], quality) + # logger.debug("%s" % d["s_e"]) + + if "temporada" in d["s_e"].lower(): + regex = re.compile('temporada\s*', re.I) + d["s_e"] = regex.sub("", d["s_e"]) + season = scrapertools.find_single_match(d["s_e"], "(\d+)") + episode = 1 + else: + season, episode = scrapertools.find_single_match(d["s_e"], "(\d+)×(\d+)") + + itemlist.append(item.clone(action="findvideos", title=title, thumbnail=item.thumbnail, url=d["url"], + server="torrent", contentSeason=season, contentEpisodeNumber=episode, + contentType="tvshow", fulltitle=item.title, quality=d["quality"], lang=d["lang"])) + + # order list + if len(itemlist) > 1: + itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) + + try: + from core import tmdb + tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) + except: + pass + + return itemlist + + +def get_episodes(item, dict_data): + global dict_url_seasons + + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + # logger.debug("data %s \n\n" % data) + if item.contentTitle != "": + title = scrapertools.find_single_match(data, '<h3 class="bold">.*?original:\s*(.*?)[.]</h3>') + year = scrapertools.find_single_match(data, '<h3 class="bold">\s*Estreno:\s*(\d+)[.]</h') + # logger.debug("title es %s" % title) + if title: + item.contentTitle = title + item.show = title + if year: + item.infoLabels['year'] = year + + links_section = scrapertools.find_single_match(data, 'div id="Tokyo" [^>]+>(.*?)</div>') + # logger.debug("data %s \n\n" % links_section) + + pattern = 'icono_.*?png" title="(?P<lang>.*?)" [^>]+></td><td>(?P<s_e>.*?)</td><td>(?P<quality>.*?)</td><td>' \ + '<a class="link" href="(?P<url>[^"]+)"' + matches = re.compile(pattern, re.DOTALL).findall(links_section) + for lang, s_e, quality, url in matches: + if s_e + lang not in dict_data: + dict_data[s_e + lang] = {"url": [url], "lang": lang, "s_e": s_e, + "quality": [quality]} + else: + if quality not in dict_data[s_e+lang]["quality"]: + dict_data[s_e + lang]["quality"].append(quality) + dict_data[s_e + lang]["url"].append(url) + + url_to_check = scrapertools.find_single_match(links_section, '</table><p><a.*?href="([^"]+)".*?>\s*Temporada.*?</a>') + # logger.debug("url es %s " % url_to_check) + + # if url doesn't exist we add it into the dict + if url_to_check and url_to_check not in dict_url_seasons: + dict_url_seasons[url_to_check] = False + + for key, value in dict_url_seasons.items(): + if not value: + item.url = key + dict_url_seasons[key] = True + dict_data, item = get_episodes(item, dict_data) + + # logger.debug("URL_LIST es %s " % dict_url_seasons) + + return dict_data, item + + +def findvideos(item): + logger.info() + itemlist = [] + + if item.contentType == "movie": + + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + # logger.debug("data %s \n\n" % data) + + if item.contentTitle != "": + title = scrapertools.find_single_match(data, '<div class="titulo_page_exit">(.*?)[.]</div>') + year = scrapertools.find_single_match(data, '<div class="ano_page_exit">(\d+)</div>') + logger.debug("title es %s" % title) + if title: + item.contentTitle = title + item.show = title + if year: + item.infoLabels['year'] = year + + links_section = scrapertools.find_single_match(data, 'div id="Tokyo" [^>]+>(.*?)</div>') + # logger.debug("data %s \n\n" % data) + + pattern = 'icono_.*?png" title="(?P<lang>.*?)" [^>]+></td><td>(?P<quality>.*?)</td><td>(?P<size>.*?)</td><td>' \ + '<a class="link" href="(?P<url>[^"]+)"' + matches = re.compile(pattern, re.DOTALL).findall(links_section) + + for lang, quality, size, url in matches: + title = "[%s] [%s] (%s)" % (lang, quality, size) + + itemlist.append(item.clone(action="play", title=title, url=url, thumbnail=item.thumbnail, server="torrent", + fulltitle=item.title)) + + try: + from core import tmdb + tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) + except: + pass + + else: + for index, url in enumerate(item.url): + title = "%sx%s [%s] [%s]" % (item.contentSeason, item.contentEpisodeNumber, item.lang, item.quality[index]) + itemlist.append(item.clone(action="play", title=title, url=url, thumbnail=item.thumbnail, server="torrent", + quality=item.quality[index])) + + return itemlist diff --git a/plugin.video.alfa/channels/lacajita.json b/plugin.video.alfa/channels/lacajita.json index 380ab715..3a45314b 100755 --- a/plugin.video.alfa/channels/lacajita.json +++ b/plugin.video.alfa/channels/lacajita.json @@ -48,6 +48,22 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/lacajita.py b/plugin.video.alfa/channels/lacajita.py index 94dd3024..5788e369 100644 --- a/plugin.video.alfa/channels/lacajita.py +++ b/plugin.video.alfa/channels/lacajita.py @@ -265,14 +265,25 @@ def newest(categoria): logger.info() itemlist = [] item = Item() + item.page = 0 try: if categoria == "terror": item.url = host +"/listado/terror/" item.action = "updated" - item.page = 0 - itemlist = updated(item) + itemlist = updated(item) + elif categoria == 'castellano': + item.url = host + "/estrenos/es/" + item.action = "entradas" - if itemlist[-1].action == "updated": + elif categoria == 'latino': + item.url = host + "/estrenos/la/" + item.action = "entradas" + + if categoria != 'terror': + itemlist = entradas(item) + + + if itemlist[-1].action == item.action: itemlist.pop() # Se captura la excepción, para no interrumpir al canal novedades si un canal falla diff --git a/plugin.video.alfa/channels/mejortorrent.json b/plugin.video.alfa/channels/mejortorrent.json index e492c42c..a64f06e1 100755 --- a/plugin.video.alfa/channels/mejortorrent.json +++ b/plugin.video.alfa/channels/mejortorrent.json @@ -20,6 +20,14 @@ "default": false, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/mejortorrent.py b/plugin.video.alfa/channels/mejortorrent.py index 7f0c9c66..014562fd 100755 --- a/plugin.video.alfa/channels/mejortorrent.py +++ b/plugin.video.alfa/channels/mejortorrent.py @@ -423,3 +423,28 @@ def play(item): thumbnail=item.thumbnail, plot=item.plot, folder=False)) return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = 'http://www.mejortorrent.com/torrents-de-peliculas.html' + + itemlist = getlist(item) + if itemlist[-1].title == "Pagina siguiente >>": + itemlist.pop() + item.url = 'http://www.mejortorrent.com/torrents-de-series.html' + itemlist.extend(getlist(item)) + if itemlist[-1].title == "Pagina 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 diff --git a/plugin.video.alfa/channels/miltorrents.json b/plugin.video.alfa/channels/miltorrents.json index 08ac652c..b9bd1fed 100755 --- a/plugin.video.alfa/channels/miltorrents.json +++ b/plugin.video.alfa/channels/miltorrents.json @@ -19,6 +19,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/miltorrents.py b/plugin.video.alfa/channels/miltorrents.py index 2469fd31..a9b4840f 100755 --- a/plugin.video.alfa/channels/miltorrents.py +++ b/plugin.video.alfa/channels/miltorrents.py @@ -1555,3 +1555,28 @@ def busqueda(item): from channels import search return search.do_search(new_item, cat) + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = 'http://www.miltorrents.com' + + itemlist = peliculas(item) + if itemlist[-1].title == "[COLOR khaki]siguiente[/COLOR]": + itemlist.pop() + item.url = 'http://www.miltorrents.com/series' + itemlist.extend(peliculas(item)) + if itemlist[-1].title == "[COLOR khaki]siguiente[/COLOR]": + 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 diff --git a/plugin.video.alfa/channels/miradetodo.json b/plugin.video.alfa/channels/miradetodo.json index 16a9821b..03bc898b 100755 --- a/plugin.video.alfa/channels/miradetodo.json +++ b/plugin.video.alfa/channels/miradetodo.json @@ -18,6 +18,14 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", @@ -35,4 +43,4 @@ "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/miradetodo.py b/plugin.video.alfa/channels/miradetodo.py index 35110b07..78243829 100755 --- a/plugin.video.alfa/channels/miradetodo.py +++ b/plugin.video.alfa/channels/miradetodo.py @@ -382,7 +382,7 @@ def newest(categoria): itemlist = [] item = Item() try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + 'page/1/?s' elif categoria == 'infantiles': diff --git a/plugin.video.alfa/channels/newpct1.json b/plugin.video.alfa/channels/newpct1.json index 2f20898b..26b6d67f 100755 --- a/plugin.video.alfa/channels/newpct1.json +++ b/plugin.video.alfa/channels/newpct1.json @@ -20,6 +20,14 @@ "default": false, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index ae393d51..22b39433 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -442,3 +442,29 @@ def search(item, texto): for line in sys.exc_info(): logger.error("%s" % line) return [] + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + item.extra = 'pelilist' + if categoria == 'torrent': + item.url = host+'peliculas/' + + itemlist = listado(item) + if itemlist[-1].title == ">> Página siguiente": + itemlist.pop() + item.url = host+'series/' + itemlist.extend(listado(item)) + if itemlist[-1].title == ">> Página 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 diff --git a/plugin.video.alfa/channels/news.py b/plugin.video.alfa/channels/news.py index 9fd12030..b2d48c92 100644 --- a/plugin.video.alfa/channels/news.py +++ b/plugin.video.alfa/channels/news.py @@ -74,6 +74,26 @@ def mainlist(item): set_category_context(new_item) itemlist.append(new_item) + # if list_canales['Castellano']: + thumbnail = get_thumb("channels_spanish.png") + new_item = Item(channel=item.channel, action="novedades", extra="castellano", title="Castellano", + thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) + + # if list_canales['Latino']: + thumbnail = get_thumb("channels_latino.png") + new_item = Item(channel=item.channel, action="novedades", extra="latino", title="Latino", + thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) + + # if list_canales['Torrent']: + thumbnail = get_thumb("channels_torrent.png") + new_item = Item(channel=item.channel, action="novedades", extra="torrent", title="Torrent", thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) + #if list_canales['documentales']: thumbnail = get_thumb("channels_documentary.png") new_item = Item(channel=item.channel, action="novedades", extra="documentales", title="Documentales", @@ -95,7 +115,8 @@ def set_category_context(item): def get_channels_list(): logger.info() - list_canales = {'peliculas': [], 'terror': [], 'infantiles': [], 'series': [], 'anime': [], 'documentales': []} + list_canales = {'peliculas': [], 'terror': [], 'infantiles': [], 'series': [], 'anime': [], + 'castellano': [], 'latino':[], 'torrent':[], 'documentales': []} any_active = False # Rellenar listas de canales disponibles channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') @@ -419,6 +440,16 @@ def menu_opciones(item): title=" - Episodios de anime", thumbnail=get_thumb("channels_anime.png"), folder=False)) + itemlist.append( + Item(channel=item.channel, action="setting_channel", extra="castellano", title=" - Castellano", + thumbnail=get_thumb("channels_documentary.png"), folder=False)) + + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="latino", title=" - Latino", + thumbnail=get_thumb("channels_documentary.png"), folder=False)) + + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="Torrent", title=" - Torrent", + thumbnail=get_thumb("channels_documentary.png"), folder=False)) + itemlist.append(Item(channel=item.channel, action="setting_channel", extra="documentales", title=" - Documentales", thumbnail=get_thumb("channels_documentary.png"), diff --git a/plugin.video.alfa/channels/ohlatino.json b/plugin.video.alfa/channels/ohlatino.json index 7d50a531..1e39fd1a 100644 --- a/plugin.video.alfa/channels/ohlatino.json +++ b/plugin.video.alfa/channels/ohlatino.json @@ -18,6 +18,14 @@ "enabled": false, "visible": false }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", @@ -35,4 +43,4 @@ "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/ohlatino.py b/plugin.video.alfa/channels/ohlatino.py index 0e2c41a1..11a08812 100644 --- a/plugin.video.alfa/channels/ohlatino.py +++ b/plugin.video.alfa/channels/ohlatino.py @@ -183,7 +183,7 @@ def newest(categoria): logger.info() item = Item() try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + '/release/2017/' elif categoria == 'infantiles': diff --git a/plugin.video.alfa/channels/peliculasaudiolatino.json b/plugin.video.alfa/channels/peliculasaudiolatino.json index 52d788ce..134f5aef 100755 --- a/plugin.video.alfa/channels/peliculasaudiolatino.json +++ b/plugin.video.alfa/channels/peliculasaudiolatino.json @@ -10,13 +10,45 @@ "movie" ], "settings": [ + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_global_search", "type": "bool", "label": "Incluir en busqueda global", - "default": false, + "default": true, + "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 + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, "enabled": true, "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/peliculasaudiolatino.py b/plugin.video.alfa/channels/peliculasaudiolatino.py index 197cc18c..8ab94e70 100644 --- a/plugin.video.alfa/channels/peliculasaudiolatino.py +++ b/plugin.video.alfa/channels/peliculasaudiolatino.py @@ -31,6 +31,29 @@ def mainlist(item): return itemlist +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria in ['peliculas','latino']: + item.url = HOST + elif categoria == 'infantiles': + item.url = HOST + '/genero/animacion.html' + elif categoria == 'terror': + item.url = HOST + '/genero/terror.html' + itemlist = peliculas(item) + if "Pagina" in itemlist[-1].title: + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist + + def peliculas(item): logger.info() diff --git a/plugin.video.alfa/channels/peliculasdk.json b/plugin.video.alfa/channels/peliculasdk.json index a5dbd252..2fed6d4d 100755 --- a/plugin.video.alfa/channels/peliculasdk.json +++ b/plugin.video.alfa/channels/peliculasdk.json @@ -18,6 +18,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/peliculasdk.py b/plugin.video.alfa/channels/peliculasdk.py index de32d30a..e9ae3d45 100644 --- a/plugin.video.alfa/channels/peliculasdk.py +++ b/plugin.video.alfa/channels/peliculasdk.py @@ -746,6 +746,28 @@ def info(item): infoplus.start(item_info, peliculas) +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'castellano': + item.url = host + "idioma/Espanol/" + item.action = "peliculas" + + itemlist = peliculas(item) + if itemlist[-1].action == "peliculas": + 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 browser(url): import mechanize diff --git a/plugin.video.alfa/channels/peliculasmx.json b/plugin.video.alfa/channels/peliculasmx.json index 29e1167b..8a1ffeb3 100755 --- a/plugin.video.alfa/channels/peliculasmx.json +++ b/plugin.video.alfa/channels/peliculasmx.json @@ -10,13 +10,45 @@ "movie" ], "settings": [ + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_global_search", "type": "bool", "label": "Incluir en busqueda global", - "default": false, + "default": true, + "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 + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, "enabled": true, "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/peliculasmx.py b/plugin.video.alfa/channels/peliculasmx.py index 81ccd672..90e211ca 100644 --- a/plugin.video.alfa/channels/peliculasmx.py +++ b/plugin.video.alfa/channels/peliculasmx.py @@ -10,28 +10,47 @@ from core.item import Item from platformcode import logger - +host = "http://www.peliculasmx.net" def mainlist(item): logger.info() itemlist = [] itemlist.append( - Item(channel=item.channel, title="Últimas añadidas", action="peliculas", url="http://www.peliculasmx.net/")) + Item(channel=item.channel, title="Últimas añadidas", action="peliculas", url=host)) itemlist.append( - Item(channel=item.channel, title="Últimas por género", action="generos", url="http://www.peliculasmx.net/")) - itemlist.append(Item(channel=item.channel, title="Buscar...", action="search", url="http://www.peliculasmx.net/")) + Item(channel=item.channel, title="Últimas por género", action="generos", url=host)) + itemlist.append(Item(channel=item.channel, title="Buscar...", action="search", url=host)) + return itemlist + + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria in ['peliculas','latino']: + item.url = host + elif categoria == 'infantiles': + item.url = host + '/category/animacion/' + elif categoria == 'terror': + item.url = host + '/category/terror/' + itemlist = peliculas(item) + if "Pagina" in itemlist[-1].title: + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + return itemlist def generos(item): logger.info() itemlist = [] - - # Descarga la página data = httptools.downloadpage(item.url).data - logger.debug(data) - # <li class="cat-item cat-item-3"><a href="http://peliculasmx.net/category/accion/" >Accion</a> <span>246</span> patron = '<li class="cat-item cat-item-.*?' patron += '<a href="([^"]+)".*?' patron += '>([^<]+).*?' @@ -92,7 +111,7 @@ def search(item, texto): texto = texto.replace(" ", "+") try: # Series - item.url = "http://www.peliculasmx.net/?s=%s" % texto + item.url = host + "/?s=%s" % texto itemlist.extend(peliculas(item)) itemlist = sorted(itemlist, key=lambda Item: Item.title) diff --git a/plugin.video.alfa/channels/peliculasnu.json b/plugin.video.alfa/channels/peliculasnu.json index 99cecf7c..ba170ee8 100755 --- a/plugin.video.alfa/channels/peliculasnu.json +++ b/plugin.video.alfa/channels/peliculasnu.json @@ -35,6 +35,22 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "modo_grafico", "type": "bool", diff --git a/plugin.video.alfa/channels/peliculasnu.py b/plugin.video.alfa/channels/peliculasnu.py index 592862c6..10f9f5a6 100644 --- a/plugin.video.alfa/channels/peliculasnu.py +++ b/plugin.video.alfa/channels/peliculasnu.py @@ -80,6 +80,12 @@ def newest(categoria): item.url = host elif categoria == "terror": item.url = host+"terror/" + elif categoria == 'castellano': + item.url = host + "?s=Español" + elif categoria == 'latino': + item.url = host + "?s=Latino" + + item.from_newest = True item.action = "entradas" itemlist = entradas(item) diff --git a/plugin.video.alfa/channels/peliculasrey.json b/plugin.video.alfa/channels/peliculasrey.json index 6ef49029..91c439fd 100755 --- a/plugin.video.alfa/channels/peliculasrey.json +++ b/plugin.video.alfa/channels/peliculasrey.json @@ -9,5 +9,63 @@ "categories": [ "direct", "movie" - ] + ], + "settings":[ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Películas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_documentales", + "type": "bool", + "label": "Incluir en Novedades - Documentales", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + } +] } diff --git a/plugin.video.alfa/channels/peliculasrey.py b/plugin.video.alfa/channels/peliculasrey.py index ebd7c362..83116c4b 100755 --- a/plugin.video.alfa/channels/peliculasrey.py +++ b/plugin.video.alfa/channels/peliculasrey.py @@ -148,3 +148,41 @@ def findvideos(item): def play(item): item.thumbnail = item.contentThumbnail return [item] + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + + elif categoria == 'documentales': + item.url = host + "genero/documental/" + + elif categoria == 'infantiles': + item.url = host + "genero/animacion-e-infantil/" + + elif categoria == 'terror': + item.url = host + "genero/terror/" + + elif categoria == 'castellano': + item.url = host + "idioma/castellano/" + + elif categoria == 'latino': + item.url = host + "idioma/latino/" + + itemlist = peliculas(item) + + if itemlist[-1].action == "peliculas": + 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 + diff --git a/plugin.video.alfa/channels/peliscity.json b/plugin.video.alfa/channels/peliscity.json index f5cbe7f0..a9497196 100755 --- a/plugin.video.alfa/channels/peliscity.json +++ b/plugin.video.alfa/channels/peliscity.json @@ -10,5 +10,63 @@ "movie", "direct", "VOS" - ] + ], + "settings":[ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Películas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_documentales", + "type": "bool", + "label": "Incluir en Novedades - Documentales", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + } +] } diff --git a/plugin.video.alfa/channels/peliscity.py b/plugin.video.alfa/channels/peliscity.py index d871a39a..89ba4cb5 100755 --- a/plugin.video.alfa/channels/peliscity.py +++ b/plugin.video.alfa/channels/peliscity.py @@ -164,3 +164,41 @@ def play(item): logger.info() item.thumbnail = item.extra return [item] + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + + elif categoria == 'documentales': + item.url = host + "/genero/documental/" + + elif categoria == 'infantiles': + item.url = host + "/genero/animacion/" + + elif categoria == 'terror': + item.url = host + "/genero/terror/" + + elif categoria == 'castellano': + item.url = host + "/idioma/espanol-castellano/" + + elif categoria == 'latino': + item.url = host + "/idioma/espanol-latino/" + + itemlist = agregadas(item) + + if itemlist[-1].action == "agregadas": + 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 + diff --git a/plugin.video.alfa/channels/pelisfox.json b/plugin.video.alfa/channels/pelisfox.json index 30715811..8b1d0fe9 100755 --- a/plugin.video.alfa/channels/pelisfox.json +++ b/plugin.video.alfa/channels/pelisfox.json @@ -27,6 +27,14 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_infantiles", "type": "bool", diff --git a/plugin.video.alfa/channels/pelisfox.py b/plugin.video.alfa/channels/pelisfox.py index c1757840..294eea6b 100644 --- a/plugin.video.alfa/channels/pelisfox.py +++ b/plugin.video.alfa/channels/pelisfox.py @@ -291,7 +291,7 @@ def newest(categoria): item = Item() # categoria='peliculas' try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + '/estrenos/' elif categoria == 'infantiles': item.url = host + '/peliculas/animacion/' diff --git a/plugin.video.alfa/channels/pelismagnet.json b/plugin.video.alfa/channels/pelismagnet.json index 49076e01..03a2f6a1 100755 --- a/plugin.video.alfa/channels/pelismagnet.json +++ b/plugin.video.alfa/channels/pelismagnet.json @@ -28,6 +28,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/pelismagnet.py b/plugin.video.alfa/channels/pelismagnet.py index de3369f1..3a4348bf 100644 --- a/plugin.video.alfa/channels/pelismagnet.py +++ b/plugin.video.alfa/channels/pelismagnet.py @@ -334,3 +334,29 @@ def findvideos(item): servertools.get_servers_itemlist(itemlist) return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'torrent': + item.url = api + "?sort_by=''&page=0" + + itemlist = pelis(item) + if itemlist[-1].title == ">> Página siguiente": + itemlist.pop() + item.url = api_serie + "?sort_by=''&page=0" + itemlist.extend(series(item)) + if itemlist[-1].title == ">> Página 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 + diff --git a/plugin.video.alfa/channels/pelismundo.json b/plugin.video.alfa/channels/pelismundo.json index b3b5ae0a..ffe1237d 100644 --- a/plugin.video.alfa/channels/pelismundo.json +++ b/plugin.video.alfa/channels/pelismundo.json @@ -49,6 +49,22 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } diff --git a/plugin.video.alfa/channels/pelismundo.py b/plugin.video.alfa/channels/pelismundo.py index a2af9cb7..a7a2ceb4 100644 --- a/plugin.video.alfa/channels/pelismundo.py +++ b/plugin.video.alfa/channels/pelismundo.py @@ -34,9 +34,14 @@ def newest(categoria): if categoria == 'peliculas': item.url = host elif categoria == 'infantiles': - item.url = host + 'genero/infantil/' + item.url = host + '/genero/infantil/' elif categoria == 'terror': - item.url = host + 'genero/terror/' + item.url = host + '/genero/terror/' + elif categoria == 'castellano': + item.url = host +'/lenguaje/castellano/' + elif categoria == 'latino': + item.url = host +'/lenguaje/latino/' + itemlist = peliculas(item) itemlist = peliculas(item) if "Pagina" in itemlist[-1].title: itemlist.pop() @@ -126,6 +131,7 @@ def filtro(item): for url, title in matches: if "eroticas" in title and config.get_setting("adult_mode") == 0: continue + logger.debug('la url: %s' %url) itemlist.append(item.clone(action = "peliculas", title = title.title(), url = url diff --git a/plugin.video.alfa/channels/pelisplanet.json b/plugin.video.alfa/channels/pelisplanet.json index cbc3db76..c9621d7a 100644 --- a/plugin.video.alfa/channels/pelisplanet.json +++ b/plugin.video.alfa/channels/pelisplanet.json @@ -61,6 +61,22 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } diff --git a/plugin.video.alfa/channels/pelisplanet.py b/plugin.video.alfa/channels/pelisplanet.py index 935df8c8..0d76adc7 100644 --- a/plugin.video.alfa/channels/pelisplanet.py +++ b/plugin.video.alfa/channels/pelisplanet.py @@ -143,6 +143,11 @@ def newest(categoria): item.url = host + "genero/animacion-e-infantil/" elif categoria == 'terror': item.url = host + "genero/terror/" + elif categoria == 'castellano': + item.url = host + "idioma/castellano/" + + elif categoria == 'latino': + item.url = host + "idioma/latino/" else: return [] diff --git a/plugin.video.alfa/channels/pelisplus.json b/plugin.video.alfa/channels/pelisplus.json index 55ee7ecc..8ba009da 100644 --- a/plugin.video.alfa/channels/pelisplus.json +++ b/plugin.video.alfa/channels/pelisplus.json @@ -11,28 +11,47 @@ "tvshow", "documentary", "direct" - ], "settings": [ + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_global_search", "type": "bool", "label": "Incluir en busqueda global", "default": true, - "enabled": false, - "visible": false + "enabled": true, + "visible": true }, { - "id": "filter_languages", - "type": "list", - "label": "Mostrar enlaces en idioma...", - "default": 0, + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Incluir en Novedades - Peliculas", + "default": true, "enabled": true, - "visible": true, - "lvalues": [ - "No filtrar", - "Latino" - ] + "visible": true + }, + { + "id": "include_in_newest_infantiles", + "type": "bool", + "label": "Incluir en Novedades - Infantiles", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/pelisplus.py b/plugin.video.alfa/channels/pelisplus.py index 6883f008..3e06e516 100644 --- a/plugin.video.alfa/channels/pelisplus.py +++ b/plugin.video.alfa/channels/pelisplus.py @@ -145,7 +145,9 @@ def menuseries(item): def search(item, texto): logger.info() texto = texto.replace(" ", "+") - item.url = item.url + texto + item.url = host + 'busqueda/?s=' + texto + if not item.extra: + item.extra = 'peliculas/' try: if texto != '': return lista(item) @@ -217,7 +219,7 @@ def lista(item): else: item.extra = item.extra.rstrip('s/') if item.extra in url: - itemlist.append( + new_item=( Item(channel=item.channel, contentType=tipo, action=accion, @@ -237,7 +239,7 @@ def lista(item): tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - # Encuentra los elementos que no tienen plot y carga las paginas correspondientes para obtenerlo# + #Encuentra los elementos que no tienen plot y carga las paginas correspondientes para obtenerlo# for item in itemlist: if item.infoLabels['plot'] == '': data = httptools.downloadpage(item.url).data @@ -250,7 +252,9 @@ def lista(item): if item.title != 'Buscar' and actual != '': if itemlist != []: next_page = str(int(actual) + 1) - next_page_url = host + item.extra + 'pag-' + next_page + next_page_url = item.extra + 'pag-' + next_page + if not next_page_url.startswith("http"): + next_page_url = host + next_page_url itemlist.append( Item(channel=item.channel, action="lista", @@ -513,12 +517,15 @@ def newest(categoria): item = Item() item.extra = 'estrenos/' try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + 'estrenos/pag-1' elif categoria == 'infantiles': item.url = host + 'peliculas/animacion/pag-1' + elif categoria == 'terror': + item.url = host + 'peliculas/terror/pag-1' + elif categoria == 'documentales': item.url = host + 'documentales/pag-1' item.extra = 'documentales/' @@ -532,6 +539,5 @@ def newest(categoria): logger.error("{0}".format(line)) return [] - itemlist = filtertools.get_links(itemlist, item, list_language) - - + #itemlist = filtertools.get_links(itemlist, item, list_language) + return itemlist diff --git a/plugin.video.alfa/channels/playmax.json b/plugin.video.alfa/channels/playmax.json deleted file mode 100755 index d671f521..00000000 --- a/plugin.video.alfa/channels/playmax.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "id": "playmax", - "name": "PlayMax", - "language": ["cast", "lat"], - "active": false, - "adult": false, - "thumbnail": "playmax.png", - "banner": "playmax.png", - "categories": [ - "movie", - "tvshow" - ], - "settings": [ - { - "id": "playmaxuser", - "type": "text", - "color": "0xFF25AA48", - "label": "@30014", - "enabled": true, - "visible": true - }, - { - "id": "playmaxpassword", - "type": "text", - "color": "0xFF25AA48", - "hidden": true, - "label": "@30015", - "enabled": "!eq(-1,'')", - "visible": true - }, - { - "id": "include_in_global_search", - "type": "bool", - "label": "Incluir en búsqueda global", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_peliculas", - "type": "bool", - "label": "Incluir en Novedades - Películas", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_infantiles", - "type": "bool", - "label": "Incluir en Novedades - Infantiles", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_series", - "type": "bool", - "label": "Incluir en Novedades - Series", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "modo_grafico", - "type": "bool", - "color": "0xFFd50b0b", - "label": "Buscar información extra", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "menu_info", - "type": "bool", - "color": "0xFFd50b0b", - "label": "Mostrar menú intermedio película/episodio", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "perfil", - "type": "list", - "label": "Perfil de color", - "default": 3, - "enabled": true, - "visible": true, - "lvalues": [ - "Sin color", - "Perfil 3", - "Perfil 2", - "Perfil 1" - ] - }, - { - "id": "last_page", - "type": "bool", - "color": "0xFFd50b0b", - "label": "Ocultar opción elegir página en películas (Kodi)", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "order_web", - "type": "bool", - "color": "0xFFd50b0b", - "label": "Usar el mismo orden de los enlaces que la web", - "default": false, - "enabled": true, - "visible": true - } - ] -} diff --git a/plugin.video.alfa/channels/playmax.py b/plugin.video.alfa/channels/playmax.py deleted file mode 100644 index 64481b86..00000000 --- a/plugin.video.alfa/channels/playmax.py +++ /dev/null @@ -1,979 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from core import httptools -from core import scrapertools -from core import tmdb -from core.item import Item -from platformcode import config, logger - -sid = config.get_setting("sid_playmax", "playmax") -apikey = "0ea143087685e9e0a23f98ae" -__modo_grafico__ = config.get_setting('modo_grafico', 'playmax') -__perfil__ = config.get_setting('perfil', "playmax") -__menu_info__ = config.get_setting('menu_info', 'playmax') - -# Fijar perfil de color -perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFF088A08'], - ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFF088A08'], - ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFF088A08']] - -if __perfil__ - 1 >= 0: - color1, color2, color3, color4, color5 = perfil[__perfil__ - 1] -else: - color1 = color2 = color3 = color4 = color5 = "" - -host = "https://playmax.mx" - - -def login(): - logger.info() - - try: - user = config.get_setting("playmaxuser", "playmax") - password = config.get_setting("playmaxpassword", "playmax") - if user == "" and password == "": - return False, "Para ver los enlaces de este canal es necesario registrarse en playmax.mx" - elif user == "" or password == "": - return False, "Usuario o contraseña en blanco. Revisa tus credenciales" - - data = httptools.downloadpage("https://playmax.mx/ucp.php?mode=login").data - if re.search(r'(?i)class="hb_user_data" title="%s"' % user, data): - if not config.get_setting("sid_playmax", "playmax"): - sid_ = scrapertools.find_single_match(data, 'sid=([^"]+)"') - if not sid_: - sid_ = scrapertools.find_single_match(config.get_cookie_data(), 'playmax.*?_sid\s*([A-z0-9]+)') - config.set_setting("sid_playmax", sid_, "playmax") - return True, "" - - confirm_id = scrapertools.find_single_match(data, 'name="confirm_id" value="([^"]+)"') - sid_log = scrapertools.find_single_match(data, 'name="sid" value="([^"]+)"') - post = "username=%s&password=%s&autologin=on&agreed=true&change_lang=0&confirm_id=%s&login=&sid=%s" \ - "&redirect=index.php&login=Entrar" % (user, password, confirm_id, sid_log) - data = httptools.downloadpage("https://playmax.mx/ucp.php?mode=login", post=post).data - if "contraseña incorrecta" in data: - logger.error("Error en el login") - return False, "Contraseña errónea. Comprueba tus credenciales" - elif "nombre de usuario incorrecto" in data: - logger.error("Error en el login") - return False, "Nombre de usuario no válido. Comprueba tus credenciales" - else: - logger.info("Login correcto") - sid_ = scrapertools.find_single_match(data, 'sid=([^"]+)"') - if not sid_: - sid_ = scrapertools.find_single_match(config.get_cookie_data(), 'playmax.*?_sid\s*([A-z0-9]+)') - config.set_setting("sid_playmax", sid_, "playmax") - # En el primer logueo se activa la busqueda global y la seccion novedades - if not config.get_setting("primer_log", "playmax"): - config.set_setting("include_in_global_search", True, "playmax") - config.set_setting("include_in_newest_peliculas", True, "playmax") - config.set_setting("include_in_newest_series", True, "playmax") - config.set_setting("include_in_newest_infantiles", True, "playmax") - config.set_setting("primer_log", False, "playmax") - return True, "" - except: - import traceback - logger.error(traceback.format_exc()) - return False, "Error en el login. Comprueba tus credenciales o si la web está operativa" - - -def mainlist(item): - logger.info() - itemlist = [] - item.text_color = color1 - - logueado, error_message = login() - - if not logueado: - config.set_setting("include_in_global_search", False, "playmax") - itemlist.append(item.clone(title=error_message, action="configuracion", folder=False)) - return itemlist - - itemlist.append(item.clone(title="Películas", action="", text_color=color2)) - item.contentType = "movie" - itemlist.append( - item.clone(title=" Novedades", action="fichas", url=host + "/catalogo.php?tipo[]=2&ad=2&ordenar=" - "novedades&con_dis=on")) - itemlist.append( - item.clone(title=" Populares", action="fichas", url=host + "/catalogo.php?tipo[]=2&ad=2&ordenar=" - "pop&con_dis=on")) - itemlist.append(item.clone(title=" Índices", action="indices")) - - itemlist.append(item.clone(title="Series", action="", text_color=color2)) - item.contentType = "tvshow" - itemlist.append(item.clone(title=" Nuevos capítulos", action="fichas", url=host + "/catalogo.php?tipo[]=1&ad=2&" - "ordenar=novedades&con_dis=on")) - itemlist.append(item.clone(title=" Nuevas series", action="fichas", url=host + "/catalogo.php?tipo[]=1&ad=2&" - "ordenar=año&con_dis=on")) - itemlist.append(item.clone(title=" Índices", action="indices")) - - item.contentType = "movie" - itemlist.append(item.clone(title="Documentales", action="fichas", text_color=color2, - url=host + "/catalogo.php?&tipo[]=3&ad=2&ordenar=novedades&con_dis=on")) - itemlist.append(item.clone(title="Listas", action="listas", text_color=color2, - url=host + "/listas.php?apikey=%s&sid=%s&start=0" % (apikey, sid), extra="listas")) - itemlist.append(item.clone(action="search", title="Buscar...", text_color=color2)) - itemlist.append(item.clone(action="acciones_cuenta", title="Tus fichas", text_color=color4)) - itemlist.append(item.clone(title="Configuración del canal", action="configuracion", text_color="gold")) - - return itemlist - - -def search(item, texto): - logger.info() - texto = texto.replace(" ", "%20") - item.url = "%s/buscar.php?apikey=%s&sid=%s&buscar=%s&modo=[fichas]&start=0" % (host, apikey, sid, texto) - try: - return busqueda(item) - except: - import sys - for line in sys.exc_info(): - logger.error("%s" % line) - return [] - - -def busqueda(item): - logger.info() - itemlist = [] - - data = httptools.downloadpage(item.url).data - data = xml2dict(data) - if type(data["Data"]["Fichas"]["Ficha"]) == dict: - searched_data = [data["Data"]["Fichas"]["Ficha"]] - else: - searched_data = data["Data"]["Fichas"]["Ficha"] - - for f in searched_data: - f["Title"] = f["Title"].replace("<![CDATA[", "").replace("]]>", "") - title = "%s (%s)" % (f["Title"], f["Year"]) - infolab = {'year': f["Year"]} - thumbnail = f["Poster"] - url = "%s/ficha.php?f=%s" % (host, f["Id"]) - action = "findvideos" - if __menu_info__: - action = "menu_info" - if f["IsSerie"] == "1": - tipo = "tvshow" - show = f["Title"] - if not __menu_info__: - action = "episodios" - else: - tipo = "movie" - show = "" - itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, text_color=color2, - contentTitle=f["Title"], show=show, contentType=tipo, infoLabels=infolab, - thumbnail=thumbnail)) - - if __modo_grafico__: - tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - - total = int(data["Data"]["totalResultsFichas"]) - actualpage = int(scrapertools.find_single_match(item.url, "start=(\d+)")) - if actualpage + 20 < total: - next_page = item.url.replace("start=%s" % actualpage, "start=%s" % (actualpage + 20)) - itemlist.append(Item(channel=item.channel, action="busqueda", title=">> Página Siguiente", - url=next_page, thumbnail=item.thumbnail)) - - return itemlist - - -def configuracion(item): - from platformcode import platformtools - ret = platformtools.show_channel_settings() - platformtools.itemlist_refresh() - return ret - - -def newest(categoria): - logger.info() - itemlist = [] - item = Item() - try: - if categoria == 'series': - item.channel = "playmax" - item.extra = "newest" - item.url = host + "/catalogo.php?tipo[]=1&ad=2&ordenar=novedades&con_dis=on" - item.contentType = "tvshow" - itemlist = fichas(item) - - if itemlist[-1].action == "fichas": - itemlist.pop() - elif categoria == 'peliculas': - item.channel = "playmax" - item.extra = "newest" - item.url = host + "/catalogo.php?tipo[]=2&ad=2&ordenar=novedades&con_dis=on" - item.contentType = "movie" - itemlist = fichas(item) - - if itemlist[-1].action == "fichas": - itemlist.pop() - elif categoria == 'infantiles': - item.channel = "playmax" - item.extra = "newest" - item.url = host + "/catalogo.php?tipo[]=2&generos[]=60&ad=2&ordenar=novedades&con_dis=on" - item.contentType = "movie" - itemlist = fichas(item) - - if itemlist[-1].action == "fichas": - 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("%s" % line) - return [] - - return itemlist - - -def indices(item): - logger.info() - itemlist = [] - - tipo = "2" - if item.contentType == "tvshow": - tipo = "1" - if "Índices" in item.title: - if item.contentType == "tvshow": - itemlist.append(item.clone(title="Populares", action="fichas", url=host + "/catalogo.php?tipo[]=1&ad=2&" - "ordenar=pop&con_dis=on")) - itemlist.append(item.clone(title="Más vistas", action="fichas", url=host + "/catalogo.php?tipo[]=%s&ad=2&" - "ordenar=siempre&con_dis=on" % tipo)) - itemlist.append(item.clone(title="Mejor valoradas", action="fichas", url=host + "/catalogo.php?tipo[]=%s&ad=2&" - "ordenar=valoracion&con_dis=on" % tipo)) - itemlist.append(item.clone(title="Géneros", url=host + "/catalogo.php")) - itemlist.append(item.clone(title="Idiomas", url=host + "/catalogo.php")) - if item.contentType == "movie": - itemlist.append(item.clone(title="Por calidad", url=host + "/catalogo.php")) - itemlist.append(item.clone(title="Por año")) - itemlist.append(item.clone(title="Por país", url=host + "/catalogo.php")) - - return itemlist - - if "Géneros" in item.title: - data = httptools.downloadpage(item.url).data - patron = '<div class="sel gen" value="([^"]+)">([^<]+)</div>' - matches = scrapertools.find_multiple_matches(data, patron) - for value, genero in matches: - url = item.url + "?tipo[]=%s&generos[]=%s&ad=2&ordenar=novedades&con_dis=on" % (tipo, value) - itemlist.append(item.clone(action="fichas", title=genero, url=url)) - elif "Idiomas" in item.title: - data = httptools.downloadpage(item.url).data - bloque = scrapertools.find_single_match(data, 'oname="Idioma">Cualquier(.*?)<input') - patron = '<div class="sel" value="([^"]+)">([^<]+)</div>' - matches = scrapertools.find_multiple_matches(bloque, patron) - for value, idioma in matches: - url = item.url + "?tipo[]=%s&ad=2&ordenar=novedades&con_dis=on&e_idioma=%s" % (tipo, value) - itemlist.append(item.clone(action="fichas", title=idioma, url=url)) - elif "calidad" in item.title: - data = httptools.downloadpage(item.url).data - bloque = scrapertools.find_single_match(data, 'oname="Calidad">Cualquier(.*?)<input') - patron = '<div class="sel" value="([^"]+)">([^<]+)</div>' - matches = scrapertools.find_multiple_matches(bloque, patron) - for value, calidad in matches: - url = item.url + "?tipo[]=%s&ad=2&ordenar=novedades&con_dis=on&e_calidad=%s" % (tipo, value) - itemlist.append(item.clone(action="fichas", title=calidad, url=url)) - elif "país" in item.title: - data = httptools.downloadpage(item.url).data - bloque = scrapertools.find_single_match(data, 'oname="País">Todos(.*?)<input') - patron = '<div class="sel" value="([^"]+)">([^<]+)</div>' - matches = scrapertools.find_multiple_matches(bloque, patron) - for value, pais in matches: - url = item.url + "?tipo[]=%s&ad=2&ordenar=novedades&con_dis=on&pais=%s" % (tipo, value) - itemlist.append(item.clone(action="fichas", title=pais, url=url)) - else: - from datetime import datetime - year = datetime.now().year - for i in range(year, 1899, -1): - url = "%s/catalogo.php?tipo[]=%s&del=%s&al=%s&año=personal&ad=2&ordenar=novedades&con_dis=on" \ - % (host, tipo, i, i) - itemlist.append(item.clone(action="fichas", title=str(i), url=url)) - - return itemlist - - -def fichas(item): - logger.info() - itemlist = [] - - data = httptools.downloadpage(item.url).data - # data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) - - fichas_marca = {'1': 'Siguiendo', '2': 'Pendiente', '3': 'Favorita', '4': 'Vista', '5': 'Abandonada'} - patron = '<div class="c_fichas_image"[^>]*>[^<]*<[^>]+href="\.([^"]+)".*?src-data="([^"]+)".*?' \ - '<div class="c_fichas_data".*?marked="([^"]*)".*?serie="([^"]*)".*?' \ - '<div class="c_fichas_title">(?:<div class="c_fichas_episode">([^<]+)</div>|)([^<]+)</div>' - matches = scrapertools.find_multiple_matches(data, patron) - for scrapedurl, scrapedthumbnail, marca, serie, episodio, scrapedtitle in matches: - tipo = "movie" - scrapedurl = host + scrapedurl.rsplit("-dc=")[0] - if not "-dc=" in scrapedurl: - scrapedurl += "-dc=" - action = "findvideos" - if __menu_info__: - action = "menu_info" - if serie: - tipo = "tvshow" - if episodio: - title = "%s - %s" % (episodio.replace("X", "x"), scrapedtitle) - else: - title = scrapedtitle - - if marca: - title += " [COLOR %s][%s][/COLOR]" % (color4, fichas_marca[marca]) - - new_item = Item(channel=item.channel, action=action, title=title, url=scrapedurl, - thumbnail=scrapedthumbnail, contentTitle=scrapedtitle, contentType=tipo, - text_color=color2) - if new_item.contentType == "tvshow": - new_item.show = scrapedtitle - if not __menu_info__: - new_item.action = "episodios" - - itemlist.append(new_item) - - if itemlist and (item.extra == "listas_plus" or item.extra == "sigo"): - follow = scrapertools.find_single_match(data, '<div onclick="seguir_lista.*?>(.*?)<') - title = "Seguir Lista" - if follow == "Siguiendo": - title = "Dejar de seguir lista" - item.extra = "" - url = host + "/data.php?mode=seguir_lista&apikey=%s&sid=%s&lista=%s" % ( - apikey, sid, item.url.rsplit("/l", 1)[1]) - itemlist.insert(0, item.clone(action="acciones_cuenta", title=title, url=url, text_color=color4, - lista=item.title, folder=False)) - - next_page = scrapertools.find_single_match(data, 'href="([^"]+)" class="next"') - if next_page: - next_page = host + next_page.replace("&", "&") - itemlist.append(Item(channel=item.channel, action="fichas", title=">> Página Siguiente", url=next_page)) - - try: - total = int(scrapertools.find_single_match(data, '<span class="page-dots">.*href.*?>(\d+)')) - except: - total = 0 - if not config.get_setting("last_page", item.channel) and config.is_xbmc() and total > 2 \ - and item.extra != "newest": - itemlist.append(item.clone(action="select_page", title="Ir a página... (Total:%s)" % total, url=next_page, - text_color=color5)) - - return itemlist - - -def episodios(item): - logger.info() - itemlist = [] - - # Descarga la página - data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) - - if not item.infoLabels["tmdb_id"]: - item.infoLabels["tmdb_id"] = scrapertools.find_single_match(data, - '<a href="https://www.themoviedb.org/[^/]+/(\d+)') - item.infoLabels["year"] = scrapertools.find_single_match(data, 'class="e_new">(\d{4})') - if not item.infoLabels["genre"]: - item.infoLabels["genre"] = ", ".join(scrapertools.find_multiple_matches(data, - '<a itemprop="genre"[^>]+>([^<]+)</a>')) - if not item.infoLabels["plot"]: - item.infoLabels["plot"] = scrapertools.find_single_match(data, 'itemprop="description">([^<]+)</div>') - - dc = scrapertools.find_single_match(data, "var dc_ic = '\?dc=([^']+)'") - patron = '<div class="f_cl_l_c f_cl_l_c_id[^"]+" c_id="([^"]+)" .*?c_num="([^"]+)" c_name="([^"]+)"' \ - '.*?load_f_links\(\d+\s*,\s*(\d+).*?<div class="([^"]+)" onclick="marcar_capitulo' - matches = scrapertools.find_multiple_matches(data, patron) - lista_epis = [] - for c_id, episodio, title, ficha, status in matches: - episodio = episodio.replace("X", "x") - if episodio in lista_epis: - continue - lista_epis.append(episodio) - url = "https://playmax.mx/c_enlaces_n.php?ficha=%s&c_id=%s&dc=%s" % (ficha, c_id, dc) - title = "%s - %s" % (episodio, title) - if "_mc a" in status: - title = "[COLOR %s]%s[/COLOR] %s" % (color5, u"\u0474".encode('utf-8'), title) - - new_item = Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=item.thumbnail, - fanart=item.fanart, show=item.show, infoLabels=item.infoLabels, text_color=color2, - referer=item.url, contentType="episode") - try: - new_item.infoLabels["season"], new_item.infoLabels["episode"] = episodio.split('x', 1) - except: - pass - itemlist.append(new_item) - - itemlist.sort(key=lambda it: (it.infoLabels["season"], it.infoLabels["episode"]), reverse=True) - if __modo_grafico__: - tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - - library_path = config.get_videolibrary_path() - if config.get_videolibrary_support() and not item.extra: - title = "Añadir serie a la videoteca" - if item.infoLabels["imdb_id"] and not library_path.lower().startswith("smb://"): - try: - from core import filetools - path = filetools.join(library_path, "SERIES") - files = filetools.walk(path) - for dirpath, dirname, filename in files: - if item.infoLabels["imdb_id"] in dirpath: - for f in filename: - if f != "tvshow.nfo": - continue - from core import videolibrarytools - head_nfo, it = videolibrarytools.read_nfo(filetools.join(dirpath, dirname, f)) - canales = it.library_urls.keys() - canales.sort() - if "playmax" in canales: - canales.pop(canales.index("playmax")) - canales.insert(0, "[COLOR red]playmax[/COLOR]") - title = "Serie ya en tu videoteca. [%s] ¿Añadir?" % ",".join(canales) - break - except: - import traceback - logger.error(traceback.format_exc()) - pass - - itemlist.append(item.clone(action="add_serie_to_library", title=title, text_color=color5, - extra="episodios###library")) - if itemlist and not __menu_info__: - ficha = scrapertools.find_single_match(item.url, '-f(\d+)-') - itemlist.extend(acciones_fichas(item, sid, ficha)) - - return itemlist - - -def findvideos(item): - logger.info() - itemlist = [] - - if item.contentType == "movie": - # Descarga la página - data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) - - if not item.infoLabels["tmdb_id"]: - item.infoLabels["tmdb_id"] = scrapertools.find_single_match(data, '<a href="https://www.themoviedb.org/' - '[^/]+/(\d+)') - item.infoLabels["year"] = scrapertools.find_single_match(data, 'class="e_new">(\d{4})') - - if __modo_grafico__: - tmdb.set_infoLabels_item(item, __modo_grafico__) - if not item.infoLabels["plot"]: - item.infoLabels["plot"] = scrapertools.find_single_match(data, 'itemprop="description">([^<]+)</div>') - if not item.infoLabels["genre"]: - item.infoLabels["genre"] = ", ".join(scrapertools.find_multiple_matches(data, '<a itemprop="genre"[^>]+>' - '([^<]+)</a>')) - - ficha = scrapertools.find_single_match(item.url, '-f(\d+)-') - if not ficha: - ficha = scrapertools.find_single_match(item.url, 'f=(\d+)') - cid = "0" - else: - ficha, cid = scrapertools.find_single_match(item.url, 'ficha=(\d+)&c_id=(\d+)') - - url = "https://playmax.mx/c_enlaces_n.php?apikey=%s&sid=%s&ficha=%s&cid=%s" % (apikey, sid, ficha, cid) - data = httptools.downloadpage(url).data - data = xml2dict(data) - - for k, v in data["Data"].items(): - try: - if type(v) is dict: - if k == "Online": - order = 1 - elif k == "Download": - order = 0 - else: - order = 2 - - itemlist.append(item.clone(action="", title=k, text_color=color3, order=order)) - if type(v["Item"]) is str: - continue - elif type(v["Item"]) is dict: - v["Item"] = [v["Item"]] - for it in v["Item"]: - try: - thumbnail = "%s/styles/prosilver/imageset/%s.png" % (host, it['Host']) - title = " %s - %s/%s" % (it['Host'].capitalize(), it['Quality'], it['Lang']) - calidad = int(scrapertools.find_single_match(it['Quality'], '(\d+)p')) - calidadaudio = it['QualityA'].replace("...", "") - subtitulos = it['Subtitles'].replace("Sin subtítulos", "") - if subtitulos: - title += " (%s)" % subtitulos - if calidadaudio: - title += " [Audio:%s]" % calidadaudio - - likes = 0 - if it["Likes"] != "0" or it["Dislikes"] != "0": - likes = int(it["Likes"]) - int(it["Dislikes"]) - title += " (%s ok, %s ko)" % (it["Likes"], it["Dislikes"]) - if type(it["Url"]) is dict: - for i, enlace in enumerate(it["Url"]["Item"]): - titulo = title + " (Parte %s)" % (i + 1) - itemlist.append(item.clone(title=titulo, url=enlace, action="play", calidad=calidad, - thumbnail=thumbnail, order=order, like=likes, ficha=ficha, - cid=cid, folder=False)) - else: - url = it["Url"] - itemlist.append(item.clone(title=title, url=url, action="play", calidad=calidad, - thumbnail=thumbnail, order=order, like=likes, ficha=ficha, - cid=cid, folder=False)) - except: - pass - except: - pass - - if not config.get_setting("order_web", "playmax"): - itemlist.sort(key=lambda it: (it.order, it.calidad, it.like), reverse=True) - else: - itemlist.sort(key=lambda it: it.order, reverse=True) - if itemlist: - itemlist.extend(acciones_fichas(item, sid, ficha)) - - if not itemlist and item.contentType != "movie": - url = url.replace("apikey=%s&" % apikey, "") - data = httptools.downloadpage(url).data - data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) - - patron = '<div id="f_fde_c"[^>]+>(.*?update_fecha\(\d+\)">)</div>' - estrenos = scrapertools.find_multiple_matches(data, patron) - for info in estrenos: - info = "Estreno en " + scrapertools.htmlclean(info) - itemlist.append(item.clone(action="", title=info)) - - if not itemlist: - itemlist.append(item.clone(action="", title="No hay enlaces disponibles")) - - return itemlist - - -def menu_info(item): - logger.info() - itemlist = [] - - data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) - - item.infoLabels["tmdb_id"] = scrapertools.find_single_match(data, '<a href="https://www.themoviedb.org/[^/]+/(\d+)') - item.infoLabels["year"] = scrapertools.find_single_match(data, 'class="e_new">(\d{4})') - item.infoLabels["plot"] = scrapertools.find_single_match(data, 'itemprop="description">([^<]+)</div>') - item.infoLabels["genre"] = ", ".join(scrapertools.find_multiple_matches(data, - '<a itemprop="genre"[^>]+>([^<]+)</a>')) - if __modo_grafico__: - tmdb.set_infoLabels_item(item, __modo_grafico__) - - action = "findvideos" - title = "Ver enlaces" - if item.contentType == "tvshow": - action = "episodios" - title = "Ver capítulos" - itemlist.append(item.clone(action=action, title=title)) - - carpeta = "CINE" - tipo = "película" - action = "add_pelicula_to_library" - extra = "" - if item.contentType == "tvshow": - carpeta = "SERIES" - tipo = "serie" - action = "add_serie_to_library" - extra = "episodios###library" - - library_path = config.get_videolibrary_path() - if config.get_videolibrary_support(): - title = "Añadir %s a la videoteca" % tipo - if item.infoLabels["imdb_id"] and not library_path.lower().startswith("smb://"): - try: - from core import filetools - path = filetools.join(library_path, carpeta) - files = filetools.walk(path) - for dirpath, dirname, filename in files: - if item.infoLabels["imdb_id"] in dirpath: - namedir = dirpath.replace(path, '')[1:] - for f in filename: - if f != namedir + ".nfo" and f != "tvshow.nfo": - continue - from core import videolibrarytools - head_nfo, it = videolibrarytools.read_nfo(filetools.join(dirpath, f)) - canales = it.library_urls.keys() - canales.sort() - if "playmax" in canales: - canales.pop(canales.index("playmax")) - canales.insert(0, "[COLOR red]playmax[/COLOR]") - title = "%s ya en tu videoteca. [%s] ¿Añadir?" % (tipo.capitalize(), ",".join(canales)) - break - except: - import traceback - logger.error(traceback.format_exc()) - pass - - itemlist.append(item.clone(action=action, title=title, text_color=color5, extra=extra)) - - token_auth = config.get_setting("token_trakt", "tvmoviedb") - if token_auth and item.infoLabels["tmdb_id"]: - extra = "movie" - if item.contentType != "movie": - extra = "tv" - itemlist.append(item.clone(channel="tvmoviedb", title="[Trakt] Gestionar con tu cuenta", action="menu_trakt", - extra=extra)) - itemlist.append(item.clone(channel="trailertools", action="buscartrailer", title="Buscar Tráiler", - text_color="magenta", context="")) - - itemlist.append(item.clone(action="", title="")) - ficha = scrapertools.find_single_match(item.url, '-f(\d+)-') - if not ficha: - ficha = scrapertools.find_single_match(item.url, 'f=(\d+)') - - itemlist.extend(acciones_fichas(item, sid, ficha, season=True)) - itemlist.append(item.clone(action="acciones_cuenta", title="Añadir a una lista", text_color=color3, ficha=ficha)) - - return itemlist - - -def acciones_fichas(item, sid, ficha, season=False): - marcarlist = [] - new_item = item.clone() - new_item.infoLabels.pop("duration", None) - estados = [{'following': 'seguir'}, {'favorite': 'favorita'}, {'view': 'vista'}, {'slope': 'pendiente'}] - url = "https://playmax.mx/ficha.php?apikey=%s&sid=%s&f=%s" % (apikey, sid, ficha) - data = httptools.downloadpage(url).data - data = xml2dict(data) - - try: - marked = data["Data"]["User"]["Marked"] - if new_item.contentType == "episode": - for epi in data["Data"]["Episodes"]["Season_%s" % new_item.infoLabels["season"]]["Item"]: - if int(epi["Episode"]) == new_item.infoLabels["episode"]: - epi_marked = epi["EpisodeViewed"].replace("yes", "ya") - epi_id = epi["Id"] - marcarlist.append(new_item.clone(action="marcar", title="Capítulo %s visto. ¿Cambiar?" % epi_marked, - text_color=color3, epi_id=epi_id)) - break - except: - pass - - try: - tipo = new_item.contentType.replace("movie", "Película").replace("episode", "Serie").replace("tvshow", "Serie") - for status in estados: - for k, v in status.items(): - if k != marked: - title = "Marcar %s como %s" % (tipo.lower(), v) - action = "marcar" - else: - title = "%s marcada como %s" % (tipo, v) - action = "" - if k == "following" and tipo == "Película": - continue - elif k == "following" and tipo == "Serie": - title = title.replace("seguir", "seguida") - if k != marked: - title = "Seguir serie" - action = "marcar" - marcarlist.insert(1, new_item.clone(action=action, title=title, text_color=color4, ficha=ficha, - folder=False)) - continue - - marcarlist.append(new_item.clone(action="marcar", title=title, text_color=color3, ficha=ficha, - folder=False)) - except: - pass - - try: - if season and item.contentType == "tvshow": - seasonlist = [] - for k, v in data["Data"]["Episodes"].items(): - vistos = False - season = k.rsplit("_", 1)[1] - if type(v) is str: - continue - elif type(v["Item"]) is not list: - v["Item"] = [v["Item"]] - - for epi in v["Item"]: - if epi["EpisodeViewed"] == "no": - vistos = True - seasonlist.append( - new_item.clone(action="marcar", title="Marcar temporada %s como vista" % season, - text_color=color1, season=int(season), ficha=ficha, folder=False)) - break - - if not vistos: - seasonlist.append( - new_item.clone(action="marcar", title="Temporada %s ya vista. ¿Revertir?" % season, - text_color=color1, season=int(season), ficha=ficha, folder=False)) - - seasonlist.sort(key=lambda it: it.season, reverse=True) - marcarlist.extend(seasonlist) - except: - pass - return marcarlist - - -def acciones_cuenta(item): - logger.info() - itemlist = [] - - if "Tus fichas" in item.title: - itemlist.append(item.clone(title="Capítulos", url="tf_block_c a", contentType="tvshow")) - itemlist.append(item.clone(title="Series", url="tf_block_s", contentType="tvshow")) - itemlist.append(item.clone(title="Películas", url="tf_block_p")) - itemlist.append(item.clone(title="Documentales", url="tf_block_d")) - return itemlist - elif "Añadir a una lista" in item.title: - data = httptools.downloadpage(host + "/c_listas.php?apikey=%s&sid=%s" % (apikey, sid)).data - data = xml2dict(data) - itemlist.append(item.clone(title="Crear nueva lista", folder=False)) - if data["Data"]["TusListas"] != "\t": - import random - data = data["Data"]["TusListas"]["Item"] - if type(data) is not list: - data = [data] - for child in data: - image = "" - title = "%s (%s fichas)" % (child["Title"], child["FichasInList"]) - images = [] - for i in range(1, 5): - if "sinimagen.png" not in child["Poster%s" % i]: - images.append(child["Poster%s" % i].replace("/100/", "/400/")) - if images: - image = images[random.randint(0, len(images) - 1)] - url = host + "/data.php?mode=add_listas&apikey=%s&sid=%s&ficha_id=%s" % (apikey, sid, item.ficha) - post = "lista_id[]=%s" % child["Id"] - itemlist.append(item.clone(title=title, url=url, post=post, thumbnail=image, folder=False)) - - return itemlist - elif "Crear nueva lista" in item.title: - from platformcode import platformtools - nombre = platformtools.dialog_input("", "Introduce un nombre para la lista") - if nombre: - dict_priv = {0: 'Pública', 1: 'Privada'} - priv = platformtools.dialog_select("Privacidad de la lista", ['Pública', 'Privada']) - if priv != -1: - url = host + "/data.php?mode=create_list&apikey=%s&sid=%s" % (apikey, sid) - post = "name=%s&private=%s" % (nombre, priv) - data = httptools.downloadpage(url, post) - platformtools.dialog_notification("Lista creada correctamente", - "Nombre: %s - %s" % (nombre, dict_priv[priv])) - platformtools.itemlist_refresh() - return - elif re.search(r"(?i)Seguir Lista", item.title): - from platformcode import platformtools - data = httptools.downloadpage(item.url) - platformtools.dialog_notification("Operación realizada con éxito", "Lista: %s" % item.lista) - return - elif item.post: - from platformcode import platformtools - data = httptools.downloadpage(item.url, item.post).data - platformtools.dialog_notification("Ficha añadida a la lista", "Lista: %s" % item.title) - platformtools.itemlist_refresh() - return - - data = httptools.downloadpage("https://playmax.mx/tusfichas.php").data - data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) - - bloque = scrapertools.find_single_match(data, item.url + '">(.*?)(?:<div class="tf_blocks|<div class="tf_o_move">)') - matches = scrapertools.find_multiple_matches(bloque, '<div class="tf_menu_mini">([^<]+)<(.*?)<cb></cb></div>') - for category, contenido in matches: - itemlist.append(item.clone(action="", title=category, text_color=color3)) - - patron = '<div class="c_fichas_image"[^>]*>[^<]*<[^>]+href="\.([^"]+)".*?src="([^"]+)".*?serie="([^"]*)".*?' \ - '<div class="c_fichas_title">(?:<div class="c_fichas_episode">([^<]+)</div>|)([^<]+)</div>' - entradas = scrapertools.find_multiple_matches(contenido, patron) - for scrapedurl, scrapedthumbnail, serie, episodio, scrapedtitle in entradas: - tipo = "movie" - scrapedurl = host + scrapedurl - scrapedthumbnail = host + scrapedthumbnail - action = "findvideos" - if __menu_info__: - action = "menu_info" - if serie: - tipo = "tvshow" - if episodio: - title = " %s - %s" % (episodio.replace("X", "x"), scrapedtitle) - else: - title = " " + scrapedtitle - - new_item = Item(channel=item.channel, action=action, title=title, url=scrapedurl, - thumbnail=scrapedthumbnail, contentTitle=scrapedtitle, contentType=tipo, - text_color=color2) - if new_item.contentType == "tvshow": - new_item.show = scrapedtitle - if not __menu_info__: - new_item.action = "episodios" - - itemlist.append(new_item) - - return itemlist - - -def marcar(item): - logger.info() - - if "Capítulo" in item.title: - url = "%s/data.php?mode=capitulo_visto&apikey=%s&sid=%s&c_id=%s" % (host, apikey, sid, item.epi_id) - message = item.title.replace("no", "marcado como").replace("ya", "cambiado a no").replace(" ¿Cambiar?", "") - elif "temporada" in item.title.lower(): - type_marcado = "1" - if "como vista" in item.title: - message = "Temporada %s marcada como vista" % item.season - else: - type_marcado = "2" - message = "Temporada %s marcada como no vista" % item.season - url = "%s/data.php?mode=temporada_vista&apikey=%s&sid=%s&ficha=%s&t_id=%s&type=%s" \ - % (host, apikey, sid, item.ficha, item.season, type_marcado) - else: - message = item.title.replace("Marcar ", "Marcada ").replace("Seguir serie", "Serie en seguimiento") - if "favorita" in item.title: - url = "%s/data.php?mode=marcar_ficha&apikey=%s&sid=%s&ficha=%s&tipo=%s" \ - % (host, apikey, sid, item.ficha, "3") - elif "pendiente" in item.title: - url = "%s/data.php?mode=marcar_ficha&apikey=%s&sid=%s&ficha=%s&tipo=%s" \ - % (host, apikey, sid, item.ficha, "2") - elif "vista" in item.title: - url = "%s/data.php?mode=marcar_ficha&apikey=%s&sid=%s&ficha=%s&tipo=%s" \ - % (host, apikey, sid, item.ficha, "4") - elif "Seguir" in item.title: - url = "%s/data.php?mode=marcar_ficha&apikey=%s&sid=%s&ficha=%s&tipo=%s" \ - % (host, apikey, sid, item.ficha, "2") - data = httptools.downloadpage(url) - url = "%s/data.php?mode=marcar_ficha&apikey=%s&sid=%s&ficha=%s&tipo=%s" \ - % (host, apikey, sid, item.ficha, "1") - - data = httptools.downloadpage(url) - if data.sucess and config.get_platform() != "plex" and item.action != "play": - from platformcode import platformtools - platformtools.dialog_notification("Acción correcta", message) - - -def listas(item): - logger.info() - itemlist = [] - - data = httptools.downloadpage(item.url).data - data = xml2dict(data) - if item.extra == "listas": - itemlist.append(Item(channel=item.channel, title="Listas más seguidas", action="listas", text_color=color1, - url=item.url + "&orden=1", extra="listas_plus")) - itemlist.append(Item(channel=item.channel, title="Listas con más fichas", action="listas", text_color=color1, - url=item.url + "&orden=2", extra="listas_plus")) - itemlist.append(Item(channel=item.channel, title="Listas aleatorias", action="listas", text_color=color1, - url=item.url + "&orden=3", extra="listas_plus")) - if data["Data"]["ListasSiguiendo"] != "\t": - itemlist.append(Item(channel=item.channel, title="Listas que sigo", action="listas", text_color=color1, - url=item.url, extra="sigo")) - if data["Data"]["TusListas"] != "\t": - itemlist.append(Item(channel=item.channel, title="Mis listas", action="listas", text_color=color1, - url=item.url, extra="mislistas")) - - return itemlist - - elif item.extra == "sigo": - data = data["Data"]["ListasSiguiendo"]["Item"] - elif item.extra == "mislistas": - data = data["Data"]["TusListas"]["Item"] - else: - data = data["Data"]["Listas"]["Item"] - - if type(data) is not list: - data = [data] - import random - for child in data: - image = "" - title = "%s (%s fichas)" % (child["Title"], child["FichasInList"]) - images = [] - for i in range(1, 5): - if "sinimagen.png" not in child["Poster%s" % i]: - images.append(child["Poster%s" % i].replace("/100/", "/400/")) - if images: - image = images[random.randint(0, len(images) - 1)] - url = host + "/l%s" % child["Id"] - itemlist.append(Item(channel=item.channel, action="fichas", url=url, text_color=color3, - thumbnail=image, title=title, extra=item.extra)) - - if len(itemlist) == 20: - start = scrapertools.find_single_match(item.url, 'start=(\d+)') - end = int(start) + 20 - url = re.sub(r'start=%s' % start, 'start=%s' % end, item.url) - itemlist.append(item.clone(title=">> Página Siguiente", url=url)) - - return itemlist - - -def play(item): - logger.info() - from core import servertools - - devuelve = servertools.findvideos(item.url, True) - if devuelve: - item.url = devuelve[0][1] - item.server = devuelve[0][2] - - if config.get_setting("mark_play", "playmax"): - if item.contentType == "movie": - marcar(item.clone(title="marcar como vista")) - else: - marcar(item.clone(title="Capítulo", epi_id=item.cid)) - - return [item] - - -def select_page(item): - import xbmcgui - dialog = xbmcgui.Dialog() - number = dialog.numeric(0, "Introduce el número de página") - if number != "": - number = int(number) * 60 - item.url = re.sub(r'start=(\d+)', "start=%s" % number, item.url) - - return fichas(item) - - -def xml2dict(xmldata): - """ - Lee un fichero o texto XML y retorna un diccionario json - - Parametros: - file (str) -- Ruta completa al archivo XML que se desea convertir en JSON. - xmldata (str) -- Texto XML que se desea convertir en JSON. - - Retorna: - Un diccionario construido a partir de los campos del XML. - - """ - import sys - parse = globals().get(sys._getframe().f_code.co_name) - - matches = re.compile("<(?P<tag>[^>]+)>[\n]*[\s]*[\t]*(?P<value>.*?)[\n]*[\s]*[\t]*<\/(?P=tag)\s*>", - re.DOTALL).findall(xmldata) - - return_dict = {} - for tag, value in matches: - # Si tiene elementos - if "<" and "</" in value: - if tag in return_dict: - if type(return_dict[tag]) == list: - return_dict[tag].append(parse(value)) - else: - return_dict[tag] = [return_dict[tag]] - return_dict[tag].append(parse(value)) - else: - return_dict[tag] = parse(value) - - else: - if tag in return_dict: - if type(return_dict[tag]) == list: - return_dict[tag].append(value) - else: - return_dict[tag] = [return_dict[tag]] - return_dict[tag].append(value) - else: - if value in ["true", "false"]: - if value == "true": - value = True - else: - value = False - - return_dict[tag] = value - - return return_dict diff --git a/plugin.video.alfa/channels/seodiv.py b/plugin.video.alfa/channels/seodiv.py index 1ee0c90b..7d0dc343 100755 --- a/plugin.video.alfa/channels/seodiv.py +++ b/plugin.video.alfa/channels/seodiv.py @@ -248,15 +248,15 @@ def findvideos(item): if int(idl)<5 and int(idl)!=1: lang.append(scrapedlang) i=0 - logger.info(lang) + if len(lang)!=0: + lang.reverse() for videoitem in video_items: videoitem.thumbnail = servertools.guess_server_thumbnail(videoitem.server) - #videoitem.language = scrapertools.find_single_match(data, '<span class="f-info-title">Idioma:<\/span>\s*<span ' - # 'class="f-info-text">(.*?)<\/span>') - if len(lang)<=i: + if i<len(lang) and len(lang)!=0: videoitem.language=lang[i] else: - videoitem.language=lang[len(lang)-1] + videoitem.language = scrapertools.find_single_match(data, '<span class=f-info-title>Idioma:<\/span>\s*<span ' + 'class=f-info-text>(.*?)<\/span>') videoitem.title = item.contentSerieName + ' (' + videoitem.server + ') (' + videoitem.language + ')' videoitem.quality = 'default' videoitem.context = item.context diff --git a/plugin.video.alfa/channels/seriesblanco.py b/plugin.video.alfa/channels/seriesblanco.py index 15008287..88769f89 100644 --- a/plugin.video.alfa/channels/seriesblanco.py +++ b/plugin.video.alfa/channels/seriesblanco.py @@ -13,7 +13,6 @@ from platformcode import config, logger from channels import autoplay - HOST = "https://seriesblanco.com/" IDIOMAS = {'es': 'Español', 'en': 'Inglés', 'la': 'Latino', 'vo': 'VO', 'vos': 'VOS', 'vosi': 'VOSI', 'otro': 'OVOS'} list_idiomas = IDIOMAS.values() @@ -97,6 +96,7 @@ def extract_series_from_data(item, data): except UnicodeError: name = unicode(name, "iso-8859-1", errors="replace").encode("utf-8") + name = name.strip() # logger.debug("Show found: %s -> %s (%s)" % (name, url, img)) if not episode_pattern.search(url): action = "episodios" @@ -187,6 +187,7 @@ def search(item, texto): "id=['\"]q2[1\"] name=['\"]q2['\"] value=['\"](?P<title>.*?)['\"]", data) for url, img, title in shows: + title = title.strip() itemlist.append(item.clone(title=title, url=urlparse.urljoin(HOST, url), action="episodios", show=title, thumbnail=img, context=filtertools.context(item, list_idiomas, CALIDADES))) diff --git a/plugin.video.alfa/channels/sipeliculas.json b/plugin.video.alfa/channels/sipeliculas.json index d0549042..573444a1 100755 --- a/plugin.video.alfa/channels/sipeliculas.json +++ b/plugin.video.alfa/channels/sipeliculas.json @@ -18,6 +18,14 @@ "enabled": false, "visible": false }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", @@ -43,4 +51,4 @@ "visible": true } ] -} \ No newline at end of file +} diff --git a/plugin.video.alfa/channels/sipeliculas.py b/plugin.video.alfa/channels/sipeliculas.py index 9d8a56e4..7b4ca689 100755 --- a/plugin.video.alfa/channels/sipeliculas.py +++ b/plugin.video.alfa/channels/sipeliculas.py @@ -147,7 +147,7 @@ def newest(categoria): itemlist = [] item = Item() try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + '/cartelera/' elif categoria == 'infantiles': item.url = host + "/online/animacion" @@ -167,4 +167,4 @@ def newest(categoria): logger.error("{0}".format(line)) return [] - return itemlist \ No newline at end of file + return itemlist diff --git a/plugin.video.alfa/channels/tiotorrent.json b/plugin.video.alfa/channels/tiotorrent.json index 608e634d..9f449f6b 100644 --- a/plugin.video.alfa/channels/tiotorrent.json +++ b/plugin.video.alfa/channels/tiotorrent.json @@ -20,6 +20,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/tiotorrent.py b/plugin.video.alfa/channels/tiotorrent.py index 22048844..1e34cd37 100644 --- a/plugin.video.alfa/channels/tiotorrent.py +++ b/plugin.video.alfa/channels/tiotorrent.py @@ -270,10 +270,18 @@ def newest(category): logger.info() item = Item() try: - if category == 'peliculas': + if category in ['peliculas', 'torrent']: item.url = host + 'estrenos-de-cine' item.extra='movie' - itemlist = lista(item) + itemlist = lista(item) + if itemlist[-1].title == 'Siguiente >>>': + itemlist.pop() + if category == 'torrent': + + item.url = host+'series' + item.extra = 'serie' + itemlist.extend(lista(item)) + if itemlist[-1].title == 'Siguiente >>>': itemlist.pop() except: diff --git a/plugin.video.alfa/channels/torrentlocura.json b/plugin.video.alfa/channels/torrentlocura.json index a14b4d6a..185a1fb7 100755 --- a/plugin.video.alfa/channels/torrentlocura.json +++ b/plugin.video.alfa/channels/torrentlocura.json @@ -13,13 +13,21 @@ "tvshow" ], "settings": [ - { - "id": "include_in_global_search", - "type": "bool", - "label": "Incluir en busqueda global", - "default": true, - "enabled": true, - "visible": true - } + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true + } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/torrentlocura.py b/plugin.video.alfa/channels/torrentlocura.py index ba8ebbfd..e83bc956 100755 --- a/plugin.video.alfa/channels/torrentlocura.py +++ b/plugin.video.alfa/channels/torrentlocura.py @@ -464,3 +464,30 @@ def play(item): itemlist = [item] return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + item.pattern = 'pelilist' + if categoria == 'torrent': + item.url = host+'peliculas/' + + itemlist = listado(item) + if itemlist[-1].title == ">> Página siguiente": + itemlist.pop() + item.url = host+'series/' + itemlist.extend(listado(item)) + if itemlist[-1].title == ">> Página 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 + diff --git a/plugin.video.alfa/channels/trailertools.py b/plugin.video.alfa/channels/trailertools.py index 9f592c78..7168101e 100755 --- a/plugin.video.alfa/channels/trailertools.py +++ b/plugin.video.alfa/channels/trailertools.py @@ -158,14 +158,13 @@ def youtube_search(item): titulo = urllib.quote(titulo) titulo = titulo.replace("%20", "+") data = scrapertools.downloadpage("https://www.youtube.com/results?sp=EgIQAQ%253D%253D&q=" + titulo) - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - patron = '<span class="yt-thumb-simple">.*?(?:src="https://i.ytimg.com/|data-thumb="https://i.ytimg.com/)([^"]+)"' \ - '.*?<h3 class="yt-lockup-title ">.*?<a href="([^"]+)".*?title="([^"]+)".*?' \ - '</a><span class="accessible-description".*?>.*?(\d+:\d+)' + patron = """"thumbnails":\[\{"url":"(https://i.ytimg.com/vi[^"]+).*?""" + patron += """simpleText":"([^"]+).*?""" + patron += """simpleText":"[^"]+.*?simpleText":"([^"]+).*?""" + patron += """url":"([^"]+)""" matches = scrapertools.find_multiple_matches(data, patron) - for scrapedthumbnail, scrapedurl, scrapedtitle, scrapedduration in matches: - scrapedthumbnail = urlparse.urljoin("https://i.ytimg.com/", scrapedthumbnail) + for scrapedthumbnail, scrapedtitle, scrapedduration, scrapedurl in matches: scrapedtitle = scrapedtitle.decode("utf-8") scrapedtitle = scrapedtitle + " (" + scrapedduration + ")" if item.contextual: diff --git a/plugin.video.alfa/channels/ultrapeliculashd.json b/plugin.video.alfa/channels/ultrapeliculashd.json index 184a5f4a..39b42b2d 100755 --- a/plugin.video.alfa/channels/ultrapeliculashd.json +++ b/plugin.video.alfa/channels/ultrapeliculashd.json @@ -19,6 +19,14 @@ "enabled": true, "visible": true }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true + }, { "id": "include_in_newest_peliculas", "type": "bool", diff --git a/plugin.video.alfa/channels/ultrapeliculashd.py b/plugin.video.alfa/channels/ultrapeliculashd.py index e1093573..38575772 100755 --- a/plugin.video.alfa/channels/ultrapeliculashd.py +++ b/plugin.video.alfa/channels/ultrapeliculashd.py @@ -251,7 +251,7 @@ def newest(categoria): item = Item() item.extra = 'estrenos/' try: - if categoria == 'peliculas': + if categoria in ['peliculas','latino']: item.url = host + '/genre/estrenos/' elif categoria == 'infantiles': diff --git a/plugin.video.alfa/channels/vernovelasonline.json b/plugin.video.alfa/channels/vernovelasonline.json deleted file mode 100644 index f2cf60e2..00000000 --- a/plugin.video.alfa/channels/vernovelasonline.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "vernovelasonline", - "name": "Ver Novelas Online", - "active": true, - "adult": false, - "language": ["cast", "lat"], - "thumbnail": "https://s16.postimg.org/g4lzydrmd/vernovelasonline1.png", - "banner": "https://s16.postimg.org/w44nhxno5/vernovelasonline2.png", - "categories": [ - "tvshow" - ], - "settings": [ - { - "id": "include_in_global_search", - "type": "bool", - "label": "Incluir en busqueda global", - "default": true, - "enabled": true, - "visible": true - } - ] -} diff --git a/plugin.video.alfa/channels/vernovelasonline.py b/plugin.video.alfa/channels/vernovelasonline.py deleted file mode 100644 index b08d50f1..00000000 --- a/plugin.video.alfa/channels/vernovelasonline.py +++ /dev/null @@ -1,216 +0,0 @@ -# -*- coding: utf-8 -*- - -from core import httptools -from core import scrapertools -from core import servertools -from core.item import Item -from platformcode import logger - -host = "http://ver-novelas-online.com/" - -def mainlist(item): - logger.info() - itemlist = [] - itemlist.append(Item(channel = item.channel, title = "Ultimos capitulos subidos", action = "capitulos_ultimos", url = host)) - itemlist.append(Item(channel = item.channel, title = "Novelas por letra", action = "novelas_letra", url = host + "video/category/letra-" )) - itemlist.append(Item(channel = item.channel, title = "Novelas en emision (Sin caratulas)", action = "novelas_emision", url = host)) - itemlist.append(Item(channel = item.channel, title = "")) - itemlist.append(Item(channel = item.channel, title = "Buscar novela", action = "search", url = host + "?s=")) - return itemlist - -def newest(categoria): - logger.info() - itemlist = [] - item = Item() - try: - item.channel = "vernovelasonline" - item.extra = "newest" - item.url = "http://www.ver-novelas-online.com/" - item.action = "capitulos_ultimos" - itemlist = capitulos_ultimos(item) - # Se captura la excepcion, 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 novelas_emision(item): - logger.info() - itemlist = [] - data = httptools.downloadpage(item.url).data - data = data.replace("\n","") - block = scrapertools.find_single_match(data, '<aside id="text-2.*?</aside>') - match = scrapertools.find_multiple_matches(block, 'a href="([^"]+)">([^<]+)') - for url, titulo in match: - itemlist.append(Item(channel = item.channel, - action = "capitulos_de_una_novela", - title = titulo, - url = url, - extra1 = titulo - )) - return itemlist - -def novelas_letra(item): - logger.info() - itemlist = [] - for letra in "abcdefghijklmnopqrstuvwxyz": - itemlist.append(item.clone(title = letra.upper(), url = item.url+letra, action = "lista")) - return itemlist - - -def search(item, texto): - logger.info() - texto = texto.replace(" ","+") - item.url = "http://ver-novelas-online.com/?s=" + texto - item.extra = "busca" - if texto!='': - return lista(item) - else: - return [] - - -def lista(item): - logger.info() - itemlist = [] - data = httptools.downloadpage(item.url).data - data = data.replace("\n","") - accion = "capitulos_de_una_novela" - patron = """itemprop="url" href="([^"]+)".*?mark">([^<]*)</a>.*?href="([^"]+)""" - if item.extra == "busca": - patron = """itemprop="url" href="([^"]+)".*?mark">([^<]*)</a>.*?href='([^']+)""" - accion = "findvideos" - matches = scrapertools.find_multiple_matches(data, patron) - for url, title, thumbnail in matches: - mtitle = title.replace("CAPITULOS COMPLETOS","").title() - mextra1 = scrapertools.find_single_match(mtitle, "(?i)(.*?) Capitulo") - mextra2 = scrapertools.find_single_match(mtitle, "(?i)(cap.*?[0-9]+)").title() - if mextra1 == "": - mextra1 = mextra2 = mtitle - itemlist.append(Item(channel = item.channel, - action = accion, - title = mtitle, - url = url, - thumbnail = thumbnail, - fantart = thumbnail, - plot = "prueba de plot", - extra1 = mextra1, - extra2 = mextra2 - )) - mpagina = scrapertools.find_single_match(data, 'page-numbers" href="([^"]+)') - pagina = scrapertools.find_single_match(mpagina, "page/([0-9]+)") - if len(pagina)>0 and "busca" not in item.extra: - itemlist.append( - Item(channel = item.channel, - action = "lista", - title = "Pagina: "+pagina, - url = mpagina, - extra = item.extra - )) - return itemlist - -def capitulos_ultimos(item): - logger.info() - itemlist = [] - data = httptools.downloadpage(item.url).data - data = data.replace("\n","") - patron = "<div class='item'>.*?<a href='([^']+)" - patron += ".*?title='([^']+)" - patron += ".*?img src='([^']+)" - matches = scrapertools.find_multiple_matches(data,patron) - for url, title, thumbnail in matches: - mextra1 = scrapertools.find_single_match(title, "(?i)(.*?) Capitulo") - mextra2 = scrapertools.find_single_match(title, "(?i)(cap.*?[0-9]+)").title() - itemlist.append( - Item(channel = item.channel, - action = "findvideos", - title = title.title(), - url = url, - thumbnail = thumbnail, - extra1 = mextra1, - extra2 = mextra2 - )) - mpagina = scrapertools.find_single_match(data, 'next" href="([^"]+)') - pagina = scrapertools.find_single_match(mpagina, "page/([0-9]+)") - if "newest" not in item.extra: - itemlist.append( - Item(channel = item.channel, - action = "capitulos_ultimos", - title = "Pagina: "+pagina, - url = mpagina - )) - return itemlist - -def capitulos_de_una_novela(item): - logger.info() - itemlist = [] - url = item.url - data = httptools.downloadpage(url).data - if len(item.thumbnail) == 0: - item.thumbnail = scrapertools.find_single_match(data, 'og:image" content="([^"]+)' ) - matches = scrapertools.find_multiple_matches(data, '<a target="_blank" href="([^"]+)">([^<]+)') - - for url, titulo in matches: - mextra2 = scrapertools.find_single_match(titulo,"(?i)(cap.*?[0-9]+)") - itemlist.append( - Item(channel = item.channel, - action = "findvideos", - title = titulo, - thumbnail = item.thumbnail, - url = url, - extra1 = item.extra1, - extra2 = mextra2 - )) - itemlist.append(Item(channel = item.channel, title = "Novela: [COLOR=blue]" + item.extra1 + "[/COLOR]")) - # PARA INVERTIR EL ORDEN DE LA LISTA - itemlist = itemlist[::-1] - return itemlist - -def findvideos(item): - data = httptools.downloadpage(item.url).data - data = data.replace(""","").replace("\n","").replace("\\","") - itemlist = servertools.find_video_items(data = data) - for video in itemlist: - video.channel = item.channel - video.action = "play" - video.thumbnail = item.thumbnail - video.fulltitle = item.extra1 + " / " +item.extra2 - video.title = "Ver en: " + video.server - itemlist.append(Item(channel = item.channel) ) - block = scrapertools.find_single_match(data, '<div class="btn-group-justified">.*?</div>') - if len(block)>0: - matches = scrapertools.find_multiple_matches(block, 'href="([^"]+).*?hidden-xs">([^<]+)') - for url, xs in matches: - accion = "findvideos" - capitulo = scrapertools.find_single_match(url, "capitulo-([^/]+)") - if "DE CAPITULOS" in xs: - xs = "LISTA" + xs + ": " + item.extra1 - accion = "capitulos_de_una_novela" - else: - xs += ": " + capitulo - capitulo = "Capitulo " + capitulo - itemlist.append( - Item(channel = item.channel, - title = "[COLOR=yellow]" + xs.title() + "[/COLOR]", - action = accion, - url = url, - thumbnail = item.thumbnail, - extra1 = item.extra1, - extra2 = capitulo - )) - else: - url = scrapertools.find_single_match(data, "<p><a href='(.*?)'\s+style='float:right") - capitulo = scrapertools.find_single_match(item.extra2, "(?i)capitulo ([^/]+)") - itemlist.append( - Item(channel = item.channel, - title = "[COLOR=yellow]" + "" + "Listado de Capitulos: "+item.extra1.title() +"[/COLOR]", - action = "capitulos_de_una_novela", - url = url, - thumbnail = item.thumbnail, - extra1 = item.extra1, - extra2 = capitulo - )) - return itemlist diff --git a/plugin.video.alfa/channels/verpeliculasnuevas.json b/plugin.video.alfa/channels/verpeliculasnuevas.json index 428bd60f..a2bae6c3 100755 --- a/plugin.video.alfa/channels/verpeliculasnuevas.json +++ b/plugin.video.alfa/channels/verpeliculasnuevas.json @@ -35,7 +35,15 @@ { "id": "include_in_newest_peliculas", "type": "bool", - "label": "Incluir en Novedades - Peliculas", + "label": "Incluir en Novedades - Películas", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_documentales", + "type": "bool", + "label": "Incluir en Novedades - Documentales", "default": true, "enabled": true, "visible": true @@ -47,6 +55,30 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_terror", + "type": "bool", + "label": "Incluir en Novedades - terror", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/verpeliculasnuevas.py b/plugin.video.alfa/channels/verpeliculasnuevas.py index 691c39b0..0702bb83 100755 --- a/plugin.video.alfa/channels/verpeliculasnuevas.py +++ b/plugin.video.alfa/channels/verpeliculasnuevas.py @@ -378,6 +378,19 @@ def newest(categoria): item.url = host elif categoria == 'infantiles': item.url = host + '/genero/infantil/' + + elif categoria == 'documentales': + item.url = host + '/genero/documental/' + + elif categoria == 'terror': + item.url = host + '/genero/terror/' + + elif categoria == 'castellano': + item.url = host + "/audio/castellano/" + + elif categoria == 'latino': + item.url = host + "/audio/latino/" + itemlist = lista(item) if itemlist[-1].title == 'Siguiente >>>': itemlist.pop() diff --git a/plugin.video.alfa/channels/verpelis.json b/plugin.video.alfa/channels/verpelis.json index 83033a2f..110e4f54 100644 --- a/plugin.video.alfa/channels/verpelis.json +++ b/plugin.video.alfa/channels/verpelis.json @@ -43,6 +43,22 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_castellano", + "type": "bool", + "label": "Incluir en Novedades - Castellano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_latino", + "type": "bool", + "label": "Incluir en Novedades - Latino", + "default": true, + "enabled": true, + "visible": true } ] } \ No newline at end of file diff --git a/plugin.video.alfa/channels/verpelis.py b/plugin.video.alfa/channels/verpelis.py index 5f9a2ac7..c2b5405b 100644 --- a/plugin.video.alfa/channels/verpelis.py +++ b/plugin.video.alfa/channels/verpelis.py @@ -208,6 +208,11 @@ def newest(categoria): item.url = host + '/ver/' elif categoria == 'terror': item.url = host + "/categoria/de-terror.htm" + elif categoria == 'castellano': + item.url = host + "/ver/espanol/" + + elif categoria == 'latino': + item.url = host + "/ver/latino/" else: return [] diff --git a/plugin.video.alfa/channels/zonatorrent.json b/plugin.video.alfa/channels/zonatorrent.json index add8e331..31f31200 100644 --- a/plugin.video.alfa/channels/zonatorrent.json +++ b/plugin.video.alfa/channels/zonatorrent.json @@ -51,6 +51,14 @@ "default": true, "enabled": true, "visible": true + }, + { + "id": "include_in_newest_torrent", + "type": "bool", + "label": "Incluir en Novedades - Torrent", + "default": true, + "enabled": true, + "visible": true } ] } diff --git a/plugin.video.alfa/channels/zonatorrent.py b/plugin.video.alfa/channels/zonatorrent.py index 9835fee9..d3a85b28 100644 --- a/plugin.video.alfa/channels/zonatorrent.py +++ b/plugin.video.alfa/channels/zonatorrent.py @@ -178,6 +178,8 @@ def newest(categoria): item.url = HOST + "/animacion" elif categoria == 'terror': item.url = HOST + "/terror/" + elif categoria == 'torrent': + item.url = HOST + "/?s=torrent" else: return [] diff --git a/plugin.video.alfa/core/tmdb.py b/plugin.video.alfa/core/tmdb.py index 5453dcea..a4e49866 100755 --- a/plugin.video.alfa/core/tmdb.py +++ b/plugin.video.alfa/core/tmdb.py @@ -754,7 +754,7 @@ class Tmdb(object): self.texto_buscado = kwargs.get('texto_buscado', '') self.busqueda_id = kwargs.get('id_Tmdb', '') - self.busqueda_texto = re.sub('\[\\\?(B|I|COLOR)\s?[^\]]*\]', '', self.texto_buscado) + self.busqueda_texto = re.sub('\[\\\?(B|I|COLOR)\s?[^\]]*\]', '', self.texto_buscado).strip() self.busqueda_tipo = kwargs.get('tipo', '') self.busqueda_idioma = kwargs.get('idioma_busqueda', 'es') self.busqueda_include_adult = kwargs.get('include_adult', False) @@ -839,7 +839,7 @@ class Tmdb(object): if tipo not in cls.dic_generos[idioma]: cls.dic_generos[idioma][tipo] = {} - url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=6889f6089877fd092454d00edb44a84d&language=%s' + url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s' % (tipo, idioma)) try: logger.info("[Tmdb.py] Rellenando dicionario de generos") @@ -856,17 +856,17 @@ class Tmdb(object): if self.busqueda_id: if source == "tmdb": - # http://api.themoviedb.org/3/movie/1924?api_key=6889f6089877fd092454d00edb44a84d&language=es + # http://api.themoviedb.org/3/movie/1924?api_key=a1ab8b8669da03637a4b98fa39c39228&language=es # &append_to_response=images,videos,external_ids,credits&include_image_language=es,null - # http://api.themoviedb.org/3/tv/1407?api_key=6889f6089877fd092454d00edb44a84d&language=es + # http://api.themoviedb.org/3/tv/1407?api_key=a1ab8b8669da03637a4b98fa39c39228&language=es # &append_to_response=images,videos,external_ids,credits&include_image_language=es,null - url = ('http://api.themoviedb.org/3/%s/%s?api_key=6889f6089877fd092454d00edb44a84d&language=%s' + url = ('http://api.themoviedb.org/3/%s/%s?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s' '&append_to_response=images,videos,external_ids,credits&include_image_language=%s,null' % (self.busqueda_tipo, self.busqueda_id, self.busqueda_idioma, self.busqueda_idioma)) buscando = "id_Tmdb: %s" % self.busqueda_id else: - # http://api.themoviedb.org/3/find/%s?external_source=imdb_id&api_key=6889f6089877fd092454d00edb44a84d - url = ('http://api.themoviedb.org/3/find/%s?external_source=%s&api_key=6889f6089877fd092454d00edb44a84d' + # http://api.themoviedb.org/3/find/%s?external_source=imdb_id&api_key=a1ab8b8669da03637a4b98fa39c39228 + url = ('http://api.themoviedb.org/3/find/%s?external_source=%s&api_key=a1ab8b8669da03637a4b98fa39c39228' '&language=%s' % (self.busqueda_id, source, self.busqueda_idioma)) buscando = "%s: %s" % (source.capitalize(), self.busqueda_id) @@ -898,9 +898,9 @@ class Tmdb(object): buscando = "" if self.busqueda_texto: - # http://api.themoviedb.org/3/search/movie?api_key=6889f6089877fd092454d00edb44a84d&query=superman&language=es + # http://api.themoviedb.org/3/search/movie?api_key=a1ab8b8669da03637a4b98fa39c39228&query=superman&language=es # &include_adult=false&page=1 - url = ('http://api.themoviedb.org/3/search/%s?api_key=6889f6089877fd092454d00edb44a84d&query=%s&language=%s' + url = ('http://api.themoviedb.org/3/search/%s?api_key=a1ab8b8669da03637a4b98fa39c39228&query=%s&language=%s' '&include_adult=%s&page=%s' % (self.busqueda_tipo, self.busqueda_texto.replace(' ', '%20'), self.busqueda_idioma, self.busqueda_include_adult, page)) @@ -961,8 +961,8 @@ class Tmdb(object): for key, value in self.discover.items(): if key != "url": params.append(key + "=" + str(value)) - # http://api.themoviedb.org/3/discover/movie?api_key=6889f6089877fd092454d00edb44a84d&query=superman&language=es - url = ('http://api.themoviedb.org/3/%s?api_key=6889f6089877fd092454d00edb44a84d&%s' + # http://api.themoviedb.org/3/discover/movie?api_key=a1ab8b8669da03637a4b98fa39c39228&query=superman&language=es + url = ('http://api.themoviedb.org/3/%s?api_key=a1ab8b8669da03637a4b98fa39c39228&%s' % (type_search, "&".join(params))) logger.info("[Tmdb.py] Buscando %s:\n%s" % (type_search, url)) @@ -1116,7 +1116,7 @@ class Tmdb(object): else: self.busqueda_idioma = self.result['original_language'] - url = ('http://api.themoviedb.org/3/%s/%s?api_key=6889f6089877fd092454d00edb44a84d&language=%s' % + url = ('http://api.themoviedb.org/3/%s/%s?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s' % (self.busqueda_tipo, self.busqueda_id, self.busqueda_idioma)) resultado = self.get_json(url) @@ -1243,9 +1243,9 @@ class Tmdb(object): if not self.temporada.get(numtemporada, {}): # Si no hay datos sobre la temporada solicitada, consultar en la web - # http://api.themoviedb.org/3/tv/1407/season/1?api_key=6889f6089877fd092454d00edb44a84d&language=es& + # http://api.themoviedb.org/3/tv/1407/season/1?api_key=a1ab8b8669da03637a4b98fa39c39228&language=es& # append_to_response=credits - url = "http://api.themoviedb.org/3/tv/%s/season/%s?api_key=6889f6089877fd092454d00edb44a84d&language=%s" \ + url = "http://api.themoviedb.org/3/tv/%s/season/%s?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s" \ "&append_to_response=credits" % (self.result["id"], numtemporada, self.busqueda_idioma) buscando = "id_Tmdb: " + str(self.result["id"]) + " temporada: " + str(numtemporada) + "\nURL: " + url @@ -1361,7 +1361,7 @@ class Tmdb(object): self.result["videos"] = self.result["videos"]['results'] else: # Primera búsqueda de videos en el idioma de busqueda - url = "http://api.themoviedb.org/3/%s/%s/videos?api_key=6889f6089877fd092454d00edb44a84d&language=%s" \ + url = "http://api.themoviedb.org/3/%s/%s/videos?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s" \ % (self.busqueda_tipo, self.result['id'], self.busqueda_idioma) dict_videos = self.get_json(url) @@ -1372,7 +1372,7 @@ class Tmdb(object): # Si el idioma de busqueda no es ingles, hacer una segunda búsqueda de videos en inglés if self.busqueda_idioma != 'en': - url = "http://api.themoviedb.org/3/%s/%s/videos?api_key=6889f6089877fd092454d00edb44a84d" \ + url = "http://api.themoviedb.org/3/%s/%s/videos?api_key=a1ab8b8669da03637a4b98fa39c39228" \ % (self.busqueda_tipo, self.result['id']) dict_videos = self.get_json(url) diff --git a/plugin.video.alfa/platformcode/platformtools.py b/plugin.video.alfa/platformcode/platformtools.py index 522fac6c..1b20f372 100644 --- a/plugin.video.alfa/platformcode/platformtools.py +++ b/plugin.video.alfa/platformcode/platformtools.py @@ -135,7 +135,7 @@ def render_items(itemlist, parent_item): if item.fanart: fanart = item.fanart else: - fanart = os.path.join(config.get_runtime_path(), "fanart1.jpg") + fanart = os.path.join(config.get_runtime_path(), "fanart.jpg") # Creamos el listitem listitem = xbmcgui.ListItem(item.title) diff --git a/plugin.video.alfa/platformcode/xbmc_config_menu.py b/plugin.video.alfa/platformcode/xbmc_config_menu.py index 34226f97..6990071b 100755 --- a/plugin.video.alfa/platformcode/xbmc_config_menu.py +++ b/plugin.video.alfa/platformcode/xbmc_config_menu.py @@ -412,6 +412,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog): self.addControl(control) control.setVisible(False) + control.setLabel(c["label"]) # frodo fix s = self.values[c["id"]] if s is None: diff --git a/plugin.video.alfa/resources/media/channels/banner/grantorrent.png b/plugin.video.alfa/resources/media/channels/banner/grantorrent.png new file mode 100644 index 00000000..613bb77a Binary files /dev/null and b/plugin.video.alfa/resources/media/channels/banner/grantorrent.png differ diff --git a/plugin.video.alfa/resources/media/channels/banner/playmax.png b/plugin.video.alfa/resources/media/channels/banner/playmax.png deleted file mode 100755 index 195a4458..00000000 Binary files a/plugin.video.alfa/resources/media/channels/banner/playmax.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/channels/fanart/grantorrent.png b/plugin.video.alfa/resources/media/channels/fanart/grantorrent.png new file mode 100644 index 00000000..c6df9302 Binary files /dev/null and b/plugin.video.alfa/resources/media/channels/fanart/grantorrent.png differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/grantorrent.jpg b/plugin.video.alfa/resources/media/channels/thumb/grantorrent.jpg new file mode 100644 index 00000000..cc43f6f4 Binary files /dev/null and b/plugin.video.alfa/resources/media/channels/thumb/grantorrent.jpg differ diff --git a/plugin.video.alfa/resources/media/channels/thumb/playmax.png b/plugin.video.alfa/resources/media/channels/thumb/playmax.png deleted file mode 100644 index 6a78b473..00000000 Binary files a/plugin.video.alfa/resources/media/channels/thumb/playmax.png and /dev/null differ diff --git a/plugin.video.alfa/resources/media/themes/default/thumb_channels_spanish.png b/plugin.video.alfa/resources/media/themes/default/thumb_channels_spanish.png new file mode 100644 index 00000000..99c60bad Binary files /dev/null and b/plugin.video.alfa/resources/media/themes/default/thumb_channels_spanish.png differ diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/button-fo.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/button-fo.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/close.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/close.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/dialog-bg-solid-white.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/dialog-bg-solid-white.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/dialog-bg-solid.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/dialog-bg-solid.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/logo.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/logo.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/white.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/white.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/resources/skins/Default/media/Shortcut/white70.png b/plugin.video.alfa/resources/skins/Default/media/Shortcut/white70.png old mode 100755 new mode 100644 diff --git a/plugin.video.alfa/servers/datoporn.json b/plugin.video.alfa/servers/datoporn.json index b72b3f96..30df1f6d 100755 --- a/plugin.video.alfa/servers/datoporn.json +++ b/plugin.video.alfa/servers/datoporn.json @@ -4,7 +4,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "(?:datoporn.com|dato.porn)/(?:embed-|)([A-z0-9]+)", + "pattern": "(?:datoporn.com|dato.porn|datoporn.co)/(?:embed-|)([A-z0-9]+)", "url": "http://dato.porn/embed-\\1.html" } ] @@ -39,4 +39,4 @@ } ], "thumbnail": "http://i.imgur.com/tBSWudd.png?1" -} \ No newline at end of file +} diff --git a/plugin.video.alfa/servers/gvideo.json b/plugin.video.alfa/servers/gvideo.json index 4ca0b752..25d10bd8 100644 --- a/plugin.video.alfa/servers/gvideo.json +++ b/plugin.video.alfa/servers/gvideo.json @@ -7,6 +7,10 @@ "pattern": "(?s)https://youtube.googleapis.com.*?docid=([0-9a-zA-Z-_]+)", "url": "http://docs.google.com/get_video_info?docid=\\1" }, + { + "pattern": "(?s)http://docs.google.com/get_video_info.*?docid=([0-9a-zA-Z-_]+)", + "url": "http://docs.google.com/get_video_info?docid=\\1" + }, { "pattern": "(?s)https://(?:docs|drive).google.com/file/d/([^/]+)/preview", "url": "http://docs.google.com/get_video_info?docid=\\1" diff --git a/plugin.video.alfa/servers/powvideo.json b/plugin.video.alfa/servers/powvideo.json index b3a8b127..03dff2e3 100755 --- a/plugin.video.alfa/servers/powvideo.json +++ b/plugin.video.alfa/servers/powvideo.json @@ -4,8 +4,8 @@ "ignore_urls": [], "patterns": [ { - "pattern": "powvideo.net/(?:embed-|iframe-|preview-|)([a-z0-9]+)", - "url": "http://powvideo.net/\\1" + "pattern": "powvideo.(?:net|xyz)/(?:embed-|iframe-|preview-|)([a-z0-9]+)", + "url": "http://powvideo.net/iframe-\\1-954x562.html" } ] }, diff --git a/plugin.video.alfa/servers/powvideo.py b/plugin.video.alfa/servers/powvideo.py index f21cdacf..b18431a4 100755 --- a/plugin.video.alfa/servers/powvideo.py +++ b/plugin.video.alfa/servers/powvideo.py @@ -14,7 +14,9 @@ host = "http://powvideo.net/" def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data + referer = page_url.replace('iframe', 'preview') + data = httptools.downloadpage(page_url, headers={'referer': referer}).data + if "<title>watch " in data.lower(): return False, "[powvideo] El archivo no existe o ha sido borrado" if "el archivo ha sido borrado por no respetar" in data.lower(): @@ -26,55 +28,17 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) - url = page_url.replace(host, "http://powvideo.xyz/iframe-") + "-954x562.html" + referer = page_url.replace('iframe', 'preview') + data = httptools.downloadpage(page_url, headers={'referer': referer}).data - data = httptools.downloadpage(page_url, cookies=False) - cookie = data.headers['set-cookie'] - data = data.data + _0xa3e8 = scrapertools.find_single_match(data, 'var _0xa3e8=(\[[^;]+\]);') + packed = scrapertools.find_single_match(data, "") + unpacked = jsunpack.unpack(packed) - file_id, aff = scrapertools.find_single_match(data, "'file_id', '(\d+)',[^']+'aff', '(\d+)',") - _cookie = {"Cookie": cookie.replace("path=/; HttpOnly", "file_id=" + file_id + "; aff=" + aff)} - - id = scrapertools.find_single_match(data, 'name="id" value="([^"]+)"') - fname = scrapertools.find_single_match(data, 'name="fname" value="([^"]+)"') - hash = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)"') - - post = "op=download1&usr_login=&referer=&fname=%s&id=%s&hash=%s" % (fname, id, hash) - - import time - time.sleep(7) - data = httptools.downloadpage(page_url, post, headers=_cookie).data - - for list in scrapertools.find_multiple_matches(data, '_[^=]+=(\[[^\]]+\]);'): - if len(list) == 703 or len(list) == 711: - key = "".join(eval(list)[7:9]) - break - if key.startswith("embed"): - key = key[6:] + key[:6] - matches = scrapertools.find_single_match(data, "") - data = jsunpack.unpack(matches).replace("\\", "") - - data = scrapertools.find_single_match(data.replace('"', "'"), "sources\s*=[^\[]*\[([^\]]+)\]") - matches = scrapertools.find_multiple_matches(data, "[src|file]:'([^']+)'") video_urls = [] - for video_url in matches: - _hash = scrapertools.find_single_match(video_url, '[A-z0-9\_\-]{78,}') - hash = decrypt(_hash, key) - video_url = video_url.replace(_hash, hash) - filename = scrapertools.get_filename_from_url(video_url)[-4:] - if video_url.startswith("rtmp"): - rtmp, playpath = video_url.split("vod/", 1) - video_url = "%svod/ playpath=%s swfUrl=%splayer6/jwplayer.flash.swf pageUrl=%s" % \ - (rtmp, playpath, host, page_url) - filename = "RTMP" - elif video_url.endswith(".m3u8"): - video_url += "|User-Agent=" + headers[0][1] - elif video_url.endswith("/v.mp4"): - video_url_flv = re.sub(r'/v.mp4', '/v.flv', video_url) - video_urls.append(["flv [powvideo]", video_url_flv]) - - video_urls.append([filename + " [powvideo]", video_url]) + url = scrapertools.find_single_match(unpacked, "(?:src):\\\\'([^\\\\]+.mp4)\\\\'") + video_urls.append([".mp4" + " [powvideo]", S(_0xa3e8).decode(url)]) video_urls.sort(key=lambda x: x[0], reverse=True) for video_url in video_urls: @@ -83,105 +47,323 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= return video_urls -def decrypt(h, k): - import base64 +class S: + def __init__(self, _0xa3e8): + self.r = None + self.s = None + self.k = None + self.n = None + self.c = None + self.b = None + self.d = None - if len(h) % 4: - h += "=" * (4 - len(h) % 4) - sig = [] - h = base64.b64decode(h.replace("-", "+").replace("_", "/")) - for c in range(len(h)): - sig += [ord(h[c])] + _0xa3e8 = eval(_0xa3e8) + self.t(_0xa3e8[14] + _0xa3e8[15] + _0xa3e8[14] + _0xa3e8[15], _0xa3e8[16]) - sec = [] - for c in range(len(k)): - sec += [ord(k[c])] + def decode(self, url): + _hash = re.compile('[A-z0-9_-]{40,}', re.DOTALL).findall(url)[0] + return url.replace(_hash, self.p(_hash)) - dig = range(256) - g = 0 - v = 128 - for b in range(len(sec)): - a = (v + (sec[b] & 15)) % 256 - c = dig[(g)] - dig[g] = dig[a] - dig[a] = c - g += 1 + def t(self, t, i): + self.r = 20 + self.s = [1634760805, 857760878, 2036477234, 1797285236] + self.k = [] + self.n = [0, 0] + self.c = [0, 0] + self.b = [None] * 64 + self.d = 64 - a = (v + (sec[b] >> 4 & 15)) % 256 - c = dig[g] - dig[g] = dig[a] - dig[a] = c - g += 1 + self.sk(self.sa(t)) + self.sn(self.sa(i)) - k = 0 - q = 1 - p = 0 - n = 0 - for b in range(512): - k = (k + q) % 256 - n = (p + dig[(n + dig[k]) % 256]) % 256 - p = (k + p + dig[n]) % 256 - c = dig[k] - dig[k] = dig[n] - dig[n] = c + def e(self, t): + s = self.gb(len(t)) + i = [s[h] ^ t[h] for h in range(len(t))] + return i - q = 3 - for a in range(v): - b = 255 - a - if dig[a] > dig[b]: - c = dig[a] - dig[a] = dig[b] - dig[b] = c + def p(self, t): + import base64 + t += "=" * (4 - len(t) % 4) + t = base64.b64decode(t.replace('-', '+').replace('_', '/')) + return self._as(self.e(self.sa(t))) - k = 0 - for b in range(512): - k = (k + q) % 256 - n = (p + dig[(n + dig[k]) % 256]) % 256 - p = (k + p + dig[n]) % 256 - c = dig[k] - dig[k] = dig[n] - dig[n] = c + @staticmethod + def sa(t): + s = [ord(t[i]) for i in range(len(t))] + return s - q = 5 - for a in range(v): - b = 255 - a - if dig[a] > dig[b]: - c = dig[a] - dig[a] = dig[b] - dig[b] = c + @staticmethod + def _as(t): + s = [chr(t[i]) for i in range(len(t))] + return ''.join(s) - k = 0 - for b in range(512): - k = (k + q) % 256 - n = (p + dig[(n + dig[k]) % 256]) % 256 - p = (k + p + dig[n]) % 256 - c = dig[k] - dig[k] = dig[n] - dig[n] = c + def sk(self, t): + s = 0 + for i in range(8): + self.k.append( + 255 & t[s] | self.lshift((255 & t[s + 1]), 8) | self.lshift((255 & t[s + 2]), 16) | self.lshift( + (255 & t[s + 3]), 24)) + s += 4 + self._r() - q = 7 - k = 0 - u = 0 - d = [] - for b in range(len(dig)): - k = (k + q) % 256 - n = (p + dig[(n + dig[k]) % 256]) % 256 - p = (k + p + dig[n]) % 256 - c = dig[k] - dig[k] = dig[n] - dig[n] = c - u = dig[(n + dig[(k + dig[(u + p) % 256]) % 256]) % 256] - d += [u] + def sn(self, t): + self.n[0] = 255 & t[0] | self.lshift((255 & t[1]), 8) | self.lshift((255 & t[2]), 16) | self.lshift( + (255 & t[3]), 24) + self.n[1] = 255 & t[4] | self.lshift((255 & t[5]), 8) | self.lshift((255 & t[6]), 16) | self.lshift( + (255 & t[7]), 24) + self._r() - c = [] - for f in range(len(d)): - try: - c += [(256 + (sig[f] - d[f])) % 256] - except: - break + def gb(self, t): + i = [None] * t - h = "" - for s in c: - h += chr(s) + for s in range(t): + if 64 == self.d: + self._g() + self._i() + self.d = 0 - return h + i[s] = self.b[self.d] + self.d += 1 + + return i + + def gh(self, t): + i = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'] + h = self.gb(t) + s = [i[self.rshift(h[b], 4) & 15] for b in range(len(h))] + s.append(i[15 & h[len(h)]]) + return ''.join(s) + + def _r(self): + self.c[0] = 0 + self.c[1] = 0 + self.d = 64 + + def _i(self): + self.c[0] = self.c[0] + 1 & 4294967295 + if 0 == self.c[0]: + self.c[1] = self.c[1] + 1 & 4294967295 + + def _g(self): + i = self.s[0] + s = self.k[0] + h = self.k[1] + b = self.k[2] + r = self.k[3] + n = self.s[1] + o = self.n[0] + e = self.n[1] + c = self.c[0] + p = self.c[1] + a = self.s[2] + f = self.k[4] + u = self.k[5] + g = self.k[6] + y = self.k[7] + k = self.s[3] + l = i + d = s + v = h + _ = b + A = r + w = n + C = o + S = e + j = c + m = p + q = a + x = f + z = u + B = g + D = y + E = k + + for F in range(0, self.r, 2): + # 0 + t = l + z + A ^= self.lshift(t, 7) | self.bshift(t, 25) + t = A + l + j ^= self.lshift(t, 9) | self.bshift(t, 23) + t = j + A + z ^= self.lshift(t, 13) | self.bshift(t, 19) + t = z + j + l ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 1 + t = w + d + m ^= self.lshift(t, 7) | self.bshift(t, 25) + t = m + w + B ^= self.lshift(t, 9) | self.bshift(t, 23) + t = B + m + d ^= self.lshift(t, 13) | self.bshift(t, 19) + t = d + B + w ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 2 + t = q + C + D ^= self.lshift(t, 7) | self.bshift(t, 25) + t = D + q + v ^= self.lshift(t, 9) | self.bshift(t, 23) + t = v + D + C ^= self.lshift(t, 13) | self.bshift(t, 19) + t = C + v + q ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 3 + t = E + x + _ ^= self.lshift(t, 7) | self.bshift(t, 25) + t = _ + E + S ^= self.lshift(t, 9) | self.bshift(t, 23) + t = S + _ + x ^= self.lshift(t, 13) | self.bshift(t, 19) + t = x + S + E ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 4 + t = l + _ + d ^= self.lshift(t, 7) | self.bshift(t, 25) + t = d + l + v ^= self.lshift(t, 9) | self.bshift(t, 23) + t = v + d + _ ^= self.lshift(t, 13) | self.bshift(t, 19) + t = _ + v + l ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 5 + t = w + A + C ^= self.lshift(t, 7) | self.bshift(t, 25) + t = C + w + S ^= self.lshift(t, 9) | self.bshift(t, 23) + t = S + C + A ^= self.lshift(t, 13) | self.bshift(t, 19) + t = A + S + w ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 6 + t = q + m + x ^= self.lshift(t, 7) | self.bshift(t, 25) + t = x + q + j ^= self.lshift(t, 9) | self.bshift(t, 23) + t = j + x + m ^= self.lshift(t, 13) | self.bshift(t, 19) + t = m + j + q ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 7 + t = E + D + z ^= self.lshift(t, 7) | self.bshift(t, 25) + t = z + E + B ^= self.lshift(t, 9) | self.bshift(t, 23) + t = B + z + D ^= self.lshift(t, 13) | self.bshift(t, 19) + t = D + B + E ^= self.lshift(t, 18) | self.bshift(t, 14) + + l += i + d += s + v += h + _ += b + A += r + w += n + C += o + S += e + j += c + m += p + q += a + x += f + z += u + B += g + D += y + E += k + + self.b[0] = self.bshift(l, 0) & 255 + self.b[1] = self.bshift(l, 8) & 255 + self.b[2] = self.bshift(l, 16) & 255 + self.b[3] = self.bshift(l, 24) & 255 + self.b[4] = self.bshift(d, 0) & 255 + self.b[5] = self.bshift(d, 8) & 255 + self.b[6] = self.bshift(d, 16) & 255 + self.b[7] = self.bshift(d, 24) & 255 + self.b[8] = self.bshift(v, 0) & 255 + self.b[9] = self.bshift(v, 8) & 255 + self.b[10] = self.bshift(v, 16) & 255 + self.b[11] = self.bshift(v, 24) & 255 + self.b[12] = self.bshift(_, 0) & 255 + self.b[13] = self.bshift(_, 8) & 255 + self.b[14] = self.bshift(_, 16) & 255 + self.b[15] = self.bshift(_, 24) & 255 + self.b[16] = self.bshift(A, 0) & 255 + self.b[17] = self.bshift(A, 8) & 255 + self.b[18] = self.bshift(A, 16) & 255 + self.b[19] = self.bshift(A, 24) & 255 + self.b[20] = self.bshift(w, 0) & 255 + self.b[21] = self.bshift(w, 8) & 255 + self.b[22] = self.bshift(w, 16) & 255 + self.b[23] = self.bshift(w, 24) & 255 + self.b[24] = self.bshift(C, 0) & 255 + self.b[25] = self.bshift(C, 8) & 255 + self.b[26] = self.bshift(C, 16) & 255 + self.b[27] = self.bshift(C, 24) & 255 + self.b[28] = self.bshift(S, 0) & 255 + self.b[29] = self.bshift(S, 8) & 255 + self.b[30] = self.bshift(S, 16) & 255 + self.b[31] = self.bshift(S, 24) & 255 + self.b[32] = self.bshift(j, 0) & 255 + self.b[33] = self.bshift(j, 8) & 255 + self.b[34] = self.bshift(j, 16) & 255 + self.b[35] = self.bshift(j, 24) & 255 + self.b[36] = self.bshift(m, 0) & 255 + self.b[37] = self.bshift(m, 8) & 255 + self.b[38] = self.bshift(m, 16) & 255 + self.b[39] = self.bshift(m, 24) & 255 + self.b[40] = self.bshift(q, 0) & 255 + self.b[41] = self.bshift(q, 8) & 255 + self.b[42] = self.bshift(q, 16) & 255 + self.b[43] = self.bshift(q, 24) & 255 + self.b[44] = self.bshift(x, 0) & 255 + self.b[45] = self.bshift(x, 8) & 255 + self.b[46] = self.bshift(x, 16) & 255 + self.b[47] = self.bshift(x, 24) & 255 + self.b[48] = self.bshift(z, 0) & 255 + self.b[49] = self.bshift(z, 8) & 255 + self.b[50] = self.bshift(z, 16) & 255 + self.b[51] = self.bshift(z, 24) & 255 + self.b[52] = self.bshift(B, 0) & 255 + self.b[53] = self.bshift(B, 8) & 255 + self.b[54] = self.bshift(B, 16) & 255 + self.b[55] = self.bshift(B, 24) & 255 + self.b[56] = self.bshift(D, 0) & 255 + self.b[57] = self.bshift(D, 8) & 255 + self.b[58] = self.bshift(D, 16) & 255 + self.b[59] = self.bshift(D, 24) & 255 + self.b[60] = self.bshift(E, 0) & 255 + self.b[61] = self.bshift(E, 8) & 255 + self.b[62] = self.bshift(E, 16) & 255 + self.b[63] = self.bshift(E, 24) & 255 + + def lshift(self, num, other): + lnum = self.ToInt32(num) + rnum = self.ToUint32(other) + shift_count = rnum & 0x1F + return self.ToInt32(lnum << shift_count) + + def rshift(self, num, other): + lnum = self.ToInt32(num) + rnum = self.ToUint32(other) + shift_count = rnum & 0x1F + return self.ToInt32(lnum >> shift_count) + + def bshift(self, num, other): + lnum = self.ToUint32(num) + rnum = self.ToUint32(other) + shift_count = rnum & 0x1F + return self.ToUint32(lnum >> shift_count) + + @staticmethod + def ToInt32(num): + int32 = num % 2 ** 32 + return int32 - 2 ** 32 if int32 >= 2 ** 31 else int32 + + @staticmethod + def ToUint32(num): + return num % 2 ** 32 diff --git a/plugin.video.alfa/servers/streamplay.py b/plugin.video.alfa/servers/streamplay.py index 32860478..0a2c6547 100644 --- a/plugin.video.alfa/servers/streamplay.py +++ b/plugin.video.alfa/servers/streamplay.py @@ -24,39 +24,343 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) + referer = re.sub(r"embed-|player-", "", page_url)[:-5] data = httptools.downloadpage(page_url, headers={'Referer': referer}).data - matches = scrapertools.find_single_match(data, "") - data = jsunpack.unpack(matches).replace("\\", "") + packed = scrapertools.find_single_match(data, "") + unpacked = jsunpack.unpack(packed) + _0xd003 = scrapertools.find_single_match(data, 'var _0xd003=(\[[^;]+\]);') - data = scrapertools.find_single_match(data.replace('"', "'"), "sources\s*=[^\[]*\[([^\]]+)\]") - matches = scrapertools.find_multiple_matches(data, "[src|file]:'([^']+)'") - if len(matches) == 0: - matches = scrapertools.find_multiple_matches(data, "[^',]+") video_urls = [] - for video_url in matches: - if video_url.endswith(".mpd"): - continue - _hash = scrapertools.find_single_match(video_url, '[A-z0-9\_\-]{40,}') - hash = _hash[::-1] - hash = hash.replace(hash[1:2], "", 1) - video_url = video_url.replace(_hash, hash) + url = scrapertools.find_single_match(unpacked, '(http[^,]+\.mp4)') - filename = scrapertools.get_filename_from_url(video_url)[-4:] - if video_url.startswith("rtmp"): - rtmp, playpath = video_url.split("vod/", 1) - video_url = "%svod/ playpath=%s swfUrl=%splayer6/jwplayer.flash.swf pageUrl=%s" % \ - (rtmp, playpath, host, page_url) - filename = "RTMP" - elif video_url.endswith("/v.mp4"): - video_url_flv = re.sub(r'/v.mp4', '/v.flv', video_url) - video_urls.append(["flv [streamplay]", video_url_flv]) - - video_urls.append([filename + " [streamplay]", video_url]) + video_urls.append([".mp4" + " [streamplay]", S(_0xd003).decode(url)]) video_urls.sort(key=lambda x: x[0], reverse=True) for video_url in video_urls: - logger.info(" %s - %s" % (video_url[0], video_url[1])) + logger.info("%s - %s" % (video_url[0], video_url[1])) return video_urls + + +class S: + def __init__(self, _0xd003): + self.r = None + self.s = None + self.k = None + self.n = None + self.c = None + self.b = None + self.d = None + + _0xd003 = eval(_0xd003) + self.t(_0xd003[13] + _0xd003[14] + _0xd003[13] + _0xd003[14], _0xd003[15]) + + def decode(self, url): + _hash = re.compile('[A-z0-9_-]{40,}', re.DOTALL).findall(url)[0] + return url.replace(_hash, self.p(_hash)) + + def t(self, t, i): + self.r = 20 + self.s = [1634760805, 857760878, 2036477234, 1797285236] + self.k = [] + self.n = [0, 0] + self.c = [0, 0] + self.b = [None] * 64 + self.d = 64 + + self.sk(self.sa(t)) + self.sn(self.sa(i)) + + def e(self, t): + s = self.gb(len(t)) + i = [s[h] ^ t[h] for h in range(len(t))] + return i + + def p(self, t): + import base64 + t += "=" * (4 - len(t) % 4) + t = base64.b64decode(t.replace('-', '+').replace('_', '/')) + return self._as(self.e(self.sa(t))) + + @staticmethod + def sa(t): + s = [ord(t[i]) for i in range(len(t))] + return s + + @staticmethod + def _as(t): + s = [chr(t[i]) for i in range(len(t))] + return ''.join(s) + + def sk(self, t): + s = 0 + for i in range(8): + self.k.append( + 255 & t[s] | self.lshift((255 & t[s + 1]), 8) | self.lshift((255 & t[s + 2]), 16) | self.lshift( + (255 & t[s + 3]), 24)) + s += 4 + self._r() + + def sn(self, t): + self.n[0] = 255 & t[0] | self.lshift((255 & t[1]), 8) | self.lshift((255 & t[2]), 16) | self.lshift( + (255 & t[3]), 24) + self.n[1] = 255 & t[4] | self.lshift((255 & t[5]), 8) | self.lshift((255 & t[6]), 16) | self.lshift( + (255 & t[7]), 24) + self._r() + + def gb(self, t): + i = [None] * t + + for s in range(t): + if 64 == self.d: + self._g() + self._i() + self.d = 0 + + i[s] = self.b[self.d] + self.d += 1 + + return i + + def gh(self, t): + i = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'] + h = self.gb(t) + s = [i[self.rshift(h[b], 4) & 15] for b in range(len(h))] + s.append(i[15 & h[len(h)]]) + return ''.join(s) + + def _r(self): + self.c[0] = 0 + self.c[1] = 0 + self.d = 64 + + def _i(self): + self.c[0] = self.c[0] + 1 & 4294967295 + if 0 == self.c[0]: + self.c[1] = self.c[1] + 1 & 4294967295 + + def _g(self): + i = self.s[0] + s = self.k[0] + h = self.k[1] + b = self.k[2] + r = self.k[3] + n = self.s[1] + o = self.n[0] + e = self.n[1] + c = self.c[0] + p = self.c[1] + a = self.s[2] + f = self.k[4] + u = self.k[5] + g = self.k[6] + y = self.k[7] + k = self.s[3] + l = i + d = s + v = h + _ = b + A = r + w = n + C = o + S = e + j = c + m = p + q = a + x = f + z = u + B = g + D = y + E = k + + for F in range(0, self.r, 2): + # 0 + t = l + z + A ^= self.lshift(t, 7) | self.bshift(t, 25) + t = A + l + j ^= self.lshift(t, 9) | self.bshift(t, 23) + t = j + A + z ^= self.lshift(t, 13) | self.bshift(t, 19) + t = z + j + l ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 1 + t = w + d + m ^= self.lshift(t, 7) | self.bshift(t, 25) + t = m + w + B ^= self.lshift(t, 9) | self.bshift(t, 23) + t = B + m + d ^= self.lshift(t, 13) | self.bshift(t, 19) + t = d + B + w ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 2 + t = q + C + D ^= self.lshift(t, 7) | self.bshift(t, 25) + t = D + q + v ^= self.lshift(t, 9) | self.bshift(t, 23) + t = v + D + C ^= self.lshift(t, 13) | self.bshift(t, 19) + t = C + v + q ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 3 + t = E + x + _ ^= self.lshift(t, 7) | self.bshift(t, 25) + t = _ + E + S ^= self.lshift(t, 9) | self.bshift(t, 23) + t = S + _ + x ^= self.lshift(t, 13) | self.bshift(t, 19) + t = x + S + E ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 4 + t = l + _ + d ^= self.lshift(t, 7) | self.bshift(t, 25) + t = d + l + v ^= self.lshift(t, 9) | self.bshift(t, 23) + t = v + d + _ ^= self.lshift(t, 13) | self.bshift(t, 19) + t = _ + v + l ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 5 + t = w + A + C ^= self.lshift(t, 7) | self.bshift(t, 25) + t = C + w + S ^= self.lshift(t, 9) | self.bshift(t, 23) + t = S + C + A ^= self.lshift(t, 13) | self.bshift(t, 19) + t = A + S + w ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 6 + t = q + m + x ^= self.lshift(t, 7) | self.bshift(t, 25) + t = x + q + j ^= self.lshift(t, 9) | self.bshift(t, 23) + t = j + x + m ^= self.lshift(t, 13) | self.bshift(t, 19) + t = m + j + q ^= self.lshift(t, 18) | self.bshift(t, 14) + + # 7 + t = E + D + z ^= self.lshift(t, 7) | self.bshift(t, 25) + t = z + E + B ^= self.lshift(t, 9) | self.bshift(t, 23) + t = B + z + D ^= self.lshift(t, 13) | self.bshift(t, 19) + t = D + B + E ^= self.lshift(t, 18) | self.bshift(t, 14) + + l += i + d += s + v += h + _ += b + A += r + w += n + C += o + S += e + j += c + m += p + q += a + x += f + z += u + B += g + D += y + E += k + + self.b[0] = self.bshift(l, 0) & 255 + self.b[1] = self.bshift(l, 8) & 255 + self.b[2] = self.bshift(l, 16) & 255 + self.b[3] = self.bshift(l, 24) & 255 + self.b[4] = self.bshift(d, 0) & 255 + self.b[5] = self.bshift(d, 8) & 255 + self.b[6] = self.bshift(d, 16) & 255 + self.b[7] = self.bshift(d, 24) & 255 + self.b[8] = self.bshift(v, 0) & 255 + self.b[9] = self.bshift(v, 8) & 255 + self.b[10] = self.bshift(v, 16) & 255 + self.b[11] = self.bshift(v, 24) & 255 + self.b[12] = self.bshift(_, 0) & 255 + self.b[13] = self.bshift(_, 8) & 255 + self.b[14] = self.bshift(_, 16) & 255 + self.b[15] = self.bshift(_, 24) & 255 + self.b[16] = self.bshift(A, 0) & 255 + self.b[17] = self.bshift(A, 8) & 255 + self.b[18] = self.bshift(A, 16) & 255 + self.b[19] = self.bshift(A, 24) & 255 + self.b[20] = self.bshift(w, 0) & 255 + self.b[21] = self.bshift(w, 8) & 255 + self.b[22] = self.bshift(w, 16) & 255 + self.b[23] = self.bshift(w, 24) & 255 + self.b[24] = self.bshift(C, 0) & 255 + self.b[25] = self.bshift(C, 8) & 255 + self.b[26] = self.bshift(C, 16) & 255 + self.b[27] = self.bshift(C, 24) & 255 + self.b[28] = self.bshift(S, 0) & 255 + self.b[29] = self.bshift(S, 8) & 255 + self.b[30] = self.bshift(S, 16) & 255 + self.b[31] = self.bshift(S, 24) & 255 + self.b[32] = self.bshift(j, 0) & 255 + self.b[33] = self.bshift(j, 8) & 255 + self.b[34] = self.bshift(j, 16) & 255 + self.b[35] = self.bshift(j, 24) & 255 + self.b[36] = self.bshift(m, 0) & 255 + self.b[37] = self.bshift(m, 8) & 255 + self.b[38] = self.bshift(m, 16) & 255 + self.b[39] = self.bshift(m, 24) & 255 + self.b[40] = self.bshift(q, 0) & 255 + self.b[41] = self.bshift(q, 8) & 255 + self.b[42] = self.bshift(q, 16) & 255 + self.b[43] = self.bshift(q, 24) & 255 + self.b[44] = self.bshift(x, 0) & 255 + self.b[45] = self.bshift(x, 8) & 255 + self.b[46] = self.bshift(x, 16) & 255 + self.b[47] = self.bshift(x, 24) & 255 + self.b[48] = self.bshift(z, 0) & 255 + self.b[49] = self.bshift(z, 8) & 255 + self.b[50] = self.bshift(z, 16) & 255 + self.b[51] = self.bshift(z, 24) & 255 + self.b[52] = self.bshift(B, 0) & 255 + self.b[53] = self.bshift(B, 8) & 255 + self.b[54] = self.bshift(B, 16) & 255 + self.b[55] = self.bshift(B, 24) & 255 + self.b[56] = self.bshift(D, 0) & 255 + self.b[57] = self.bshift(D, 8) & 255 + self.b[58] = self.bshift(D, 16) & 255 + self.b[59] = self.bshift(D, 24) & 255 + self.b[60] = self.bshift(E, 0) & 255 + self.b[61] = self.bshift(E, 8) & 255 + self.b[62] = self.bshift(E, 16) & 255 + self.b[63] = self.bshift(E, 24) & 255 + + def lshift(self, num, other): + lnum = self.ToInt32(num) + rnum = self.ToUint32(other) + shift_count = rnum & 0x1F + return self.ToInt32(lnum << shift_count) + + def rshift(self, num, other): + lnum = self.ToInt32(num) + rnum = self.ToUint32(other) + shift_count = rnum & 0x1F + return self.ToInt32(lnum >> shift_count) + + def bshift(self, num, other): + lnum = self.ToUint32(num) + rnum = self.ToUint32(other) + shift_count = rnum & 0x1F + return self.ToUint32(lnum >> shift_count) + + @staticmethod + def ToInt32(num): + int32 = num % 2 ** 32 + return int32 - 2 ** 32 if int32 >= 2 ** 31 else int32 + + @staticmethod + def ToUint32(num): + return num % 2 ** 32