mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-04 03:03:18 -05:00 
			
		
		
		
	fix: Follow redirects during scraping (#3875)
This commit is contained in:
		@@ -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):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user