sounds.auth¶
Attributes¶
Classes¶
Service to handle authentication with BBC Sounds. |
Functions¶
|
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.BaseService to handle authentication with BBC Sounds.
- user_info = None¶
- debug_login = False¶
- 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:
- Raises:
LoginFailedError – If the login fails for any reason
UnauthorisedError – If the login is not authorised
- 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()¶