diff --git a/PlexBot/__init__.py b/PlexBot/__init__.py index 6768d27..badc36c 100644 --- a/PlexBot/__init__.py +++ b/PlexBot/__init__.py @@ -56,7 +56,7 @@ def load_config(filename: str) -> Dict[str, str]: config["plex"]["log_level"] = levels[config["plex"]["log_level"].upper()] config["discord"]["log_level"] = levels[config["discord"]["log_level"].upper()] - if config["lyrics"]["token"].lower() == "none": - config["lyrics"]["token"] = None + if config["lyrics"] and config["lyrics"]["token"].lower() == "none": + config["lyrics"] = None return config diff --git a/PlexBot/__main__.py b/PlexBot/__main__.py index fc8fb9c..1434d00 100644 --- a/PlexBot/__main__.py +++ b/PlexBot/__main__.py @@ -20,8 +20,11 @@ BASE_URL = config["plex"]["base_url"] PLEX_TOKEN = config["plex"]["token"] LIBRARY_NAME = config["plex"]["library_name"] -LYRICS_TOKEN = config["lyrics"]["token"] - +if config["lyrics"]: + LYRICS_TOKEN = config["lyrics"]["token"] +else: + LYRICS_TOKEN = None + # Set appropiate log level root_log = logging.getLogger() plex_log = logging.getLogger("Plex")