Allow passing of a civit api key

This commit is contained in:
Brandon Rising
2024-01-30 20:35:01 -05:00
committed by Kent Keirsey
parent f48a2c5fd2
commit 14efc95707
2 changed files with 7 additions and 3 deletions

View File

@ -286,9 +286,8 @@ def download_with_resume(url: str, dest: Path, access_token: str = None) -> Path
open_mode = "wb"
exist_size = 0
resp = requests.get(url, header, stream=True)
resp = requests.get(url, headers=header, stream=True, allow_redirects=True)
content_length = int(resp.headers.get("content-length", 0))
if dest.is_dir():
try:
file_name = re.search('filename="(.+)"', resp.headers.get("Content-Disposition")).group(1)