fix downloading url

pull/219/head
publicqi 2023-07-24 23:29:18 -07:00 committed by GitHub
parent 920ca3267f
commit 32d50d3acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ def dl(url, folder, filename, filepath):
# first request for header
rh = requests.get(url, stream=True, verify=False, headers=util.def_headers, proxies=util.proxies)
if rh.status_code == 404:
util.printD("404. Trying VAE now.")
url += "?type=VAE"
rh = requests.get(url, stream=True, verify=False, headers=util.def_headers, proxies=util.proxies)
# get file size
total_size = 0
total_size = int(rh.headers['Content-Length'])