Skip to content

Commit

Permalink
Use requests library to resolve SSL errors. (#1450)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang authored Jan 14, 2025
1 parent 5e58675 commit f63205f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion glob/manager_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <node_id>
install_path = self.active_nodes[node_id][1]
Expand Down
8 changes: 6 additions & 2 deletions glob/manager_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,4 +115,4 @@ def download_url_with_agent(url, save_path):
return False

print("Installation was successful.")
return True
return True

0 comments on commit f63205f

Please sign in to comment.