6.7.3
python3-ampache 6.7.3
There is now decent Bearer token support for all functions.
import ampache
ampache_connection = ampache.API()
encrypted_key = ampache_connection.encrypt_string('apikey', 'username')
ampache_connection.set_debug(True)
ampache_connection.set_format('json')
ampache_connection.set_url('https://demo.ampache.dev')
ampache_connection.set_bearer_token(encrypted_key)
print(ampache_connection.execute('albums', {'limit': 1}))
When set; your token will be used for all calls so you don't need to keep an eye on your session limits.
Added
- Bearer token support
- Property name
AMPACHE_BEARER_TOKEN(string) - Function
set_bearer_token(bearer_token: str) - Save the token to config when using
save_config() - Load bearer token from
get_config()
- Property name
- Function
get_request(self, ampache_url, data, api_method)to reduce library size
Changed
- Return False for execute commands missing parameters instead of failing at the method call
Fixed
- Avoid errors on bad JSON decodes
- Avoid errors on bad XML decodes