fix parse aria2 host

This commit is contained in:
dishuostec 2024-07-01 12:59:26 +08:00
parent 4448e9a4f1
commit e6e0921bd9

View File

@ -1,11 +1,14 @@
import os
from urllib.parse import urlparse
aria2 = os.getenv('COMFYUI_MANAGER_ARIA2_SERVER')
HF_ENDPOINT = os.getenv('HF_ENDPOINT')
if aria2 is not None:
secret = os.getenv('COMFYUI_MANAGER_ARIA2_SECRET')
host, port = aria2.split(':')
url = urlparse(aria2)
port = url.port
host = url.scheme + '://' + url.hostname
import aria2p
aria2 = aria2p.API(aria2p.Client(host=host, port=port, secret=secret))