sounds.auth

Attributes

COOKIE_FILE

Classes

AuthService

Service to handle authentication with BBC Sounds.

Functions

login_required(method)

Decorator to catch expired sessions and reauthenticate before trying again.

Module Contents

sounds.auth.COOKIE_FILE
sounds.auth.login_required(method)

Decorator to catch expired sessions and reauthenticate before trying again.

class sounds.auth.AuthService(*args, **kwargs)

Bases: sounds.base.Base

Service to handle authentication with BBC Sounds.

user_info = None
debug_login = False
async set_user_info() None
property is_logged_in: bool

Check if we have a valid session.

property listener_country: str | None

Return the listener’s current country.

property is_in_uk: bool

Listener is in the UK.

property is_uk_listener: bool

Listener has a UK-based account and is in the UK.

async authenticate(username: str, password: str) bool

Signs into BBC Sounds.

Parameters:
  • username – The username or email address to sign in with

  • password – The password to sign in with

Returns:

True if successfully logged in, False otherwise

Return type:

bool

Raises:
save_cookies_to_disk()

Saved the cookie jar to disk to persist a session.

async renew_session()

Renew a session which has expired, but user is logged in.

async logout()