Handle missing 'librespot' extra

This commit is contained in:
Rafael Moraes
2026-03-26 19:47:18 -03:00
parent b2febdbbea
commit 81ae99ff42
+14 -4
View File
@@ -93,10 +93,20 @@ async def main(config: CliConfig):
database = None
flat_filter = None
api = await SpotifyApi.create_from_netscape_cookies(
cookies_path,
session_type=config.session_type,
)
try:
api = await SpotifyApi.create_from_netscape_cookies(
cookies_path,
session_type=config.session_type,
)
except ModuleNotFoundError as e:
if e.name == "librespot":
logger.critical(
"The 'librespot' extra is required to use the librespot session type, "
"please install the package with `pip install votify[librespot]` and try again"
)
return
raise e
if api.anonymous_session:
logger.critical(
"Could not authenticate with the provided cookies, "