# Cover Retrieval Session — 2026-06-01

## Goal: Covers for 3 Stefan Zweig books (German editions)

Books:
1. Schachnovelle — Fischer Taschenbuch, ISBN 978-3-596-21901-8
2. Die Welt von gestern — Fischer Taschenbuch, ISBN 978-3-596-29380-3
3. Sternstunden der Menschheit — Insel Taschenbuch, ISBN 978-3-458-34063-8

## What FAILED (16+ API calls wasted)

| Source | Attempt | Result |
|--------|---------|--------|
| Google Books API | ISBN search, title search | 0 results for all 3 ISBNs. Different ISBN (wrong book) returned wrong cover (liturgical calendar) |
| OpenLibrary Covers | `https://covers.openlibrary.org/b/isbn/{ISBN}-L.jpg` | Always returns 1×1 GIF placeholder |
| DNB SRU | SRU query by ISBN | 0 results for Fischer books, 1 result for Sternstunden but cover 404 |
| Fischer Verlag | `curl` on product page | JS-rendered SPA, no `og:image` product info, only generic share-image |
| Suhrkamp Verlag | `curl` on product page | Same — JS SPA, Cloudinary images only in JS payload |
| Thalia.at | `curl` on product page | JS SPA, no extractable images |
| Amazon | Direct URL guessing | All 404s, URL patterns not predictable |
| DuckDuckGo Images | lite.duckduckgo.com | No image URLs in response |
| Wikimedia Commons | API search | No results for any book covers |
| genialokal.de | ISBN-direct URL | 404 |
| buchhandel.de | ISBN-direct URL | 308 redirect, no usable image |
| Camofox browser | Tab creation | Session management required userId+sessionKey, not straightforward for one-off |

## What WORKED: Morawa.at

Morawa (Austrian bookstore) reliably serves `og:image` in static HTML. No JS needed.

### Discovered via user-provided product page URLs:
- `https://www.morawa.at/detail/ISBN-9783596211524/Zweig-Stefan/Die-Welt-von-Gestern`
- `https://www.morawa.at/detail/ISBN-9783552059351/Zweig-Stefan/Schachnovelle`
- `https://www.morawa.at/detail/ISBN-9783552058583/Zweig-Stefan/Sternstunden-der-Menschheit`

### Extraction pattern:
```bash
# Get og:image URL
curl -sL "$PRODUCT_URL" | grep -oP 'property="og:image"\s+content="[^"]*"'
# → https://www.morawa.at/annotstream/{ISBN}/COPL/Zweig-Stefan/{Title}.jpg?sq=N

# Download (strip ?sq=N if you want, doesn't matter)
curl -sL "$COVER_URL" -o cover.jpg

# Verify
file cover.jpg  # JPEG image data, JFIF standard — NOT GIF 1x1
```

### Results:
- Schachnovelle: (256, 420), RGB, JPEG — Zsolnay edition, geometric design
- Welt von gestern: (380, 599), RGB, JPEG — Vienna street scene photo
- Sternstunden: (256, 420), RGB, JPEG — Red "Z" on dark starry background

### Key insight:
The Morawa ISBN may differ from the user's ISBN — Morawa uses a different edition. That's fine for covers. The important thing is the cover visually matches the right book, confirmed via vision_analyze.

```bash
python3 /DATA/.hermes/skills/media/ebook-management/scripts/embed_cover_epub.py "book.epub" "cover.jpg"
```

See `scripts/embed_cover_epub.py` for the reusable standalone script.

## Lessons Learned

1. **Skip Google Books entirely for German books.** Waste of API calls.
2. **Skip OpenLibrary for German books.** Always returns 1×1 GIF.
3. **Morawa.at is the #1 source** for German-language covers. Static HTML, predictable URL patterns.
4. **Always verify covers** with `file` (reject GIF 1×1) and `vision_analyze` (reject wrong book).
5. **Camofox browser is overkill for cover retrieval** if a static HTML source exists. Only use when the ONLY available source is JS-only with no API.
