mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 21:15:22 +02:00
fix: Follow redirects during scraping (#3875)
This commit is contained in:
parent
47124488bb
commit
fd2dc15a15
1 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,9 @@ async def safe_scrape_html(url: str) -> str:
|
|||
"""
|
||||
async with AsyncClient(transport=safehttp.AsyncSafeTransport()) as client:
|
||||
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()
|
||||
|
||||
async for chunk in resp.aiter_bytes(chunk_size=1024):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue