Spaces:
Runtime error
Runtime error
eljanmahammadli
commited on
Commit
·
6f4a113
1
Parent(s):
c359315
#bugfix response 301 is solved, as we should explicitly set follow_redirects for httpx
Browse files- google_search.py +1 -1
google_search.py
CHANGED
@@ -121,7 +121,7 @@ def build_date(year=2024, month="March", day=1):
|
|
121 |
|
122 |
async def get_url_data(url, client):
|
123 |
try:
|
124 |
-
r = await client.get(url)
|
125 |
if r.status_code == 200:
|
126 |
content_type = r.headers.get("Content-Type", "").lower()
|
127 |
# detect if pdf
|
|
|
121 |
|
122 |
async def get_url_data(url, client):
|
123 |
try:
|
124 |
+
r = await client.get(url, follow_redirects=True)
|
125 |
if r.status_code == 200:
|
126 |
content_type = r.headers.get("Content-Type", "").lower()
|
127 |
# detect if pdf
|