Update flashx.py
This commit is contained in:
@@ -19,19 +19,13 @@ def test_video_exists(page_url):
|
|||||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||||
logger.info("url=" + page_url)
|
logger.info("url=" + page_url)
|
||||||
pfxfx = ""
|
pfxfx = ""
|
||||||
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',
|
|
||||||
'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1',
|
|
||||||
'Cookie': ''}
|
|
||||||
data = httptools.downloadpage(page_url, cookies=False).data
|
data = httptools.downloadpage(page_url, cookies=False).data
|
||||||
data = data.replace("\n","")
|
data = data.replace("\n","")
|
||||||
cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.sx/counter.cgi.*?[^(?:'|")]+)""")
|
cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.ws/counter.cgi.*?[^(?:'|")]+)""")
|
||||||
cgi_counter = cgi_counter.replace("%0A","").replace("%22","")
|
cgi_counter = cgi_counter.replace("%0A","").replace("%22","")
|
||||||
playnow = scrapertools.find_single_match(data, 'https://www.flashx.sx/dl[^"]+')
|
playnow = scrapertools.find_single_match(data, 'https://www.flashx.ws/dl[^"]+')
|
||||||
# Para obtener el f y el fxfx
|
# Para obtener el f y el fxfx
|
||||||
js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.sx/js\w+/c\w+.*?[^(?:'|")]+)""")
|
js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.ws/js\w+/c\w+.*?[^(?:'|")]+)""")
|
||||||
data_fxfx = httptools.downloadpage(js_fxfx).data
|
data_fxfx = httptools.downloadpage(js_fxfx).data
|
||||||
mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'","").replace(" ","")
|
mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'","").replace(" ","")
|
||||||
matches = scrapertools.find_multiple_matches(mfxfx, '(\w+):(\w+)')
|
matches = scrapertools.find_multiple_matches(mfxfx, '(\w+):(\w+)')
|
||||||
@@ -41,9 +35,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
logger.info("mfxfxfx2= %s" %pfxfx)
|
logger.info("mfxfxfx2= %s" %pfxfx)
|
||||||
if pfxfx == "":
|
if pfxfx == "":
|
||||||
pfxfx = "ss=yes&f=fail&fxfx=6"
|
pfxfx = "ss=yes&f=fail&fxfx=6"
|
||||||
coding_url = 'https://www.flashx.sx/flashx.php?%s' %pfxfx
|
coding_url = 'https://www.flashx.ws/flashx.php?%s' %pfxfx
|
||||||
# {f: 'y', fxfx: '6'}
|
# {f: 'y', fxfx: '6'}
|
||||||
bloque = scrapertools.find_single_match(data, '(?s)Form method="POST" action(.*?)<!--')
|
bloque = scrapertools.find_single_match(data, '(?s)Form method="POST" action(.*?)span')
|
||||||
flashx_id = scrapertools.find_single_match(bloque, 'name="id" value="([^"]+)"')
|
flashx_id = scrapertools.find_single_match(bloque, 'name="id" value="([^"]+)"')
|
||||||
fname = scrapertools.find_single_match(bloque, 'name="fname" value="([^"]+)"')
|
fname = scrapertools.find_single_match(bloque, 'name="fname" value="([^"]+)"')
|
||||||
hash_f = scrapertools.find_single_match(bloque, 'name="hash" value="([^"]+)"')
|
hash_f = scrapertools.find_single_match(bloque, 'name="hash" value="([^"]+)"')
|
||||||
@@ -52,11 +46,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
flashx_id, urllib.quote(fname), hash_f, imhuman)
|
flashx_id, urllib.quote(fname), hash_f, imhuman)
|
||||||
wait_time = scrapertools.find_single_match(data, "<span id='xxc2'>(\d+)")
|
wait_time = scrapertools.find_single_match(data, "<span id='xxc2'>(\d+)")
|
||||||
|
|
||||||
headers['Referer'] = "https://www.flashx.sx/"
|
|
||||||
headers['Accept'] = "*/*"
|
|
||||||
headers['Host'] = "www.flashx.sx"
|
|
||||||
headers['X-Requested-With'] = 'XMLHttpRequest'
|
|
||||||
|
|
||||||
# Obligatorio descargar estos 2 archivos, porque si no, muestra error
|
# Obligatorio descargar estos 2 archivos, porque si no, muestra error
|
||||||
httptools.downloadpage(coding_url, cookies=False)
|
httptools.downloadpage(coding_url, cookies=False)
|
||||||
httptools.downloadpage(cgi_counter, cookies=False)
|
httptools.downloadpage(cgi_counter, cookies=False)
|
||||||
@@ -66,8 +55,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
except:
|
except:
|
||||||
time.sleep(6)
|
time.sleep(6)
|
||||||
|
|
||||||
headers.pop('X-Requested-With')
|
|
||||||
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
||||||
data = httptools.downloadpage(playnow, post).data
|
data = httptools.downloadpage(playnow, post).data
|
||||||
# Si salta aviso, se carga la pagina de comprobacion y luego la inicial
|
# 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
|
# LICENSE GPL3, de alfa-addon: https://github.com/alfa-addon/ ES OBLIGATORIO AÑADIR ESTAS LÍNEAS
|
||||||
|
|||||||
Reference in New Issue
Block a user