From 3dfc63ce79560f07586d1d6a394153c7222dab4c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 21 Sep 2024 18:46:21 -0700 Subject: [PATCH] feat: Add support for following redirects in httpx-based scraping --- aider/scrape.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/scrape.py b/aider/scrape.py index 317d3f011..72e2c7ed9 100755 --- a/aider/scrape.py +++ b/aider/scrape.py @@ -185,7 +185,7 @@ class Scraper: headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"} try: - with httpx.Client(headers=headers, verify=self.verify_ssl) as client: + with httpx.Client(headers=headers, verify=self.verify_ssl, follow_redirects=True) as client: response = client.get(url) response.raise_for_status() return response.text, response.headers.get("content-type", "").split(";")[0]