Fix maxstream

This commit is contained in:
mac12m99
2021-10-18 19:20:08 +02:00
parent 1e4e68cb24
commit d6dd20ba1a
+7 -6
View File
@@ -30,10 +30,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
video_urls = [] video_urls = []
global data global data
# support.dbg()
cast_url = support.match('http://maxstream.video/?op=page&tmpl=../../download1', patron='<a\s+id="cast"\s+href="([^"]+)').match
data = httptools.downloadpage(cast_url.replace('https:', 'http:') + page_url.split('/')[-1]).data
# sitekey = scrapertools.find_multiple_matches(data, """data-sitekey=['"] *([^"']+)""") # sitekey = scrapertools.find_multiple_matches(data, """data-sitekey=['"] *([^"']+)""")
# if sitekey: sitekey = sitekey[-1] # if sitekey: sitekey = sitekey[-1]
@@ -55,6 +51,11 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
# url = scrapertools.find_single_match(unpack, 'src:\s*"([^"]+)') # url = scrapertools.find_single_match(unpack, 'src:\s*"([^"]+)')
# if url: # if url:
# video_urls.append(['m3u8 [MaxStream]', url]) # video_urls.append(['m3u8 [MaxStream]', url])
# support.dbg()
possible_cast_url = support.match('http://maxstream.video/?op=page&tmpl=../../download1', patron='<a[^<]+href="(?:https://maxstream\.video/)?([^".?]+/)"').matches
for cast_url in possible_cast_url:
data = httptools.downloadpage('http://maxstream.video/' + cast_url + page_url.split('/')[-1]).data
url_video = '' url_video = ''
lastIndexStart = data.rfind('<script>') lastIndexStart = data.rfind('<script>')
@@ -73,10 +74,10 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
else: else:
logger.debug('Something wrong: no url found before that :(') logger.debug('Something wrong: no url found before that :(')
if url_video: if url_video and url_video.split('/')[-1] == page_url.split('/')[-1]:
import random, string import random, string
parse = urlparse.urlparse(url_video) parse = urlparse.urlparse(url_video)
video_urls.append(['mp4 [MaxStream]', url_video]) video_urls = [['mp4 [MaxStream]', url_video]]
try: try:
r1 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19)) r1 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19))
r2 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19)) r2 = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(19))