From 06fe40ed9e8ce6db53cc3abaf7381384f9b59fba Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Fri, 8 Oct 2021 19:27:02 +0200 Subject: [PATCH] Fix maxstream --- core/httptools.py | 3 ++- servers/maxstream.json | 2 +- servers/maxstream.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/httptools.py b/core/httptools.py index 5359cef8..e719590e 100755 --- a/core/httptools.py +++ b/core/httptools.py @@ -48,7 +48,8 @@ directIP = { 'nored.icu': '31.220.1.77', 'wstream.icu': '31.220.1.77', 'wstream.video': '31.220.1.77', - 'krask.xyz': '31.220.1.77' + 'krask.xyz': '31.220.1.77', + 'maxstream.video': '109.236.81.23' } # Maximum wait time for downloadpage, if nothing is specified diff --git a/servers/maxstream.json b/servers/maxstream.json index 902c5f0a..02fa98d2 100644 --- a/servers/maxstream.json +++ b/servers/maxstream.json @@ -5,7 +5,7 @@ "patterns": [ { "pattern": "https?://maxstream.video/(?:e/|embed-|cast/)?([a-z0-9]+)", - "url": "https://maxstream.video/cast/\\1" + "url": "http://maxstream.video/cast/\\1" } ] }, diff --git a/servers/maxstream.py b/servers/maxstream.py index ece93bce..2d31235a 100644 --- a/servers/maxstream.py +++ b/servers/maxstream.py @@ -40,8 +40,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= char_codes = ast.literal_eval(match[0]) hidden_js = "".join([chr(c - int(match[1])) for c in char_codes]) - newurl = scrapertools.find_single_match(hidden_js, r'\$.get\(\'([^\']+)') - castpage = httptools.downloadpage(newurl, headers={'x-requested-with': 'XMLHttpRequest', 'Referer': page_url }).data + newurl = scrapertools.find_single_match(hidden_js, r'\$.get\(\'([^\']+)').replace('https://', 'http://') + castpage = httptools.downloadpage(newurl, headers={'x-requested-with': 'XMLHttpRequest', 'Referer': page_url}).data url_video = scrapertools.find_single_match(castpage, r"cc\.cast\('(http[s]?.[^']+)'") else: logger.debug('Something wrong: no url found before that :(')