From d48ca59d62eff9dfaedf68fbe8e7b840ffc9b475 Mon Sep 17 00:00:00 2001
From: mac12m99 <10120390+mac12m99@users.noreply.github.com>
Date: Fri, 22 Oct 2021 19:03:30 +0200
Subject: [PATCH] Fix maxstream
---
core/httptools.py | 1 -
servers/maxstream.py | 86 +++++++++++++++++++++++---------------------
2 files changed, 45 insertions(+), 42 deletions(-)
diff --git a/core/httptools.py b/core/httptools.py
index e719590e..7727800f 100755
--- a/core/httptools.py
+++ b/core/httptools.py
@@ -49,7 +49,6 @@ directIP = {
'wstream.icu': '31.220.1.77',
'wstream.video': '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.py b/servers/maxstream.py
index 13d7fea5..99e60340 100644
--- a/servers/maxstream.py
+++ b/servers/maxstream.py
@@ -4,6 +4,8 @@
# --------------------------------------------------------
import ast, sys
+import requests
+
from core import httptools, scrapertools, support
from lib import jsunpack
from platformcode import logger, config, platformtools
@@ -29,7 +31,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
logger.debug("url=" + page_url)
video_urls = []
global data
-
+ if 'captcha' in data:
+ httptools.set_cookies(requests.get('http://lozioangie.altervista.org/maxcookie.php').json())
+ data = httptools.downloadpage(page_url).data
# sitekey = scrapertools.find_multiple_matches(data, """data-sitekey=['"] *([^"']+)""")
# if sitekey: sitekey = sitekey[-1]
@@ -46,44 +50,44 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
# platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(707434))
# return []
- # packed = support.match(data, patron=r"(eval\(function\(p,a,c,k,e,d\).*?)\s*')
- lastIndexEnd = data.rfind('')
-
- script = data[ (lastIndexStart + len('')
+ #
+ # script = data[ (lastIndexStart + len('