This commit is contained in:
2025-02-16 13:16:53 -05:00
parent f61c437bf5
commit a8014f286a
6 changed files with 233 additions and 11 deletions

View File

@ -1,11 +1,12 @@
#!/usr/bin/env python3.12
import logging
from typing import Optional
from aiohttp import ClientSession, ClientTimeout
"""Radio Utils"""
async def get_now_playing() -> str:
async def get_now_playing() -> Optional[str]:
np_url: str = "https://api.codey.lol/radio/np"
try:
async with ClientSession() as session:
@ -18,4 +19,5 @@ async def get_now_playing() -> str:
return artistsong
except Exception as e:
logging.critical("Now playing retrieval failed: %s",
str(e))
str(e))
return None