diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index ab5bc485..65bac5cd 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,16 +19,11 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - » vidlox » downace - » tvvip » clipwatching - » hdfull » peliculasaudiolatino - » descargas2020 » mispelisyseries - » torrentloculra » torrentrapid - » tumejortorrent » tvsinpagar - + » plusdede » yespornplease + » cinefox ¤ arreglos internos - ¤ Gracias al equipo SOD, @lopezvg, @f_y_m por colaborar en ésta versión + ¤ Gracias a @fcammed y @t1254362 por colaborar en ésta versión Navega con Kodi por páginas web para ver sus videos de manera fácil. Browse web pages using Kodi diff --git a/plugin.video.alfa/channels/cinefox.py b/plugin.video.alfa/channels/cinefox.py index 264afbd2..a1f355be 100644 --- a/plugin.video.alfa/channels/cinefox.py +++ b/plugin.video.alfa/channels/cinefox.py @@ -535,29 +535,24 @@ def episodios(item): item.url += "/episodios" data = httptools.downloadpage(item.url).data - data_season = data[:] #if "episodios" in item.extra or not __menu_info__ or item.path: action = "findvideos" # else: # action = "menu_info_episode" - seasons = scrapertools.find_single_match(data, ']+>.*?href="([^"]+)">([^<]+).*?([^<]+)' - matches = scrapertools.find_multiple_matches(data_season, patron) - for scrapedurl, episode, scrapedtitle in matches: - new_item = item.clone(action=action, url=scrapedurl, text_color=color2, contentType="episode") - new_item.contentSeason = episode.split("x")[0] - new_item.contentEpisodeNumber = episode.split("x")[1] + patron = '
.*?href="([^"]+)">([^<]+).*?([^<]+)' + matches = scrapertools.find_multiple_matches(data, patron) + for scrapedurl, episode, scrapedtitle in matches: + new_item = item.clone(action=action, url=scrapedurl, text_color=color2, contentType="episode") + new_item.contentSeason = episode.split("x")[0] + new_item.contentEpisodeNumber = episode.split("x")[1] - new_item.title = episode + " - " + scrapedtitle - new_item.extra = "episode" - if "episodios" in item.extra or item.path: - new_item.extra = "episode|" - itemlist.append(new_item) + new_item.title = episode + " - " + scrapedtitle + new_item.extra = "episode" + if "episodios" in item.extra or item.path: + new_item.extra = "episode|" + itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) diff --git a/plugin.video.alfa/channels/plusdede.py b/plugin.video.alfa/channels/plusdede.py index bfccb74d..729b16a3 100644 --- a/plugin.video.alfa/channels/plusdede.py +++ b/plugin.video.alfa/channels/plusdede.py @@ -4,6 +4,7 @@ import os import re import sys import urlparse +from time import sleep from core import channeltools from core import httptools @@ -14,7 +15,7 @@ from core.item import Item from platformcode import config, logger from platformcode import platformtools -HOST = 'http://www.plusdede.com' +HOST = 'https://www.plusdede.com' __channel__ = 'plusdede' parameters = channeltools.get_channel_parameters(__channel__) fanart_host = parameters['fanart'] @@ -23,20 +24,48 @@ color1, color2, color3 = ['0xFFB10021', '0xFFB10021', '0xFFB10004'] def login(): - url_origen = "https://www.plusdede.com/login?popup=1" - data = httptools.downloadpage(url_origen, follow_redirects=True).data + url_origen = HOST+"/login?popup=1" + try: + data = httptools.downloadpage(url_origen).data + except: + data = httptools.downloadpage(url_origen, follow_redirects=False).data + if re.search(r'(?i)%s' % config.get_setting("plusdedeuser", "plusdede"), data): - return True - + return True token = scrapertools.find_single_match(data, '') + imagen_data = httptools.downloadpage(captcha_url).data + ficheropng = os.path.join(config.get_data_path(), "captcha_plusdede.png") + outfile=open(ficheropng,'wb') + outfile.write(imagen_data) + outfile.close() + img = xbmcgui.ControlImage(450,15,400,130,ficheropng) + wdlg = xbmcgui.WindowDialog() + wdlg.addControl(img) + wdlg.show() + sleep(1) + kb = platformtools.dialog_numeric(0, "Escribe los números de la imagen") - post = "_token=" + str(token) + "&email=" + str( - config.get_setting("plusdedeuser", "plusdede")) + "&password=" + str( - config.get_setting("plusdedepassword", "plusdede")) + "&app=2131296469" - url = "https://www.plusdede.com/" - headers = {"User-Agent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/61.0.3163.100 Safari/537.36","Referer": url, "X-Requested-With": "XMLHttpRequest", "X-CSRF-TOKEN": token} - data = httptools.downloadpage("https://www.plusdede.com/login", post=post, headers=headers, + postcaptcha = "" + if kb !='': + solution = kb + postcaptcha = "&captcha=" + str(solution) + else: + return False + wdlg.close() + else: + postcaptcha="" + + post = "_token=" + str(token) + "&email=" + str(config.get_setting("plusdedeuser", "plusdede")) + \ + "&password=" + str(config.get_setting("plusdedepassword", "plusdede")) + postcaptcha\ + #+ "&app=2131296469" + + url = HOST + headers = {"User-Agent": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/66.0.3163.100 Safari/537.36", "Referer": url, "X-Requested-With": "XMLHttpRequest","X-CSRF-TOKEN": + token} + data = httptools.downloadpage(HOST+"/login", post=post, headers=headers, replace_headers=False).data if "redirect" in data: return True @@ -785,7 +814,6 @@ def checkseen(item): "Chrome/61.0.3163.100 Safari/537.36", "Referer": "https://www.plusdede.com/serie/", "X-Requested-With": "XMLHttpRequest", "X-CSRF-TOKEN": item.token} data = httptools.downloadpage(url_temp, post="id=" + item.idtemp, headers=headers, replace_headers=True).data - #logger.debug(data) return True diff --git a/plugin.video.alfa/channels/yespornplease.py b/plugin.video.alfa/channels/yespornplease.py index 015bf1d1..c2aa1841 100644 --- a/plugin.video.alfa/channels/yespornplease.py +++ b/plugin.video.alfa/channels/yespornplease.py @@ -1,100 +1,100 @@ -# -*- coding: utf-8 -*- - -import re - -from core import httptools -from core.item import Item -from platformcode import logger -from urlparse import urljoin -from core import servertools - - -HOST="http://yespornplease.com" - -def mainlist(item): - logger.info() - itemlist = [] - itemlist.append(item.clone(action="links", title="Novedades", url=HOST)) - itemlist.append(item.clone(action="categories", title="Categorías", url=urljoin(HOST, "categories"))) - itemlist.append(item.clone(action="search", title="Buscar", url=urljoin(HOST, "search"))) - return itemlist - - -def search(item, texto): - logger.info("texto = %s" %(texto)) - - item.url = urljoin(HOST, "search&q=" + texto) - try: - return links(item) - # Se captura la excepción, para no interrumpir al buscador global si un canal falla - except: - import sys - for line in sys.exc_info(): - logger.error("%s" % line) - return [] - -def categories(item): - logger.info() - data = httptools.downloadpage(item.url).data - - result = [] - - categories = re.findall("href=[\"'](?P/search[^\"']+).*?>(?P[^<>]+)
.*?badge[^>]+>(?P\d+)", data, re.DOTALL | re.MULTILINE) - for url, name, counter in categories: - result.append(item.clone(action = "links", title = "%s (%s videos)" % (name, counter), url = urljoin(item.url, url))) - - return result - -def get_page(url): - page = re.search("p=(\d+)", url) - if page: - return int(page.group(1)) - return 1 - -def get_page_url(url, page): - logger.debug("URL: %s to page %d" % (url, page)) - resultURL = re.sub("([&\?]p=)(?:\d+)", "\g<1>%d" % page, url) - if resultURL == url: - resultURL += ("&" if "?" in url else "?") + "p=%d" % (page) - - logger.debug("Result: %s" % (resultURL)) - return resultURL - - -def links(item): - logger.info() - data = httptools.downloadpage(item.url).data - - reExpr = "[^'\"]+)[^>]+title[^'\"]*['\"](?P[^\"]+)[^>]+id[^'\"]*['\"](?P<id>[^'\"]+)[^>]*>(?:[^<]*<[^>]+>(?P<quality>[^<]+)<)?[^<]*<[^>]*duration[^>]*>(?P<duration>[^<]+)" - reResults = re.findall(reExpr, data, re.MULTILINE | re.DOTALL) - result = [] - - for img, title, vID, quality, duration in reResults: - logger.info("[link] %(title)s [%(quality)s] [%(duration)s]: %(vid)s (%(img)s" % ({"title": title, "duration": duration, "vid": vID, "img": img, "quality": quality if quality else "--"})) - - formattedQuality = "" - if quality: - formattedQuality += " [%s]" % (quality) - - titleFormatted = "%(title)s%(quality)s [%(duration)s]" % ({"title": title, "quality": formattedQuality, "duration": duration}) - result.append(item.clone(action = "play", title = titleFormatted, url = urljoin(item.url, "/view/%s" % (vID)), thumbnail = urljoin(item.url, img), vID = vID)) - - # Has pagination - paginationOccurences = data.count('class="prevnext"') - if paginationOccurences: - page = get_page(item.url) - logger.info("Page " + str(page) + " Ocurrences: " + str(paginationOccurences)) - if page > 1: - result.append(item.clone(action = "links", title = "<< Anterior", url = get_page_url(item.url, page - 1))) - - if paginationOccurences > 1 or page == 1: - result.append(item.clone(action = "links", title = "Siguiente >>", url = get_page_url(item.url, page + 1))) - - - return result - -def play(item): - logger.info(item) - embededURL = urljoin(item.url, "/e/%s/width-650/height-400/autoplay-0/" % (item.vID)) - itemlist = servertools.find_video_items(item.clone(url = embededURL)) - return itemlist +# -*- coding: utf-8 -*- + +import re + +from core import httptools +from core.item import Item +from platformcode import logger +from urlparse import urljoin +from core import servertools + + +HOST="http://yespornplease.com" + +def mainlist(item): + logger.info() + itemlist = [] + itemlist.append(item.clone(action="links", title="Novedades", url=HOST)) + itemlist.append(item.clone(action="categories", title="Categorías", url=urljoin(HOST, "categories"))) + itemlist.append(item.clone(action="search", title="Buscar", url=urljoin(HOST, "search"))) + return itemlist + + +def search(item, texto): + logger.info("texto = %s" %(texto)) + + item.url = urljoin(HOST, "search&q=" + texto) + try: + return links(item) + # Se captura la excepción, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + +def categories(item): + logger.info() + data = httptools.downloadpage(item.url).data + + result = [] + + categories = re.findall("href=[\"'](?P<url>/search[^\"']+).*?>(?P<name>[^<>]+)</div>.*?badge[^>]+>(?P<counter>\d+)", data, re.DOTALL | re.MULTILINE) + for url, name, counter in categories: + result.append(item.clone(action = "links", title = "%s (%s videos)" % (name, counter), url = urljoin(item.url, url))) + + return result + +def get_page(url): + page = re.search("p=(\d+)", url) + if page: + return int(page.group(1)) + return 1 + +def get_page_url(url, page): + logger.debug("URL: %s to page %d" % (url, page)) + resultURL = re.sub("([&\?]p=)(?:\d+)", "\g<1>%d" % page, url) + if resultURL == url: + resultURL += ("&" if "?" in url else "?") + "p=%d" % (page) + + logger.debug("Result: %s" % (resultURL)) + return resultURL + + +def links(item): + logger.info() + data = httptools.downloadpage(item.url).data + + reExpr = "<img\s+src=['\"](?P<img>[^'\"]+)[^>]+(?:title|alt)[^'\"]*['\"](?P<title>[^\"]+)[^>]+id[^'\"]*['\"](?P<id>[^'\"]+)[^>]*>(?:[^<]*<[^>]+>(?P<quality>[^<]+)<)?[^<]*<[^>]*duration[^>]*>(?P<duration>[^<]+)" + reResults = re.findall(reExpr, data, re.MULTILINE | re.DOTALL) + result = [] + + for img, title, vID, quality, duration in reResults: + logger.info("[link] %(title)s [%(quality)s] [%(duration)s]: %(vid)s (%(img)s" % ({"title": title, "duration": duration, "vid": vID, "img": img, "quality": quality if quality else "--"})) + + formattedQuality = "" + if quality: + formattedQuality += " [%s]" % (quality) + + titleFormatted = "%(title)s%(quality)s [%(duration)s]" % ({"title": title, "quality": formattedQuality, "duration": duration}) + result.append(item.clone(action = "play", title = titleFormatted, url = urljoin(item.url, "/view/%s" % (vID)), thumbnail = urljoin(item.url, img), vID = vID)) + + # Has pagination + paginationOccurences = data.count('class="prevnext"') + if paginationOccurences: + page = get_page(item.url) + logger.info("Page " + str(page) + " Ocurrences: " + str(paginationOccurences)) + if page > 1: + result.append(item.clone(action = "links", title = "<< Anterior", url = get_page_url(item.url, page - 1))) + + if paginationOccurences > 1 or page == 1: + result.append(item.clone(action = "links", title = "Siguiente >>", url = get_page_url(item.url, page + 1))) + + + return result + +def play(item): + logger.info(item) + embededURL = urljoin(item.url, "/view/%s" % (item.vID)) + itemlist = servertools.find_video_items(item.clone(url = embededURL)) + return itemlist