From 2ef4234a42e1187c072787d38acfaa4cc68b4197 Mon Sep 17 00:00:00 2001 From: pipcat Date: Fri, 13 Apr 2018 09:40:54 +0200 Subject: [PATCH 1/3] Cambios para capturar la url Mantengo rutina anterior, ya que ha servido de base para hacer la nueva, que es parecida. --- plugin.video.alfa/servers/flashx.py | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py index 33d9a8d3..7ad3a1a7 100644 --- a/plugin.video.alfa/servers/flashx.py +++ b/plugin.video.alfa/servers/flashx.py @@ -18,6 +18,58 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) + + data = httptools.downloadpage(page_url).data + + cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.bz/counter.cgi.*?[^(?:'|")]+)""") + cgi_counter = cgi_counter.replace("%0A","").replace("%22","") + httptools.downloadpage(cgi_counter, cookies=False) + + time.sleep(6) + + url_playitnow = "https://www.flashx.bz/dl?playitnow" + fid = scrapertools.find_single_match(data, 'input type="hidden" name="id" value="([^"]*)"') + fname = scrapertools.find_single_match(data, 'input type="hidden" name="fname" value="([^"]*)"') + fhash = scrapertools.find_single_match(data, 'input type="hidden" name="hash" value="([^"]*)"') + + headers = {'Content': 'application/x-www-form-urlencoded'} + post_parameters = { + "op": "download1", + "usr_login": "", + "id": fid, + "fname": fname, + "referer": "https://www.flashx.bz/", + "hash": fhash, + "imhuman": "Continue To Video" + } + data = httptools.downloadpage(url_playitnow, urllib.urlencode(post_parameters), headers=headers).data + + video_urls = [] + media_urls = scrapertools.find_multiple_matches(data, "{src: '([^']+)'.*?,label: '([^']+)'") + subtitle = "" + for media_url, label in media_urls: + if media_url.endswith(".srt") and label == "Spanish": + try: + from core import filetools + data = httptools.downloadpage(media_url) + subtitle = os.path.join(config.get_data_path(), 'sub_flashx.srt') + filetools.write(subtitle, data) + except: + import traceback + logger.info("Error al descargar el subtítulo: " + traceback.format_exc()) + + for media_url, label in media_urls: + if not media_url.endswith("png") and not media_url.endswith(".srt"): + video_urls.append(["." + media_url.rsplit('.', 1)[1] + " [flashx]", media_url, 0, subtitle]) + + for video_url in video_urls: + logger.info("%s - %s" % (video_url[0], video_url[1])) + + return video_urls + + +def get_video_url_anterior(page_url, premium=False, user="", password="", video_password=""): + logger.info("url=" + page_url) pfxfx = "" data = httptools.downloadpage(page_url, cookies=False).data data = data.replace("\n","") From 4fcbc82af978d7ae96d34b52932368827b83be4b Mon Sep 17 00:00:00 2001 From: pipcat Date: Thu, 26 Apr 2018 11:06:40 +0200 Subject: [PATCH 2/3] igualar con repo alfa --- plugin.video.alfa/servers/flashx.py | 52 ----------------------------- 1 file changed, 52 deletions(-) diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py index ce543c25..e657ab05 100644 --- a/plugin.video.alfa/servers/flashx.py +++ b/plugin.video.alfa/servers/flashx.py @@ -18,58 +18,6 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) - - data = httptools.downloadpage(page_url).data - - cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.bz/counter.cgi.*?[^(?:'|")]+)""") - cgi_counter = cgi_counter.replace("%0A","").replace("%22","") - httptools.downloadpage(cgi_counter, cookies=False) - - time.sleep(6) - - url_playitnow = "https://www.flashx.bz/dl?playitnow" - fid = scrapertools.find_single_match(data, 'input type="hidden" name="id" value="([^"]*)"') - fname = scrapertools.find_single_match(data, 'input type="hidden" name="fname" value="([^"]*)"') - fhash = scrapertools.find_single_match(data, 'input type="hidden" name="hash" value="([^"]*)"') - - headers = {'Content': 'application/x-www-form-urlencoded'} - post_parameters = { - "op": "download1", - "usr_login": "", - "id": fid, - "fname": fname, - "referer": "https://www.flashx.bz/", - "hash": fhash, - "imhuman": "Continue To Video" - } - data = httptools.downloadpage(url_playitnow, urllib.urlencode(post_parameters), headers=headers).data - - video_urls = [] - media_urls = scrapertools.find_multiple_matches(data, "{src: '([^']+)'.*?,label: '([^']+)'") - subtitle = "" - for media_url, label in media_urls: - if media_url.endswith(".srt") and label == "Spanish": - try: - from core import filetools - data = httptools.downloadpage(media_url) - subtitle = os.path.join(config.get_data_path(), 'sub_flashx.srt') - filetools.write(subtitle, data) - except: - import traceback - logger.info("Error al descargar el subtítulo: " + traceback.format_exc()) - - for media_url, label in media_urls: - if not media_url.endswith("png") and not media_url.endswith(".srt"): - video_urls.append(["." + media_url.rsplit('.', 1)[1] + " [flashx]", media_url, 0, subtitle]) - - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) - - return video_urls - - -def get_video_url_anterior(page_url, premium=False, user="", password="", video_password=""): - logger.info("url=" + page_url) pfxfx = "" data = httptools.downloadpage(page_url, cookies=False).data data = data.replace("\n","") From b57dd2989a16c7c261824b5445107ec20b8f3ab1 Mon Sep 17 00:00:00 2001 From: pipcat Date: Thu, 26 Apr 2018 18:04:38 +0200 Subject: [PATCH 3/3] Bug interno en episodios --- plugin.video.alfa/channels/cinefox.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) 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)