From e6f38787193dc426bcc33a1cbe40449ae54d4f72 Mon Sep 17 00:00:00 2001 From: xabier100 <25183502+xabier100@users.noreply.github.com> Date: Wed, 23 Aug 2017 16:49:36 +0200 Subject: [PATCH 01/11] =?UTF-8?q?A=C3=B1adido=20imagenes=20en=20el=20menu?= =?UTF-8?q?=20del=20canal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/newpct1.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index db5c28d6..71689695 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -11,12 +11,17 @@ from platformcode import config, logger def mainlist(item): logger.info() - + itemlist = [] + + thumb_pelis=get_thumb("channels_movie.png") + thumb_series=get_thumb("channels_tvshow.png") + itemlist.append(Item(channel=item.channel, action="submenu", title="Películas", url="http://www.newpct1.com/", - extra="peliculas")) - itemlist.append( - Item(channel=item.channel, action="submenu", title="Series", url="http://www.newpct1.com/", extra="series")) + extra="peliculas", thumbnail=thumb_pelis )) + + itemlist.append(Item(channel=item.channel, action="submenu", title="Series", url="http://www.newpct1.com/", extra="series", + thumbnail=thumb_series)) # itemlist.append(Item(channel=item.channel, action="search", title="Buscar")) return itemlist From dbabfdf91afcb6e5935c5482af1256c95decb647 Mon Sep 17 00:00:00 2001 From: alfa_addon_10 Date: Fri, 25 Aug 2017 14:31:05 +0200 Subject: [PATCH 02/11] revamp --- plugin.video.alfa/servers/fourshared.json | 6 +- plugin.video.alfa/servers/mp4upload.json | 6 +- plugin.video.alfa/servers/streamcloud.json | 32 +++++------ plugin.video.alfa/servers/streaminto.json | 30 +++++----- plugin.video.alfa/servers/uploadedto.json | 4 +- plugin.video.alfa/servers/vidspot.json | 66 +++++++++++----------- plugin.video.alfa/servers/yourupload.json | 6 +- 7 files changed, 73 insertions(+), 77 deletions(-) diff --git a/plugin.video.alfa/servers/fourshared.json b/plugin.video.alfa/servers/fourshared.json index dd0c1050..e5aa9ad6 100755 --- a/plugin.video.alfa/servers/fourshared.json +++ b/plugin.video.alfa/servers/fourshared.json @@ -7,9 +7,9 @@ } ], "find_videos": { - "ignore_urls": { - "value": "http://www.4shared.com/flash/player.swf" - }, + "ignore_urls": [ + "http://www.4shared.com/flash/player.swf" + ], "patterns": [ { "pattern": "(http://www.4shared.com/embed/[A-Z0-9a-z]+/[A-Z0-9a-z]+)", diff --git a/plugin.video.alfa/servers/mp4upload.json b/plugin.video.alfa/servers/mp4upload.json index 8bd80293..a69a26e2 100755 --- a/plugin.video.alfa/servers/mp4upload.json +++ b/plugin.video.alfa/servers/mp4upload.json @@ -7,9 +7,9 @@ } ], "find_videos": { - "ignore_urls": { - "value": "http://www.mp4upload.com/embed/embed" - }, + "ignore_urls": [ + "http://www.mp4upload.com/embed/embed" + ], "patterns": [ { "pattern": "mp4upload.com/embed-([A-Za-z0-9]+)", diff --git a/plugin.video.alfa/servers/streamcloud.json b/plugin.video.alfa/servers/streamcloud.json index ffce0565..bd3291a2 100755 --- a/plugin.video.alfa/servers/streamcloud.json +++ b/plugin.video.alfa/servers/streamcloud.json @@ -11,23 +11,21 @@ } ], "find_videos": { - "ignore_urls": { - "value": [ - "http://streamcloud.eu/stylesheets", - "http://streamcloud.eu/control", - "http://streamcloud.eu/xupload", - "http://streamcloud.eu/js", - "http://streamcloud.eu/favicon", - "http://streamcloud.eu/reward", - "http://streamcloud.eu/login", - "http://streamcloud.eu/deliver", - "http://streamcloud.eu/faq", - "http://streamcloud.eu/tos", - "http://streamcloud.eu/checkfiles", - "http://streamcloud.eu/contact", - "http://streamcloud.eu/serve" - ] - }, + "ignore_urls": [ + "http://streamcloud.eu/stylesheets", + "http://streamcloud.eu/control", + "http://streamcloud.eu/xupload", + "http://streamcloud.eu/js", + "http://streamcloud.eu/favicon", + "http://streamcloud.eu/reward", + "http://streamcloud.eu/login", + "http://streamcloud.eu/deliver", + "http://streamcloud.eu/faq", + "http://streamcloud.eu/tos", + "http://streamcloud.eu/checkfiles", + "http://streamcloud.eu/contact", + "http://streamcloud.eu/serve" + ], "patterns": [ { "pattern": "(streamcloud.eu/[a-z0-9]+)", diff --git a/plugin.video.alfa/servers/streaminto.json b/plugin.video.alfa/servers/streaminto.json index 51f1d5ee..c9e60e71 100755 --- a/plugin.video.alfa/servers/streaminto.json +++ b/plugin.video.alfa/servers/streaminto.json @@ -11,22 +11,20 @@ } ], "find_videos": { - "ignore_urls": { - "value": [ - "http://streamin.to/embed-theme.html", - "http://streamin.to/embed-jquery.html", - "http://streamin.to/embed-s.html", - "http://streamin.to/embed-images.html", - "http://streamin.to/embed-faq.html", - "http://streamin.to/embed-embed.html", - "http://streamin.to/embed-ri.html", - "http://streamin.to/embed-d.html", - "http://streamin.to/embed-css.html", - "http://streamin.to/embed-js.html", - "http://streamin.to/embed-player.html", - "http://streamin.to/embed-cgi.html" - ] - }, + "ignore_urls": [ + "http://streamin.to/embed-theme.html", + "http://streamin.to/embed-jquery.html", + "http://streamin.to/embed-s.html", + "http://streamin.to/embed-images.html", + "http://streamin.to/embed-faq.html", + "http://streamin.to/embed-embed.html", + "http://streamin.to/embed-ri.html", + "http://streamin.to/embed-d.html", + "http://streamin.to/embed-css.html", + "http://streamin.to/embed-js.html", + "http://streamin.to/embed-player.html", + "http://streamin.to/embed-cgi.html" + ], "patterns": [ { "pattern": "streamin.to/(?:embed-)?([a-z0-9A-Z]+)", diff --git a/plugin.video.alfa/servers/uploadedto.json b/plugin.video.alfa/servers/uploadedto.json index 39fa4b80..fa8cc12f 100755 --- a/plugin.video.alfa/servers/uploadedto.json +++ b/plugin.video.alfa/servers/uploadedto.json @@ -7,7 +7,9 @@ } ], "find_videos": { - "ignore_urls": [], + "ignore_urls": [ + "http://uploaded.net/file/ref" + ], "patterns": [ { "pattern": "(?:ul|uploaded).(?:net|to)/(?:file/|f/)?([a-zA-Z0-9]+)", diff --git a/plugin.video.alfa/servers/vidspot.json b/plugin.video.alfa/servers/vidspot.json index 8760788d..6e49bb6b 100755 --- a/plugin.video.alfa/servers/vidspot.json +++ b/plugin.video.alfa/servers/vidspot.json @@ -7,40 +7,38 @@ } ], "find_videos": { - "ignore_urls": { - "value": [ - "http://vidspot.net/embed-theme.html", - "http://vidspot.net/embed-jquery.html", - "http://vidspot.net/embed-s.html", - "http://vidspot.net/embed-images.html", - "http://vidspot.net/embed-faq.html", - "http://vidspot.net/embed-embed.html", - "http://vidspot.net/embed-ri.html", - "http://vidspot.net/embed-d.html", - "http://vidspot.net/embed-css.html", - "http://vidspot.net/embed-js.html", - "http://vidspot.net/embed-player.html", - "http://vidspot.net/embed-cgi.html", - "http://vidspot.net/embed-i.html", - "http://vidspot.net/images", - "http://vidspot.net/theme", - "http://vidspot.net/xupload", - "http://vidspot.net/s", - "http://vidspot.net/js", - "http://vidspot.net/jquery", - "http://vidspot.net/login", - "http://vidspot.net/make", - "http://vidspot.net/i", - "http://vidspot.net/faq", - "http://vidspot.net/tos", - "http://vidspot.net/premium", - "http://vidspot.net/checkfiles", - "http://vidspot.net/privacy", - "http://vidspot.net/refund", - "http://vidspot.net/links", - "http://vidspot.net/contact" - ] - }, + "ignore_urls": [ + "http://vidspot.net/embed-theme.html", + "http://vidspot.net/embed-jquery.html", + "http://vidspot.net/embed-s.html", + "http://vidspot.net/embed-images.html", + "http://vidspot.net/embed-faq.html", + "http://vidspot.net/embed-embed.html", + "http://vidspot.net/embed-ri.html", + "http://vidspot.net/embed-d.html", + "http://vidspot.net/embed-css.html", + "http://vidspot.net/embed-js.html", + "http://vidspot.net/embed-player.html", + "http://vidspot.net/embed-cgi.html", + "http://vidspot.net/embed-i.html", + "http://vidspot.net/images", + "http://vidspot.net/theme", + "http://vidspot.net/xupload", + "http://vidspot.net/s", + "http://vidspot.net/js", + "http://vidspot.net/jquery", + "http://vidspot.net/login", + "http://vidspot.net/make", + "http://vidspot.net/i", + "http://vidspot.net/faq", + "http://vidspot.net/tos", + "http://vidspot.net/premium", + "http://vidspot.net/checkfiles", + "http://vidspot.net/privacy", + "http://vidspot.net/refund", + "http://vidspot.net/links", + "http://vidspot.net/contact" + ], "patterns": [ { "pattern": "vidspot.(?:net/|php\\?id=)(?:embed-)?([a-z0-9]+)", diff --git a/plugin.video.alfa/servers/yourupload.json b/plugin.video.alfa/servers/yourupload.json index 0de5de00..401b7947 100755 --- a/plugin.video.alfa/servers/yourupload.json +++ b/plugin.video.alfa/servers/yourupload.json @@ -15,9 +15,9 @@ } ], "find_videos": { - "ignore_urls": { - "value": "http://www.yourupload.com/embed/embed" - }, + "ignore_urls": [ + "http://www.yourupload.com/embed/embed" + ], "patterns": [ { "pattern": "yourupload.com/embed/([A-z0-9]+)", From 2c71b1514e8186b9c8399967f5f56d534c5b09cf Mon Sep 17 00:00:00 2001 From: alfa_addon_10 Date: Fri, 25 Aug 2017 14:33:52 +0200 Subject: [PATCH 03/11] fix --- plugin.video.alfa/channels/torrentlocura.py | 1461 ++++--------------- 1 file changed, 312 insertions(+), 1149 deletions(-) diff --git a/plugin.video.alfa/channels/torrentlocura.py b/plugin.video.alfa/channels/torrentlocura.py index 20777ab0..e40696b9 100755 --- a/plugin.video.alfa/channels/torrentlocura.py +++ b/plugin.video.alfa/channels/torrentlocura.py @@ -1,117 +1,50 @@ # -*- coding: utf-8 -*- -import os import re -import urllib -import xbmc -import xbmcgui +from channelselector import get_thumb from core import httptools from core import scrapertools -from core import servertools -from core import tmdb from core.item import Item -from core.scrapertools import decodeHtmlentities as dhe -from platformcode import config, logger +from platformcode import logger -ACTION_SHOW_FULLSCREEN = 36 -ACTION_GESTURE_SWIPE_LEFT = 511 -ACTION_SELECT_ITEM = 7 -ACTION_PREVIOUS_MENU = 10 -ACTION_MOVE_LEFT = 1 -ACTION_MOVE_RIGHT = 2 -ACTION_MOVE_DOWN = 4 -ACTION_MOVE_UP = 3 -OPTION_PANEL = 6 -OPTIONS_OK = 5 - - -# Para la busqueda en bing evitando baneos - -def browser(url): - import mechanize - - # Utilizamos Browser mechanize para saltar problemas con la busqueda en bing - br = mechanize.Browser() - # Browser options - br.set_handle_equiv(False) - br.set_handle_gzip(True) - br.set_handle_redirect(True) - br.set_handle_referer(False) - br.set_handle_robots(False) - # Follows refresh 0 but not hangs on refresh > 0 - br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1) - # Want debugging messages? - # br.set_debug_http(True) - # br.set_debug_redirects(True) - # br.set_debug_responses(True) - - # User-Agent (this is cheating, ok?) - # br.addheaders = [('User-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/7.1.7 Safari/537.85.16')] - # br.addheaders =[('Cookie','SRCHD=AF=QBRE; domain=.bing.com; expires=25 de febrero de 2018 13:00:28 GMT+1; MUIDB=3B942052D204686335322894D3086911; domain=www.bing.com;expires=24 de febrero de 2018 13:00:28 GMT+1')] - # Open some site, let's pick a random one, the first that pops in mind - r = br.open(url) - response = r.read() - print response - if "img,divreturn" in response: - r = br.open("http://ssl-proxy.my-addr.org/myaddrproxy.php/" + url) - print "prooooxy" - response = r.read() - - return response - - -api_key = "2e2160006592024ba87ccdf78c28f49f" -api_fankey = "dffe90fba4d02c199ae7a9e71330c987" +host = "http://torrentlocura.com/" def mainlist(item): logger.info() - itemlist = [] - itemlist.append(item.clone(title="[COLOR crimson][B]Películas[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/peliculas/", thumbnail="http://imgur.com/RfZjMBi.png", - fanart="http://imgur.com/V7QZLAL.jpg", contentType="movie")) - itemlist.append(itemlist[-1].clone(title="[COLOR crimson][B] Películas HD[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/peliculas-hd/", - thumbnail="http://imgur.com/RfZjMBi.png", fanart="http://imgur.com/V7QZLAL.jpg", - contentType="movie")) - itemlist.append(itemlist[-1].clone(title=" [COLOR crimson][B]Estrenos[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/estrenos-de-cine/", - thumbnail="http://imgur.com/RfZjMBi.png", fanart="http://imgur.com/V7QZLAL.jpg", - contentType="movie")) - itemlist.append(itemlist[-1].clone(title="[COLOR crimson][B] Películas 3D[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/peliculas-3d/", - thumbnail="http://imgur.com/RfZjMBi.png", fanart="http://imgur.com/V7QZLAL.jpg", - contentType="movie")) + + thumb_movie = get_thumb("channels_movie.png") + thumb_tvshow = get_thumb("channels_tvshow.png") + thumb_anime = get_thumb("channels_anime.png") + thumb_search = get_thumb("search.png") + + itemlist = list() + itemlist.append(Item(channel=item.channel, action="submenu", title="Películas", url=host, + thumbnail=thumb_movie, pattern="peliculas")) itemlist.append( - itemlist[-1].clone(title=" [COLOR crimson][B]Películas subtituladas[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/peliculas-vo/", thumbnail="http://imgur.com/RfZjMBi.png", - fanart="http://imgur.com/V7QZLAL.jpg", contentType="movie")) + Item(channel=item.channel, action="submenu", title="Series", url=host, + thumbnail=thumb_tvshow, pattern="series")) itemlist.append( - itemlist[-1].clone(title="[COLOR crimson][B] Películas Audio Latino[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/peliculas-latino/", thumbnail="http://imgur.com/RfZjMBi.png", - fanart="http://imgur.com/V7QZLAL.jpg", contentType="movie")) - itemlist.append(itemlist[-1].clone(title="[COLOR crimson][B]Series[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/series/", thumbnail="http://imgur.com/vX2dUYl.png", - contentType="tvshow")) - itemlist.append(itemlist[-1].clone(title=" [COLOR crimson][B]Series HD[/B][/COLOR]", action="scraper", - url="http://torrentlocura.com/series-hd/", - thumbnail="http://imgur.com/vX2dUYl.png", fanart="http://imgur.com/V7QZLAL.jpg", - contentType="tvshow")) - itemlist.append(itemlist[-1].clone(title="[COLOR crimson][B]Buscar[/B][/COLOR]", action="search", url="", - thumbnail="http://imgur.com/rSttk79.png", fanart="http://imgur.com/V7QZLAL.jpg")) + Item(channel=item.channel, action="anime", title="Anime", url=host, + thumbnail=thumb_anime, pattern="anime")) + itemlist.append(Item(channel=item.channel, action="search", title="Buscar", url=host + "buscar", + thumbnail=thumb_search)) return itemlist def search(item, texto): - logger.info() - texto = texto.replace(" ", "+") - item.url = "http://torrentlocura.com/buscar" - item.extra = urllib.urlencode({'q': texto}) - item.contentType != "movie" + logger.info("search:" + texto) + # texto = texto.replace(" ", "+") + try: - return buscador(item) + item.post = "q=%s" % texto + item.pattern = "buscar-list" + itemlist = listado2(item) + + return itemlist + # Se captura la excepción, para no interrumpir al buscador global si un canal falla except: import sys @@ -120,1079 +53,309 @@ def search(item, texto): return [] -def buscador(item): +def anime(item): logger.info() itemlist = [] - data = httptools.downloadpage(item.url, post=item.extra, ).data - data = unicode(data, "latin1").encode("utf8") - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - check_item = [] - bloque_enlaces = scrapertools.find_single_match(data, 'Resultados(.*?)end .page-box') - result_0 = scrapertools.find_multiple_matches(bloque_enlaces, - 'a href="([^"]+)" title="Descargar (.*?) ([^<]+)">') - for url, tipo, title, thumb in result_0: - try: - year = scrapertools.find_single_match(title, '(\d\d\d\d)') - except: - year = "" - if tipo == "Serie": - contentType = "tv" - title = re.sub(r'-.*', '', title) - title_check = title.strip() - else: - contentType = "movie" - # tipo="Pelicula" - title = re.sub(r'de Cine', 'Screener', title) - title = title.replace("RIP", "HdRip") - title_check = (title + " " + tipo).strip() - if "pc" in tipo or "PC" in tipo or "XBOX" in tipo or "Nintendo" in tipo or "Windows" in tipo or "varios" in url or "juego" in url: - continue + title = "Anime" + url = host + "anime" + itemlist.append(item.clone(channel=item.channel, action="listado", title=title, url=url, + pattern="pelilist")) + itemlist.append( + item.clone(channel=item.channel, action="alfabeto", title=title + " [A-Z]", url=url, + thumbnail=item.thumbnail[:-4] + "_az.png", pattern="pelilist")) - if title_check in str(check_item): + return itemlist + + +def submenu(item): + logger.info() + itemlist = [] + + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + # data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + + pattern = '
  • .*?
      (.*?)
    ' % (host, item.pattern) + data = scrapertools.get_match(data, pattern) + + pattern = '
    ([^>]+)' + matches = re.compile(pattern, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + title = scrapedtitle.strip() + url = scrapedurl + + if item.pattern in title.lower(): + itemlist.append(item.clone(channel=item.channel, action="listado", title=title, url=url, + pattern="pelilist")) + itemlist.append( + item.clone(channel=item.channel, action="alfabeto", title=title + " [A-Z]", url=url, + thumbnail=item.thumbnail[:-4] + "_az.png", pattern="pelilist")) + + return itemlist + + +def alfabeto(item): + logger.info() + itemlist = [] + + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + # data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + + pattern = '
      (.*?)
    ' + data = scrapertools.get_match(data, pattern) + + patron = ']+>([^>]+)' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + title = scrapedtitle.upper() + url = scrapedurl + + itemlist.append(Item(channel=item.channel, action="listado", title=title, url=url, pattern=item.pattern)) + + return itemlist + + +def listado(item): + logger.info() + itemlist = [] + + data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url).data) + data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") + + # logger.debug("data %s " % data) + next_page = scrapertools.find_single_match(data, '