misc
This commit is contained in:
		| @@ -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    | ||||
		Reference in New Issue
	
	Block a user