From d9cab99859a5aed78bd390f86348d83b024609be Mon Sep 17 00:00:00 2001 From: Humberto Rocha Date: Sun, 26 Feb 2023 02:07:25 -0500 Subject: [PATCH] Fix not fetching images properlly when url is redirected (#526) --- core/files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/files.py b/core/files.py index aaf9b13..8a0c5c0 100644 --- a/core/files.py +++ b/core/files.py @@ -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: