Skip to content

Commit

Permalink
feat: graceful fail if we detect a login redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 authored and tazlin committed Oct 31, 2023
1 parent a759d40 commit b9f0b77
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hordelib/model_manager/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ def _download_thread(self, thread_number):
logger.info(f"Starting download of LORA {lora['filename']}")
response = requests.get(lora["url"], timeout=self.REQUEST_DOWNLOAD_TIMEOUT)
response.raise_for_status()
if "reason=download-auth" in response.url:
logger.error(f"Error downloading {lora['filename']}. CivitAI appears to be redirecting us to a login page. Aborting")
break
# Check the data hash
hash_object = hashlib.sha256()
hash_object.update(response.content)
Expand Down

0 comments on commit b9f0b77

Please sign in to comment.