From 0c891a375385a69d05dddd1403a03049d5feaf3a Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Sat, 17 Feb 2018 12:01:15 -0500 Subject: [PATCH 01/28] youtube: fix --- plugin.video.alfa/servers/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.video.alfa/servers/youtube.py b/plugin.video.alfa/servers/youtube.py index 989cfde6..5a398635 100755 --- a/plugin.video.alfa/servers/youtube.py +++ b/plugin.video.alfa/servers/youtube.py @@ -17,7 +17,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= page_url = "http://www.youtube.com/watch?v=%s" % page_url logger.info(" page_url->'%s'" % page_url) - video_id = scrapertools.find_single_match(page_url, 'v=([A-z0-9_-]{11})') + video_id = scrapertools.find_single_match(page_url, '(?:v=|embed/)([A-z0-9_-]{11})') video_urls = extract_videos(video_id) video_urls.reverse() From 82fe2b67c9ffdbc58c920691f32d596e876c8e0a Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 19 Feb 2018 11:34:27 -0500 Subject: [PATCH 02/28] flashx: fix --- plugin.video.alfa/servers/flashx.py | 32 +++++++++++------------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py index 6c33cac0..6efb18d0 100644 --- a/plugin.video.alfa/servers/flashx.py +++ b/plugin.video.alfa/servers/flashx.py @@ -13,21 +13,13 @@ from platformcode import config, logger def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url, cookies=False).data - if 'file was deleted' in data: - return False, "[FlashX] El archivo no existe o ha sido borrado" - elif 'File Not Found' in data: - return False, "[FlashX] El archivo no existe" - elif 'Video is processing now' in data: - return False, "[FlashX] El archivo se está procesando" - return True, "" def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) pfxfx = "" - headers = {'Host': 'www.flashx.tv', + headers = {'Host': 'www.flashx.sx', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.5', @@ -35,11 +27,11 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= 'Cookie': ''} data = httptools.downloadpage(page_url, cookies=False).data data = data.replace("\n","") - cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.tv/counter.cgi.*?[^(?:'|")]+)""") + cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.sx/counter.cgi.*?[^(?:'|")]+)""") cgi_counter = cgi_counter.replace("%0A","").replace("%22","") - playnow = scrapertools.find_single_match(data, 'https://www.flashx.tv/dl[^"]+') + playnow = scrapertools.find_single_match(data, 'https://www.flashx.sx/dl[^"]+') # Para obtener el f y el fxfx - js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.tv/js\w+/c\w+.*?[^(?:'|")]+)""") + js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.sx/js\w+/c\w+.*?[^(?:'|")]+)""") data_fxfx = httptools.downloadpage(js_fxfx).data mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'","").replace(" ","") matches = scrapertools.find_multiple_matches(mfxfx, '(\w+):(\w+)') @@ -49,19 +41,20 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= logger.info("mfxfxfx2= %s" %pfxfx) if pfxfx == "": pfxfx = "ss=yes&f=fail&fxfx=6" - coding_url = 'https://www.flashx.tv/flashx.php?%s' %pfxfx + coding_url = 'https://www.flashx.sx/flashx.php?%s' %pfxfx # {f: 'y', fxfx: '6'} - flashx_id = scrapertools.find_single_match(data, 'name="id" value="([^"]+)"') - fname = scrapertools.find_single_match(data, 'name="fname" value="([^"]+)"') - hash_f = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)"') - imhuman = scrapertools.find_single_match(data, "value='([^']+)' name='imhuman'") + bloque = scrapertools.find_single_match(data, '(?s)Form method="POST" action(.*?) "7.1" + @param _rating: valor del rating + @type _rating: float + @return: devuelve el valor modificado si es correcto, si no devuelve None + @rtype: float|None + """ + # logger.debug("rating %s" % _rating) + + try: + # convertimos los deciamles p.e. 7.1 + return "%.1f" % round(_rating, 1) + except Exception, ex_dl: + template = "An exception of type %s occured. Arguments:\n%r" + message = template % (type(ex_dl).__name__, ex_dl.args) + logger.error(message) + return None + + def check_range(_rating): + """ + Comprobamos que el rango de rating sea entre 0.0 y 10.0 + @param _rating: valor del rating + @type _rating: float + @return: devuelve el valor si está dentro del rango, si no devuelve None + @rtype: float|None + """ + # logger.debug("rating %s" % _rating) + # fix para comparacion float + dec = Decimal(_rating) + if 0.0 <= dec <= 10.0: + # logger.debug("estoy en el rango!") + return _rating + else: + # logger.debug("NOOO estoy en el rango!") + return None + + def convert_float(_rating): + try: + return float(_rating) + except ValueError, ex_ve: + template = "An exception of type %s occured. Arguments:\n%r" + message = template % (type(ex_ve).__name__, ex_ve.args) + logger.error(message) + return None + + if type(rating) != float: + # logger.debug("no soy float") + if type(rating) == int: + # logger.debug("soy int") + rating = convert_float(rating) + elif type(rating) == str: + # logger.debug("soy str") + + rating = rating.replace("<", "") + rating = convert_float(rating) + + if rating is None: + # logger.debug("error al convertir str, rating no es un float") + # obtenemos los valores de numericos + new_rating = scrapertools.find_single_match(rating, "(\d+)[,|:](\d+)") + if len(new_rating) > 0: + rating = convert_float("%s.%s" % (new_rating[0], new_rating[1])) + + else: + logger.error("no se que soy!!") + # obtenemos un valor desconocido no devolvemos nada + return None + + if rating: + rating = check_decimal_length(rating) + rating = check_range(rating) + + return rating diff --git a/plugin.video.alfa/resources/settings.xml b/plugin.video.alfa/resources/settings.xml index 588682e8..950bf63b 100644 --- a/plugin.video.alfa/resources/settings.xml +++ b/plugin.video.alfa/resources/settings.xml @@ -51,6 +51,58 @@ + + + + + + + + + + + + + + + + + + + + From 96ee127c5d0c1fd942d59f241ab13690091fd39d Mon Sep 17 00:00:00 2001 From: danielr460 Date: Fri, 23 Feb 2018 12:37:46 -0500 Subject: [PATCH 17/28] =?UTF-8?q?Newpct:=20Renovado=20primera=20versi?= =?UTF-8?q?=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/newpct.py | 373 ++++----------------------- 1 file changed, 55 insertions(+), 318 deletions(-) diff --git a/plugin.video.alfa/channels/newpct.py b/plugin.video.alfa/channels/newpct.py index ce64bdb5..4e8f36c7 100755 --- a/plugin.video.alfa/channels/newpct.py +++ b/plugin.video.alfa/channels/newpct.py @@ -7,346 +7,83 @@ import urlparse from core import scrapertools from core.item import Item from platformcode import logger +from core import httptools + +Host='http://www.tvsinpagar.com' def mainlist(item): logger.info() itemlist = [] - itemlist.append(Item(channel=item.channel, action="submenu", title="Películas")) - itemlist.append(Item(channel=item.channel, action="submenu", title="Series")) - itemlist.append(Item(channel=item.channel, action="listado", title="Anime", url="http://www.newpct.com/anime/", - viewmode="movie_with_plot")) - itemlist.append( - Item(channel=item.channel, action="listado", title="Documentales", url="http://www.newpct.com/documentales/", - viewmode="movie_with_plot")) - itemlist.append(Item(channel=item.channel, action="search", title="Buscar")) - + itemlist.append(Item(channel=item.channel, action="submenu", title="Películas",url=Host+"/peliculas/")) + itemlist.append(Item(channel=item.channel, action="submenu", title="Series",url=Host+"/series/")) + #itemlist.append(Item(channel=item.channel, action="listado", title="Anime", url=Host+"/anime/", + # viewmode="movie_with_plot")) + #itemlist.append( + # Item(channel=item.channel, action="listado", title="Documentales", url=Host+"/documentales/", + # viewmode="movie_with_plot")) + #itemlist.append(Item(channel=item.channel, action="search", title="Buscar")) return itemlist - -def search(item, texto): - logger.info() - texto = texto.replace(" ", "+") - - item.url = "http://www.newpct.com/buscar-descargas/%s" % (texto) - try: - return buscador(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 buscador(item): - logger.info() - itemlist = [] - - # Descarga la página - data = scrapertools.cache_page(item.url) - data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - - # 14-09-14 Malefica 3D SBS [BluRay 1080p][DTS 5.1-AC3 5.1 Castellano DTS 5.1-Ingles+Subs][ES-EN]10.9 GB(.+?)<\/ul>' #Filtrado por url + data_cat = scrapertools.find_single_match(data, patron) + patron_cat='
  • <\/li>' + matches = scrapertools.find_multiple_matches(data_cat, patron_cat) + for scrapedurl, scrapedtitle in matches: + itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,action="listado")) return itemlist def listado(item): logger.info() itemlist = [] - data = scrapertools.cache_page(item.url) - - ''' -
  • - -
    - Descargar Peliculas Castellano » Películas RIP La Pequeña Venecia [DVDrip][AC3 5.1 Español Castellano][2012] -
    -

    La Pequeña Venecia

    -

    Peliculas Castellano
    - Calidad: DVDRIP AC3 5.1
    - Tamaño: 1.1 GB
    - Idioma : Español Castellano -

    -
    -
    -
    -
    -
    - - -
    - -
    -
  • - ''' - patron = "'); - var page = $(this).attr('data'); - var dataString = 'page='+page; - - $.ajax({ - type: "GET", - url: 'http://www.newpct.com/include.inc/ajax.php/orderCategory.php', - data: parametros, - success: function(data) { - - //Cargamos finalmente el contenido deseado - $('#content-category').fadeIn(1000).html(data); - } - }); - - } - ''' - if item.extra != "": - bloque = item.extra - else: - bloque = scrapertools.get_match(data, "function orderCategory(.*?)\}\)\;") - logger.info("bloque=" + bloque) - param_type = scrapertools.get_match(data, "]+> >> ") - logger.info("param_type=" + param_type) - param_leter = scrapertools.get_match(data, - "]+> >> ") - logger.info("param_leter=" + param_leter) - param_pag = scrapertools.get_match(data, - "]+> >> ") - logger.info("param_pag=" + param_pag) - param_total = scrapertools.get_match(bloque, '"total"\s*\:\s*\'([^\']+)') - logger.info("param_sql=" + param_total) - param_sql = scrapertools.get_match(bloque, '"sql"\s*\:\s*\'([^\']+)') - logger.info("param_sql=" + param_sql) - param_tot = scrapertools.get_match(bloque, "\"tot\"\s*\:\s*'([^']*)'") - logger.info("param_tot=" + param_tot) - param_ban = scrapertools.get_match(bloque, "\"ban\"\s*\:\s*'([^']+)'") - logger.info("param_ban=" + param_ban) - param_cate = scrapertools.get_match(bloque, "\"cate\"\s*\:\s*'([^']+)'") - logger.info("param_cate=" + param_cate) - base_url = scrapertools.get_match(bloque, "url\s*\:\s*'([^']+)'") - base_url = re.sub("../..", "http://www.newpct.com", base_url, count=1) - logger.info("base_url=" + base_url) - # http://www.newpct.com/include.inc/ajax.php/orderCategory.php?type=todo&leter=&sql=SELECT+DISTINCT+++%09%09%09%09%09%09torrentID%2C+++%09%09%09%09%09%09torrentCategoryID%2C+++%09%09%09%09%09%09torrentCategoryIDR%2C+++%09%09%09%09%09%09torrentImageID%2C+++%09%09%09%09%09%09torrentName%2C+++%09%09%09%09%09%09guid%2C+++%09%09%09%09%09%09torrentShortName%2C++%09%09%09%09%09%09torrentLanguage%2C++%09%09%09%09%09%09torrentSize%2C++%09%09%09%09%09%09calidad+as+calidad_%2C++%09%09%09%09%09%09torrentDescription%2C++%09%09%09%09%09%09torrentViews%2C++%09%09%09%09%09%09rating%2C++%09%09%09%09%09%09n_votos%2C++%09%09%09%09%09%09vistas_hoy%2C++%09%09%09%09%09%09vistas_ayer%2C++%09%09%09%09%09%09vistas_semana%2C++%09%09%09%09%09%09vistas_mes++%09%09%09%09++FROM+torrentsFiles+as+t+WHERE++(torrentStatus+%3D+1+OR+torrentStatus+%3D+2)++AND+(torrentCategoryID+IN+(1537%2C+758%2C+1105%2C+760%2C+1225))++++ORDER+BY+torrentDateAdded++DESC++LIMIT+0%2C+50&pag=3&tot=&ban=3&cate=1225 - url_next_page = base_url + "?" + urllib.urlencode( - {"total": param_total, "type": param_type, "leter": param_leter, "sql": param_sql, "pag": param_pag, - "tot": param_tot, "ban": param_ban, "cate": param_cate}) - logger.info("url_next_page=" + url_next_page) - if item.category == "serie": - itemlist.append( - Item(channel=item.channel, action="listado", title=">> Página siguiente", url=url_next_page, extra=bloque, - category="serie", viewmode="movie_with_plot")) - else: - itemlist.append( - Item(channel=item.channel, action="listado", title=">> Página siguiente", url=url_next_page, extra=bloque, - viewmode="movie_with_plot")) - + patron_pag='