Use requests library to resolve SSL errors. (#1450)

This commit is contained in:
Robin Huang 2025-01-14 14:20:45 -08:00 committed by GitHub
parent 5e5867528d
commit f63205f86c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -893,7 +893,7 @@ class UnifiedManager:
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]

View File

@ -16,7 +16,11 @@ if aria2 is not None:
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