From 32d50d3acd95a14af037c6993a0348117adf58c0 Mon Sep 17 00:00:00 2001 From: publicqi <56060664+publicqi@users.noreply.github.com> Date: Mon, 24 Jul 2023 23:29:18 -0700 Subject: [PATCH] fix downloading url --- scripts/ch_lib/downloader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ch_lib/downloader.py b/scripts/ch_lib/downloader.py index 2b14ebc..f9c8376 100644 --- a/scripts/ch_lib/downloader.py +++ b/scripts/ch_lib/downloader.py @@ -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'])