Skip to content

Commit

Permalink
download: fix for text files without content-length
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Oct 30, 2023
1 parent 2d299da commit 0c2846d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion happypose/toolbox/utils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ async def download_file(self, download_path, local_path):
local_path.parent.mkdir(parents=True, exist_ok=True)
with local_path.open("wb") as f:
async with self.client.stream("GET", download_path) as r:
total = int(r.headers["Content-Length"])
total = None
if "Content-Length" in r.headers:
total = int(r.headers["Content-Length"])
with tqdm(
desc=local_path.name,
total=total,
Expand Down

0 comments on commit 0c2846d

Please sign in to comment.