mirror of
https://github.com/jo1gi/grawlix.git
synced 2026-07-10 01:34:49 -06:00
eBook cli downloader
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> |
||
|---|---|---|
| grawlix | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| setup.py | ||
| uv.lock | ||
grawlix
CLI ebook downloader
Supported services
grawlix currently supports downloading from the following sources:
- DC Universe Infinite
- eReolen
- fanfiction.net
- Flipp
- Internet Archive
- Manga Plus
- Marvel Unlimited
- Nextory
- Royal Road
- Saxo
- Storytel / Mofibo
- Webtoons
Installation
From pypi (recommended)
pip install grawlix
From repo (unstable)
git clone https://github.com/jo1gi/grawlix.git
cd grawlix
python3 setup.py install
Authentication
Authentication can either be done with login (username and password) or cookies. Not all sources support both methods.
Login
Some sources require authentication, which can be done either with cli arguments or a config file.
Cli example
grawlix --username "user@example.com" --password "SuperSecretPassword" <url>
Config file example
[sources.name]
username = "user@example.com"
password = "SuperSecretPassword"
Config file should be placed in ~/.config/grawlix/grawlix.toml
Cookies
Some sources can be authenticated with Netscape cookie files. I use this extension to export my cookies from my browser.
Cookies can be placed in current dir as cookies.txt or be given with the
--cookie argument.
Download books
To download a book run:
grawlix [options] <book url>