lightweight meta tags
Build and Push Docker Images / build-and-push (push) Successful in 5m25s

This commit is contained in:
2025-06-05 14:05:38 +02:00
parent 5d0ab2ebd0
commit e2cfcfad34
3 changed files with 56 additions and 48 deletions
@@ -0,0 +1,15 @@
from aiohttp import ClientSession, ClientTimeout
from app.config import CUSTOM_USER_AGENT
async def fetch_url(url: str) -> tuple[str, int]:
"""
Fetch a URL using aiohttp and return the content and status code
"""
timeout = ClientTimeout(total=30) # 30 second timeout
async with ClientSession(timeout=timeout) as session:
headers = {
'User-Agent': CUSTOM_USER_AGENT
}
async with session.get(url, headers=headers) as response:
content = await response.text()
return content, response.status