daasd commited on
Commit
df86cf2
·
1 Parent(s): 00815d2

Update main22.py

Browse files
Files changed (1) hide show
  1. main22.py +3 -5
main22.py CHANGED
@@ -247,15 +247,13 @@ def download_file(item):
247
  file_name = urlparse(download_url).path.split("/")[-1]
248
  # 开始下载
249
  if '.' not in file_name:
250
- print("civitai")
251
  if len(cookie)>0:
252
  cmd = ['aria2c', '--header', f'Cookie:{cookie}', '--console-log-level=error', '-c', '-x', '16', '-s', '16', '-k', '1M', download_url, '-d', lora_dir]
253
  else:
254
- cmd = f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M {download_url} -d {lora_dir}"
255
- result = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
256
  else:
257
- cmd = f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M {download_url} -d {lora_dir} -o {file_name}"
258
- result = subprocess.run(cmd ,shell=True ,stderr=subprocess. PIPE, stdout=subprocess.PIPE)
259
  if result.returncode == 0:
260
  # 判断是civitai还是hugging face还是自定义
261
  # civitai
 
247
  file_name = urlparse(download_url).path.split("/")[-1]
248
  # 开始下载
249
  if '.' not in file_name:
 
250
  if len(cookie)>0:
251
  cmd = ['aria2c', '--header', f'Cookie:{cookie}', '--console-log-level=error', '-c', '-x', '16', '-s', '16', '-k', '1M', download_url, '-d', lora_dir]
252
  else:
253
+ cmd = ['aria2c', '--console-log-level=error', '-c', '-x', '16', '-s', '16', '-k', '1M', download_url, '-d', lora_dir]
 
254
  else:
255
+ cmd = ['aria2c', '--console-log-level=error', '-c', '-x', '16', '-s', '16', '-k', '1M', download_url, '-d', lora_dir ,"-o",file_name]
256
+ result = subprocess.run(cmd ,stderr=subprocess. PIPE, stdout=subprocess.PIPE)
257
  if result.returncode == 0:
258
  # 判断是civitai还是hugging face还是自定义
259
  # civitai