diff --git a/pyinstalive/helpers.py b/pyinstalive/helpers.py index d35ac77..875d1b6 100644 --- a/pyinstalive/helpers.py +++ b/pyinstalive/helpers.py @@ -86,10 +86,11 @@ def get_shared_data(data): match_str = match.group(1) return json.loads(match_str).get("config") else: - match = re.search(r"\"raw\":\"({[^\n]*\\\"})", data) - if match: - match_str = string_escape(match.group(1)) - return json.loads(match_str) + csrf_token = re.search(r'"csrf_token":\s*"([^"]+)"', data) + if csrf_token: + csrf_token_value = csrf_token.group(1) + response = {"csrf_token": csrf_token_value} + return response def lock_exists(): return os.path.isfile(os.path.join(globals.config.download_path, globals.download.download_user + '.lock')) @@ -298,4 +299,4 @@ def remove_temp_folder(): try: shutil.rmtree(globals.download.segments_path) except Exception as e: - logger.error("Could not remove segment folder: {:s}".format(str(e))) \ No newline at end of file + logger.error("Could not remove segment folder: {:s}".format(str(e))) diff --git a/requirements.txt b/requirements.txt index 3d214e3..b64f31a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ argparse>=1.4.0 -configparser>=4.0.2 \ No newline at end of file +configparser>=4.0.2 +requests==2.30.0