From aa40e811f1735cdb524c4fa4e86a16a72cd83fc3 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 17 Dec 2021 19:17:41 +0100 Subject: [PATCH] LttPAdjuster: ignore alttpr cert --- LttPAdjuster.py | 10 ++++------ worlds/sm/Options.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/LttPAdjuster.py b/LttPAdjuster.py index f66cd038..148fa55f 100644 --- a/LttPAdjuster.py +++ b/LttPAdjuster.py @@ -20,7 +20,7 @@ from urllib.parse import urlparse from urllib.request import urlopen from worlds.alttp.Rom import Sprite, LocalRom, apply_rom_settings, get_base_rom_bytes -from Utils import output_path, local_path, open_file +from Utils import output_path, local_path, open_file, get_cert_none_ssl_context, persistent_store class AdjusterWorld(object): @@ -119,7 +119,6 @@ def main(): sys.exit(1) args, path = adjust(args=args) - from Utils import persistent_store if isinstance(args.sprite, Sprite): args.sprite = args.sprite.name persistent_store("adjuster", "last_settings_3", args) @@ -225,7 +224,6 @@ def adjustGUI(): messagebox.showerror(title="Error while adjusting Rom", message=str(e)) else: messagebox.showinfo(title="Success", message=f"Rom patched successfully to {path}") - from Utils import persistent_store if isinstance(guiargs.sprite, Sprite): guiargs.sprite = guiargs.sprite.name persistent_store("adjuster", "last_settings_3", guiargs) @@ -259,7 +257,7 @@ def update_sprites(task, on_finish=None): successful = True sprite_dir = local_path("data", "sprites", "alttpr") os.makedirs(sprite_dir, exist_ok=True) - + ctx = get_cert_none_ssl_context() def finished(): task.close_window() if on_finish: @@ -267,7 +265,7 @@ def update_sprites(task, on_finish=None): try: task.update_status("Downloading alttpr sprites list") - with urlopen('https://alttpr.com/sprites') as response: + with urlopen('https://alttpr.com/sprites', context=ctx) as response: sprites_arr = json.loads(response.read().decode("utf-8")) except Exception as e: resultmessage = "Error getting list of alttpr sprites. Sprites not updated.\n\n%s: %s" % (type(e).__name__, e) @@ -294,7 +292,7 @@ def update_sprites(task, on_finish=None): def dl(sprite_url, filename): target = os.path.join(sprite_dir, filename) - with urlopen(sprite_url) as response, open(target, 'wb') as out: + with urlopen(sprite_url, context=ctx) as response, open(target, 'wb') as out: shutil.copyfileobj(response, out) def rem(sprite): diff --git a/worlds/sm/Options.py b/worlds/sm/Options.py index b9f9ba64..010e8017 100644 --- a/worlds/sm/Options.py +++ b/worlds/sm/Options.py @@ -42,7 +42,7 @@ class StartLocation(Choice): class DeathLink(Choice): """When DeathLink is enabled and someone dies, you will die. With survive reserve tanks can save you.""" - displayname = "Death Link Survive" + displayname = "Death Link" option_disable = 0 option_enable = 1 option_enable_survive = 3