From 2d331288dd0e37c9f15c47cf6cda51b6a7c1673c Mon Sep 17 00:00:00 2001 From: Kharec Date: Sun, 7 Dec 2025 14:01:37 +0100 Subject: [PATCH] feat: make authentication less verbose --- auditui/auth.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/auditui/auth.py b/auditui/auth.py index a753ff0..8464747 100644 --- a/auditui/auth.py +++ b/auditui/auth.py @@ -9,7 +9,9 @@ import audible from .constants import AUTH_PATH -def authenticate(auth_path: Path = AUTH_PATH) -> Tuple[audible.Authenticator, audible.Client]: +def authenticate( + auth_path: Path = AUTH_PATH, +) -> Tuple[audible.Authenticator, audible.Client]: """Authenticate with Audible and return authenticator and client.""" auth_path.parent.mkdir(parents=True, exist_ok=True) @@ -23,14 +25,11 @@ def authenticate(auth_path: Path = AUTH_PATH) -> Tuple[audible.Authenticator, au print("Please re-authenticate.") print("Please authenticate with your Audible account.") - print("You will need to provide:") - print(" - Your Audible email/username") - print(" - Your password") - print(" - Your marketplace locale (e.g., 'US', 'UK', 'DE', 'FR')") email = input("\nEmail: ") password = getpass("Password: ") - marketplace = input("Marketplace locale (default: US): ").strip().upper() or "US" + marketplace = input( + "Marketplace locale (default: US): ").strip().upper() or "US" authenticator = audible.Authenticator.from_login( username=email, password=password, locale=marketplace @@ -41,4 +40,3 @@ def authenticate(auth_path: Path = AUTH_PATH) -> Tuple[audible.Authenticator, au print("Authentication successful!") audible_client = audible.Client(auth=authenticator) return authenticator, audible_client -