From f4f45b392b7bc664918eda16b84602cf2395a785 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 13 Jan 2025 12:37:13 -0800 Subject: [PATCH] Use requests library to resolve SSL errors. --- glob/manager_core.py | 2 +- glob/manager_downloader.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index db7ac8848..d0b1ec49a 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -893,7 +893,7 @@ def cnr_switch_version_instant(self, node_id, version_spec=None, instant_executi archive_name = f"CNR_temp_{str(uuid.uuid4())}.zip" # should be unpredictable name - security precaution download_path = os.path.join(get_default_custom_nodes_path(), archive_name) - manager_downloader.download_url(node_info.download_url, get_default_custom_nodes_path(), archive_name) + manager_downloader.basic_download_url(node_info.download_url, get_default_custom_nodes_path(), archive_name) # 2. extract files into install_path = self.active_nodes[node_id][1] diff --git a/glob/manager_downloader.py b/glob/manager_downloader.py index 715bf65fa..b6393b265 100644 --- a/glob/manager_downloader.py +++ b/glob/manager_downloader.py @@ -16,7 +16,11 @@ aria2 = aria2p.API(aria2p.Client(host=host, port=port, secret=secret)) -def basic_download_url(url, dest_folder, filename): +def basic_download_url(url, dest_folder: str, filename: str): + ''' + Download file from url to dest_folder with filename + using requests library. + ''' import requests # Ensure the destination folder exists @@ -111,4 +115,4 @@ def download_url_with_agent(url, save_path): return False print("Installation was successful.") - return True \ No newline at end of file + return True