civitai multithreaded downloads

This commit is contained in:
Vladimir Mandic
2023-10-03 10:46:00 -04:00
parent 578d270cab
commit 1e70a1ae57
8 changed files with 99 additions and 45 deletions
+3 -2
View File
@@ -1010,8 +1010,9 @@ def get_version():
return version
def req(url_addr, **kwargs):
headers = { 'Content-type': 'application/json' }
def req(url_addr, headers = None, **kwargs):
if headers is None:
headers = { 'Content-type': 'application/json' }
try:
res = requests.get(url_addr, timeout=30, headers=headers, verify=False, allow_redirects=True, **kwargs)
except Exception as e: