## Parent
#1
## What to build
MP3 format fallback when M4B is unavailable, including ZIP part download and extraction.
**client module (MP3 endpoints):**
- `GET /api/v10/download-manifest?isbn={isbn}` — returns parts list (ZIP URLs) and track metadata
- Parse manifest: extract `parts[]` array with download URLs, `tracks[]` with chapter info
**downloader module (MP3 path):**
- Download each ZIP part from manifest to `{part_name}.zip.partial` → rename on completion
- Extract each ZIP part (contains one or more `.mp3` track files) into the book output location
- Handle corrupt/invalid ZIP gracefully (log error, treat as book-level failure)
- Resume support for individual ZIP parts via `.partial` + Range header
**Format strategy selector:**
- `m4b_mp3_fallback`: try M4B first, if 404 → fall back to MP3
- `mp3_only`: skip M4B query entirely, go straight to MP3
- `m4b_only`: if M4B not available, skip book (log, don't fail)
- Config-driven via `download.format` setting
**cli wiring:**
- For each undownloaded book: try M4B → fallback MP3 per format strategy → download → update history
- Full download loop working for both formats
## Acceptance criteria
- [ ] MP3 download manifest fetched and parsed correctly
- [ ] Parts list extracted from manifest with URLs
- [ ] Each ZIP part downloaded with .partial tracking
- [ ] ZIP parts extracted to output directory
- [ ] Corrupt ZIP handled as book-level error (not crash)
- [ ] Individual ZIP parts resume from .partial file
- [ ] Format strategy `m4b_mp3_fallback` tries M4B then falls back to MP3 on 404
- [ ] Format strategy `mp3_only` skips M4B query entirely
- [ ] Format strategy `m4b_only` skips book if M4B unavailable
- [ ] ~15 tests: manifest parsing, ZIP download+extraction, format strategy branches, fallback integration, corrupt ZIP handling
- [ ] All tests pass
## Blocked by
#5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
#1
What to build
MP3 format fallback when M4B is unavailable, including ZIP part download and extraction.
client module (MP3 endpoints):
GET /api/v10/download-manifest?isbn={isbn}— returns parts list (ZIP URLs) and track metadataparts[]array with download URLs,tracks[]with chapter infodownloader module (MP3 path):
{part_name}.zip.partial→ rename on completion.mp3track files) into the book output location.partial+ Range headerFormat strategy selector:
m4b_mp3_fallback: try M4B first, if 404 → fall back to MP3mp3_only: skip M4B query entirely, go straight to MP3m4b_only: if M4B not available, skip book (log, don't fail)download.formatsettingcli wiring:
Acceptance criteria
m4b_mp3_fallbacktries M4B then falls back to MP3 on 404mp3_onlyskips M4B query entirelym4b_onlyskips book if M4B unavailableBlocked by
#5