Storytel's bookshelf API (api.storytel.net/libraries/bookshelf) returns each
book with a reading state; WILL_CONSUME is the user's want-to-read list. Add a
bookshelf flow mirroring the Nextory one: a .../want-to-read (or /bookshelf) URL
resolves to a Series of the ebook-format WILL_CONSUME ids. The endpoint needs a
JSON body sent with a form-urlencoded content type (it rejects application/json
with HTTP 400).
Along the way, fix two things that broke Storytel downloads entirely:
- login() was missing the url positional arg that __main__.authenticate()
passes (every other source has it), so Storytel auth raised TypeError.
- populate authors/series/index/language/description in download_book_from_id
(previously only title); and str()-coerce metadata values when building the
output path, since a numeric series index made remove_unwanted_chars crash
with "int has no attribute replace".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Fix Nextory: bump X-App-Version and handle null series
The Nextory API now rejects the old X-App-Version "5.4.1" with an
AppDeprecateError. Bump it to "2026.05.4" (current Android app version).
Also, the product API can return {"series": null} for standalone books
(not just omit the key entirely). The previous `"series" in product_info`
check passed in that case and we crashed on a NoneType subscript.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add urllib3 as explicit dependency
grawlix/sources/storytel.py imports urllib3.util.parse_url but urllib3
was only pulled in transitively. Fresh installs (e.g. via uv tool) fail
at import time with ModuleNotFoundError.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Fix invalid escape sequence warning in saxo regex
f"\d+$" produced a SyntaxWarning on Python 3.12 (and will become a
SyntaxError in a future release). The string has no interpolation, so
the raw form r"\d+$" is the right fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Support the new system for eReolen where user access it through their
local libraries.
This new system makes the `--library` argument unnecessary and has
therefore also been removed.
Formats can now be loaded based on book data format and file extension
of the output file. Will also try to use the extension of the output
location instead of using the default filetype every time.