mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
fix: Follow redirects during scraping (#3875)
This commit is contained in:
parent
47124488bb
commit
fd2dc15a15
@ -44,7 +44,9 @@ async def safe_scrape_html(url: str) -> str:
|
|||||||
"""
|
"""
|
||||||
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
||||||
html_bytes = b""
|
html_bytes = b""
|
||||||
async with client.stream("GET", url, timeout=SCRAPER_TIMEOUT, headers={"User-Agent": _FIREFOX_UA}) as resp:
|
async with client.stream(
|
||||||
|
"GET", url, timeout=SCRAPER_TIMEOUT, headers={"User-Agent": _FIREFOX_UA}, follow_redirects=True
|
||||||
|
) as resp:
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
||||||
async for chunk in resp.aiter_bytes(chunk_size=1024):
|
async for chunk in resp.aiter_bytes(chunk_size=1024):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user