Fix not fetching images properlly when url is redirected (#526)

This commit is contained in:
Humberto Rocha 2023-02-26 02:07:25 -05:00 committed by GitHub
parent 9aff13118a
commit d9cab99859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,9 @@ async def get_remote_file(
}
async with httpx.AsyncClient(headers=headers) as client:
async with client.stream("GET", url, timeout=timeout) as stream:
async with client.stream(
"GET", url, timeout=timeout, follow_redirects=True
) as stream:
allow_download = max_size is None
if max_size:
try: