Fix Wstream
This commit is contained in:
@@ -19,21 +19,19 @@ def test_video_exists(page_url):
|
||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0'],
|
||||
['Host', scrapertools.get_domain_from_url(page_url)]]
|
||||
|
||||
# if 'nored.icu' in str(headers): real_host = 'wstream.video'
|
||||
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
resp = httptools.downloadpage(page_url, headers=headers, verify=False)
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
if 'wstream' in page_url:
|
||||
resp = httptools.downloadpage(page_url.replace(headers[1][1], real_host), headers=headers, verify=False)
|
||||
else:
|
||||
resp = httptools.downloadpage(page_url, headers=headers, verify=False)
|
||||
|
||||
global data, real_url
|
||||
data = resp.data
|
||||
if not data:
|
||||
resp = httptools.downloadpage(page_url.replace(headers[1][1], real_host), headers=headers, verify=False)
|
||||
data = resp.data
|
||||
|
||||
page_url = resp.url.replace(headers[1][1], real_host)
|
||||
if '/streaming.php' in page_url in page_url:
|
||||
code = httptools.downloadpage(page_url, headers=headers, follow_redirects=False, only_headers=True, verify=False).headers['location'].split('/')[-1].replace('.html', '')
|
||||
# logger.info('WCODE=' + code)
|
||||
# logger.log('WCODE=' + code)
|
||||
page_url = 'https://' + real_host + '/video.php?file_code=' + code
|
||||
data = httptools.downloadpage(page_url, headers=headers, follow_redirects=True, verify=False).data
|
||||
|
||||
@@ -46,9 +44,8 @@ def test_video_exists(page_url):
|
||||
dec += chr(int(v) - int(value))
|
||||
page_url = 'https://' + real_host + '/video.php?file_code=' + scrapertools.find_single_match(dec, "src='([^']+)").split('/')[-1].replace('.html','')
|
||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0'],['Host', 'wstream.video']]
|
||||
# from core.support import dbg;dbg()
|
||||
new_data = httptools.downloadpage(page_url, headers=headers, follow_redirects=True, verify=False).data
|
||||
logger.info('NEW DATA: \n' + new_data)
|
||||
logger.log('NEW DATA: \n' + new_data)
|
||||
if new_data:
|
||||
data = new_data
|
||||
|
||||
@@ -61,6 +58,7 @@ def test_video_exists(page_url):
|
||||
|
||||
# Returns an array of possible video url's from the page_url
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
|
||||
def int_bckup_method():
|
||||
global data,headers
|
||||
page_url = scrapertools.find_single_match(data, r"""<center><a href='(https?:\/\/wstream[^']+)'\s*title='bkg'""")
|
||||
@@ -83,8 +81,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
key['type'] = 'mp4'
|
||||
if not 'src' in key and 'file' in key:
|
||||
key['src'] = key['file']
|
||||
video_urls.append(['%s [%s]' % (key['type'].replace('video/', ''), key['label']),
|
||||
key['src'].replace('https', 'http') + '|' + _headers])
|
||||
video_urls.append(['%s [%s]' % (key['type'].replace('video/', ''), key['label']), key['src'].replace('https', 'http') + '|' + _headers])
|
||||
elif type(key) != dict:
|
||||
filetype = key.split('.')[-1]
|
||||
if '?' in filetype: filetype = filetype.split('?')[0]
|
||||
@@ -96,11 +93,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
except:
|
||||
pass
|
||||
|
||||
logger.info("[Wstream] url=" + page_url)
|
||||
logger.log("[Wstream] url=" + page_url)
|
||||
video_urls = []
|
||||
global data, real_url, headers
|
||||
# from core.support import dbg;dbg()
|
||||
# logger.info(data)
|
||||
|
||||
sitekey = scrapertools.find_multiple_matches(data, """data-sitekey=['"] *([^"']+)""")
|
||||
if sitekey: sitekey = sitekey[-1]
|
||||
|
||||
Reference in New Issue
Block a user