mirror of
https://github.com/jo1gi/grawlix.git
synced 2026-07-11 03:04:40 -06:00
eBook cli downloader
grawlix wrote no metadata into the epub for EpubInParts sources (e.g. Nextory): the ebooklib rebuild set no title/author/series, so the OPF held only a UUID. SingleFile sources (e.g. Storytel) keep the publisher OPF, which has title and author but no series. Either way a library manager can only fall back to the filename. Add Epub._embed_metadata(location, metadata): after the file is written, ADD any missing dc:title/creator/language/publisher/date + calibre:series/series_index from book.metadata to the OPF. It is add-only (never removes or rewrites existing OPF elements, so publisher metadata, EPUB3 refines and comments stay intact), respects the OPF's declared encoding, reads entries by ZipInfo, and swallows all errors so it can never turn a successful download into a failure. Supporting changes: - Populate the Nextory Metadata with index (volume), language, publisher and release_date so those fields exist to embed and to fill output templates. - str()-coerce metadata values when building the output path, so a numeric series index does not crash remove_unwanted_chars. - Remove the stray exit() at the end of _download_epub_in_parts (also fixed in #27) — a prerequisite for the embed step to run for EpubInParts sources. 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 | ||
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>