docs: sync all docs for parallel downloads (#18)

Update README, MkDocs site (cli-usage, configuration,
quickstart, troubleshooting), and built HTML to cover the
--workers flag, parallel download capability, workers config
field, and API semaphore behavior. Fix stale sequential-only
language across all user-facing documentation.

Closes #18
This commit is contained in:
AlexKucera committed 2026-06-03 18:25:19 +02:00
1 parent f1ee0dbc8e
commit 4c913abed0
23 files changed
+192 -95

No files matched your search

+27
View File
@@ -17,6 +17,7 @@ librofm-downloader [OPTIONS]
| `--history` | | `download_history.json` | Path to download history JSON file |
| `-v, --verbose` | | off | Print extra detail (URLs, paths, API responses) |
| `--limit` N | | `0` (no limit) | Maximum number of books to download |
| `-w, --workers` N | | `3` | Number of parallel download workers (1 = sequential) |
### --verbose
@@ -59,6 +60,32 @@ librofm-downloader --limit 3 -v
Books are processed in the order returned by the Libro.fm API. Already-downloaded books are filtered out **before** the limit is applied.
### --workers
Controls how many books download simultaneously:
```bash
# Default: 3 parallel downloads
librofm-downloader
# High-bandwidth connection: 5 workers
librofm-downloader -w 5
# Force sequential (useful for debugging)
librofm-downloader --workers 1
```
Resolution order (CLI > config > default):
1. **`--workers N`** / **`-w N`** on the command line
2. **`workers:`** field in `config.yaml`
3. **Default: 3**
> [!NOTE]
> The worker count controls **CDN download parallelism**. Libro.fm API calls are separately capped at 3 concurrent requests via an internal semaphore, regardless of worker count. This protects the API server while letting CDN transfers scale up.
Set to `1` for behavior identical to the pre-parallelism sequential mode.
## Exit codes
| Code | Meaning |
+4
View File
@@ -41,6 +41,7 @@ All non-credential settings. Safe to commit.
| `output_dir` | `string` | `"./audiobooks"` | Base directory for downloaded files. Relative paths resolve from CWD. |
| `download_extras` | `boolean` | `true` | Download PDF extras (e.g., maps) when available. |
| `download_covers` | `boolean` | `true` | Download cover art (JPEG/PNG) when available. |
| `workers` | `integer` | `3` | Number of parallel download threads. Set to 1 for sequential mode. Must be ≥ 1. |
### Full example
@@ -50,6 +51,7 @@ librofm:
output_dir: ./audiobooks
download_extras: true
download_covers: true
workers: 3
```
### Minimal example
@@ -59,6 +61,7 @@ Only `format` is meaningful here — everything else has a default:
```yaml
librofm:
format: mp3_only
workers: 5 # high-bandwidth connection
```
## How merging works
@@ -83,6 +86,7 @@ Move them to secrets.yaml (which is gitignored).
| `Config error: Credentials (...) found in config.yaml` | Username or password in config file | Move to `secrets.yaml` |
| `Missing required fields in secrets.yaml: username` | Missing credential field | Add it to `secrets.yaml` |
| `Invalid format 'foo'` | Unknown format value | Use one of: `m4b_mp3_fallback`, `mp3_only`, `m4b_only` |
| `Invalid workers value: 0` | Workers < 1 | Set `workers` to an integer ≥ 1 |
## Download history
+1 -1
View File
@@ -83,7 +83,7 @@ This:
2. Authenticates with Libro.fm via OAuth2 password grant
3. Fetches your full library (all pages)
4. Skips books already in `download_history.json`
5. Downloads each new book with a progress bar
5. Downloads each new book (3 parallel workers by default) with a progress bar
6. Records successful downloads to history
### First run output (TTY)
+1 -1
View File
@@ -202,7 +202,7 @@ chmod u+w ./audiobooks/
2. Whether a VPN/proxy is adding latency
3. Libro.fm CDN responsiveness (varies by region)
The tool downloads in a **single stream per book** (no parallelism within one book), but processes books sequentially. There is no built-in rate limiting or parallel download feature.
The tool downloads in a **single stream per book** (no parallelism within one book), but can process **multiple books in parallel** via `--workers N` (default 3). Libro.fm API calls are rate-limited to 3 concurrent requests regardless of worker count.
### Large library takes a long time