From bd84cf2b7c70df6c73cdd0c623740aa61d4e93f1 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Mon, 25 Sep 2017 17:35:34 -0500 Subject: [PATCH] Update flashx.py --- plugin.video.alfa/servers/flashx.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin.video.alfa/servers/flashx.py b/plugin.video.alfa/servers/flashx.py index 86fac9d8..373a1526 100644 --- a/plugin.video.alfa/servers/flashx.py +++ b/plugin.video.alfa/servers/flashx.py @@ -27,8 +27,6 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) - page_url = page_url.replace("playvid-", "") - headers = {'Host': 'www.flashx.tv', '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', @@ -60,8 +58,16 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= headers['Content-Type'] = 'application/x-www-form-urlencoded' data = httptools.downloadpage('https://www.flashx.tv/dl?playnow', post, headers, replace_headers=True).data + # Si salta aviso, se carga la pagina de comprobacion y luego la inicial + if "You try to access this video with Kodi" in data: + 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?playnow', post, headers, replace_headers=True).data + except: + pass + matches = scrapertools.find_multiple_matches(data, "(eval\(function\(p,a,c,k.*?)\s+") - video_urls = [] for match in matches: try: