Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
Unreleased
Added
Optional high-performance crypto backends for significantly improved performance:
cryptography(Rust-accelerated, recommended) - install withpip install audible[cryptography]pycryptodome(C-based) - install withpip install audible[pycryptodome]Automatic provider selection: cryptography → pycryptodome → legacy (pure Python fallback)
Performance improvements: 5-10x faster AES operations, 10-20x faster RSA operations, 3-5x faster PBKDF2, 5-10x faster hashing
New
audible.crypto_providermodule with protocol-based provider abstraction layer:protocols.py- Type-safe Protocol definitions for crypto operationscryptography_provider.py- High-performance implementation using cryptography librarypycryptodome_provider.py- High-performance implementation using pycryptodome librarylegacy_provider.py- Pure-Python implementation wrapper (pyaes, rsa, pbkdf2)registry.py- Provider selection and caching with lazy initialization
RSA key caching in
Authenticatorfor improved performance on repeated API requestsProvider override capability: pass
crypto_providerparameter toAuthenticator.from_file()and related methodsProcess-wide default provider configuration via
set_default_crypto_provider()Optional high-performance JSON backends for significantly improved JSON serialization performance:
orjson(Rust-based, 4-5x faster for compact JSON) - install withpip install audible[orjson]ujson(C-based, 2-3x faster with indent=4 support) - install withpip install audible[ujson]rapidjson(C++ based, 2-3x faster) - install withpip install audible[rapidjson]json-fullextra (recommended) - install withpip install audible[json-full]for complete coverage (orjson + ujson)json-fastextra - install withpip install audible[json-fast]for orjson onlyAutomatic provider selection: orjson → ujson → rapidjson → stdlib (pure Python fallback)
Performance improvements: 4-5x faster compact JSON (orjson), 2-3x faster pretty-printed JSON (ujson/rapidjson)
Smart fallback logic: orjson automatically uses ujson/rapidjson for indent=4
New
audible.json_providermodule with protocol-based provider abstraction layer:protocols.py- Type-safe Protocol definition for JSON operationsorjson_provider.py- High-performance implementation using orjson library with smart fallback logicujson_provider.py- High-performance implementation using ujson libraryrapidjson_provider.py- High-performance implementation using python-rapidjson librarystdlib_provider.py- Standard library json wrapper (always available)registry.py- Provider selection and caching with auto-detection
Process-wide default JSON provider configuration via
set_default_json_provider()
Changed
BREAKING (unreleased modules only): Renamed
audible.jsonmodule toaudible.json_providerto avoid naming conflicts with Python’s built-in json moduleBREAKING (unreleased modules only): Renamed
audible.cryptomodule toaudible.crypto_providerfor consistency and clarityNote: These modules have not been released yet, so this affects only users testing from the main branch
All imports must be updated:
from audible.json import→from audible.json_provider importAll imports must be updated:
from audible.crypto import→from audible.crypto_provider import
Replaced
darglintwithpydoclintfor docstring validation - modern, actively maintained alternative with better Protocol supportaescipher.pynow uses crypto providers for AES, PBKDF2, and hashing operationsaescipher.pynow uses JSON providers for JSON serialization/deserializationauth.pynow uses crypto providers for RSA signing operationsauth.pynow uses JSON providers for JSON serialization/deserializationlogin.pynow uses JSON providers for JSON serializationclient.pynow uses JSON providers for HTTP response deserialization (replaces httpx’s internal json.loads())metadata.pystill uses stdlib json directly for separators (edge case)Performance optimization: Request parameter lookup now uses
frozensetinstead oflistfor O(1) membership testing (previously O(n))Performance optimization: Debug logging in
client.pynow uses lazy evaluation withisEnabledFor(logging.DEBUG)to avoid expensive response text formatting when debug logging is disabledReplaced
os.urandomwithsecrets.token_bytesfor better cryptographic randomnessImproved error messages and type annotations throughout crypto layer
Improved error messages and type annotations throughout JSON layer
Simplified RSA key loading by removing redundant module-level cache (Authenticator-level caching remains)
Improved docstring quality across codebase:
Added missing return type documentation in Protocol definitions
Moved
__init__docstrings to class-level (Google Style Guide compliant)Added explicit type hints for
hashmodandmacparametersFixed argument order mismatches between signatures and docstrings
Added missing exception documentation
Fixed
Prevent SHA-1 deprecation warning spam from cryptography library
Security vulnerabilities in crypto handling
MyPy typing issues in crypto provider implementations
Documentation
Added comprehensive installation guide for crypto extras in README and docs
Added comprehensive installation guide for JSON extras in README
Added performance benchmarks and provider selection documentation for crypto providers
Added performance benchmarks and provider selection documentation for JSON providers
Added version requirement notes (crypto features available in audible >= 0.11.0)
Added version requirement notes (JSON features available in audible >= 0.11.0)
Added example scripts for crypto provider usage
Added example scripts for JSON provider usage (
examples/test_json_autodetect.py,examples/test_json_explicit.py)
Bugfix
Make register() resilient to missing fields in the registration response:
Use tokens.get(“store_authentication_cookie”) instead of direct indexing to avoid KeyError when the server does not return this cookie.
Only populate website_cookies when the API includes them; previously code assumed presence and could raise errors.
[0.10.0] - 2024-09-26
Bugfix
Fix
autodetect_localefunction
Misc
Drop support for Python 3.8 and 3.9
Add support for Python 3.12
[0.9.1] - 2023-09-27
Bugfix
Fix login issues on brazilian marketplace.
Fix a
RecursionErrorwhich occurs when checking the length of anAuthenticatorinstance.
[0.9.0] - 2023-09-27
Bugfix
Multiple fixes for XXTEA encryption/decryption in metadata module.
Added
Add brazilian marketplace.
Login function now checks for a
verification-code-formtag in login HTML page.
Changes
Drop support for Python 3.7.
Misc
First step to refactor code.
Switch project to poetry.
Using nox and ruff for tests and linting.
[0.8.2] - 2022-05-25
Changed
Allow httpx v0.23.x to fix a bug in httpx
[0.8.1] - 2022-04-20
Bugfix
fix a bug in
Client.deleteandAsyncClient.deletemethod
[0.8.0] - 2022-04-11
Added
full support of pre-Amazon accounts (e.g. refresh access token, deregister device)
ClientandAsynClientnow accepts session kwargs which are bypassed to the underlying httpx Clienta
respone_callbackcan now be set toClientandAsyncClientclass to allow custom preparation of response outputAn absolut url (e.g. https://cde-ta-g7g.amazon.com/FionaCDEServiceEngine/sidecar) can now be passed to a client
get,post,deleteandputmethod as thepatharg. So in most cases the clientraw_requestmethod is not needed anymore.
Changed
rename (and rework)
Client._split_kwargstoClient._prepare_params
[0.7.2] - 2022-03-27
Bugfix
fix a bug in registration url
[0.7.1] - 2022-03-27
Added
Authenticator.from_dictto instantiate anAuthenticatorfrom dict andAuthenticator.to_dictto get authentication data as dict
Bugfix
register a new device with
with_username=Trueresults in a server error due to wrong registration domain
[0.7.0] - 2021-10-25
Bugfix
make sure activation bytes has 8 bytes, otherwise append ‚0‘ in front until 8 bytes are reached
make sure metadata1 has 8 bytes, otherwise append ‚0‘ in front until 8 bytes are reached
If installed, use playwright to login with external browser. Please read here how to install playwright. Then use
audible.Authenticator.from_login_external(COUNTRY_CODE)for login.fix login issues
[0.6.0] - 2021-10-21
Bugfix
Fix a bug when searching for „resend-approval-link“ in login page
Changed
switched to
auth_code_flowwhen login (gives an auth code instead of an access token for security purposes)Authenticator.from_loginandAuthenticator.from_login_externalnow always register a new deviceAuthenticatornow refreshesaccess_token(when needed) before deregister the devicenow simulate Audible app version 3.56.2 under iOS version 15.0.0
login process now auto-detect next request method and url
Misc
Correct documentation
Update example download_books_aaxc.py
Bump httpx to
v0.20.*
Remove
LoginAuthenticatorandFileAuthenticatorAuthenticator.register_device,Authenticator.re_loginandAuthenticator.re_login_external
[0.5.5] - 2021-07-22
Misc
switch from httpx 0.16.x to 0.18.x
Added
logging error messages during login
Changed
extend allowed chars by email check during login
instead of raising an exception, invalid email will now be logged as warning
Misc
Add description to the docs, to handling 2FA
[0.5.4] - 2021-02-28
Added
Provide a custom serial when login
Login with Audible username instead of Amazon account for US, UK and DE markteplace
Bugfix
register a device on Australian marketplace
Misc
Redesign Module documentation
Rework description of audible-cli package in documentation
[0.5.3] - 2021-01-25
Added
function
activation_bytes.fetch_activation_sign_authSpain marketplace
Changed
activation_bytes.get_activation_bytesuses the newfetch_activation_sign_authfunction, ifsigningauth method is available. Otherwise activation bytes will be fetched the old way with aplayer_token.
[0.5.2] - 2021-01-08
Added
Add initial cookies to login function to prevent captcha requests in most cases.
[0.5.1] - 2021-01-05
Added
Fetched activation bytes (with
extract=Trueargument) will be stored toactivation_bytesattribute of Authenticator class instance for now. Ignore existing activation bytes and force refresh withauth.get_activation_bytes(force_refresh=True)activation_byteswill be loaded from and save to file. Saved auth files are not backward compatible to previous audible versions so keep old files save.Add
Client.raw_requestandAsyncClient.raw_requestmethod.Provide a custom Callback with
approval_callbackkeyword argument when login.Add classmethod
Authenticator.from_login_externaland methodAuthenticator.re_login_external.Add
login_externalfunction to login.py
Misc
Add description how to use pyotp with custom otp callback to docs
Add description how to use login external to docs
[0.5.0] - 2020-12-07
Added
Added support to output the whole activation blob instead of the extracted activation bytes with
get_activation_bytes(extract=False, ...).Added support to fetch website cookies for another country with
Authenticator.set_website_cookies_for_country.Added
Client.putandAsyncClient.put.Added support to solve approval alerts during login
Changed
The
FileAuthenticatorhas been deprecated, use classmethodAuthenticator.from_fileinstead.The
Authenticatordon’t inherit from MutableMapping anymoreThe
Authenticatorsets allowed instance attributes at creation toNone, not allowed attributes will raise an ExceptionThe
LoginAuthenticatorhas been deprecated, use classmethodAuthenticator.from_logininstead.Changed internal code base for encryption and decryption metadata. Moved the related code to
metadata.py.
Remove
deprecated
AudibleAPI
Misc
Added more docstrings and type hints to code base
Added support to install Sphinx documentation dependencies with
pip install audible[docs].Added a guide to use authentication with Postman.
Rework documentation.
Added
.readthedocs.ymlconfig fileAdded module description (autodoc) to docs
Uses
httpx0.16.* for now
[0.4.4] - 2020-10-25
Bugfix
Set
padding=„none“when decrypting license voucher