From 5fa341950ccaea092c5281a7dab739a40bffb4e4 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Sat, 21 Oct 2017 12:12:34 -0500 Subject: [PATCH 1/9] flashx: fix again --- plugin.video.alfa/servers/flashx.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py index bac474c1..e962aa9a 100644 --- a/plugin.video.alfa/servers/flashx.py +++ b/plugin.video.alfa/servers/flashx.py @@ -32,13 +32,18 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'Cookie': ''} data = httptools.downloadpage(page_url, headers=headers, replace_headers=True).data + data = data.replace("\n","") + cgi_counter = scrapertools.find_single_match(data, '(?s)SRC="(https://www.flashx.tv/counter.cgi\?fx=[^"]+)') + cgi_counter = cgi_counter.replace("%0A","").replace("%22","") + playnow = scrapertools.find_single_match(data, 'https://www.flashx.tv/dl[^"]+') # Para obtener el f y el fxfx - js_fxfx = scrapertools.find_single_match(data, 'src="(https://www.flashx.tv/js/code.js\?cache=[0-9]+)') + js_fxfx = scrapertools.find_single_match(data, 'src="(https://www.flashx.tv/js/code.js.*?cache=[0-9]+)') 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+)') for f, v in matches: pfxfx += f + "=" + v + "&" + coding_url = 'https://www.flashx.tv/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="([^"]+)"') @@ -51,10 +56,11 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= headers['Referer'] = "https://www.flashx.tv/" headers['Accept'] = "*/*" headers['Host'] = "www.flashx.tv" - - coding_url = 'https://www.flashx.tv/flashx.php?%s' %pfxfx headers['X-Requested-With'] = 'XMLHttpRequest' - httptools.downloadpage(coding_url, headers=headers) + + # Obligatorio descargar estos 2 archivos, porque si no, muestra error + httptools.downloadpage(coding_url, headers=headers, replace_headers=True) + httptools.downloadpage(cgi_counter, headers=headers, replace_headers=True) try: time.sleep(int(wait_time) + 1) @@ -63,7 +69,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= headers.pop('X-Requested-With') headers['Content-Type'] = 'application/x-www-form-urlencoded' - data = httptools.downloadpage('https://www.flashx.tv/dl?playitnow', post, headers, replace_headers=True).data + data = httptools.downloadpage(playnow, post, headers, replace_headers=True).data # Si salta aviso, se carga la pagina de comprobacion y luego la inicial # LICENSE GPL3, de alfa-addon: https://github.com/alfa-addon/ ES OBLIGATORIO AÑADIR ESTAS LÍNEAS @@ -71,7 +77,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= url_reload = scrapertools.find_single_match(data, 'try to reload the page.*?href="([^"]+)"') try: data = httptools.downloadpage(url_reload, cookies=False).data - data = httptools.downloadpage('https://www.flashx.tv/dl?playitnow', post, headers, replace_headers=True).data + data = httptools.downloadpage(playnow, post, headers, replace_headers=True).data # LICENSE GPL3, de alfa-addon: https://github.com/alfa-addon/ ES OBLIGATORIO AÑADIR ESTAS LÍNEAS except: pass From 107262cef337a55a65297131f3055e7cd859f14c Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 23 Oct 2017 10:38:23 -0500 Subject: [PATCH 2/9] cinetux: patron actualizado --- plugin.video.alfa/channels/cinetux.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.video.alfa/channels/cinetux.py b/plugin.video.alfa/channels/cinetux.py index 39a48373..a2c86f67 100644 --- a/plugin.video.alfa/channels/cinetux.py +++ b/plugin.video.alfa/channels/cinetux.py @@ -30,7 +30,7 @@ def mainlist(item): data = httptools.downloadpage(CHANNEL_HOST).data total = scrapertools.find_single_match(data, "TENEMOS\s(.*?)") - titulo = "Peliculas (%s)" % total + titulo = "Peliculas" itemlist.append(item.clone(title=titulo, text_color=color2, action="", text_bold=True)) itemlist.append(item.clone(action="peliculas", title=" Novedades", url=CHANNEL_HOST + "pelicula", thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres" @@ -283,7 +283,7 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): if type == "descarga": t_tipo = "Descargar" data = data.replace("\n", "") if type == "online": - patron = '(?is)class="playex.*?visualizaciones' + patron = '(?is)class="playex.*?sheader' bloque1 = scrapertools.find_single_match(data, patron) patron = '(?is)#(option-[^"]+).*?png">([^<]+)' match = scrapertools.find_multiple_matches(data, patron) @@ -303,7 +303,7 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): bloque2 = scrapertools.find_single_match(data, '(?s)box_links.*?dt_social_single') bloque2 = bloque2.replace("\t", "").replace("\r", "") patron = '(?s)optn" href="([^"]+)' - patron += '.*?title="([^\.]+)' + patron += '.*?alt="([^\.]+)' patron += '.*?src.*?src="[^>]+"?/>([^<]+)' patron += '.*?src="[^>]+"?/>([^<]+)' patron += '.*?/span>([^<]+)' From b863f0ea202f54bfd38f5bc9580ad66fd996d0f0 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 23 Oct 2017 12:11:16 -0500 Subject: [PATCH 3/9] animeflv.ru: actualizado findvideos --- plugin.video.alfa/channels/animeflv_ru.py | 38 ++++++----------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/plugin.video.alfa/channels/animeflv_ru.py b/plugin.video.alfa/channels/animeflv_ru.py index e7a0df38..d85b12c0 100755 --- a/plugin.video.alfa/channels/animeflv_ru.py +++ b/plugin.video.alfa/channels/animeflv_ru.py @@ -162,27 +162,20 @@ def novedades_anime(item): def listado(item): logger.info() - data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) - # logger.debug("datito %s" % data) - url_pagination = scrapertools.find_single_match(data, '
(.*?)
') - data = scrapertools.find_single_match(data, '(.*?)
') + + bloque = scrapertools.find_single_match(data, 'ul class="lista"(.*?)') + matches = scrapertools.find_multiple_matches(bloque, '(.*?)
') + + bloque = scrapertools.find_single_match(data, 'ul class="lista"(.*?)') + matches = scrapertools.find_multiple_matches(bloque, '