# Book Finder

> Find and download books (PDF/EPUB). Use when the user asks to find, download, or get a book. Searches public university servers, Archive.org, open PDFs, and common book hosting sites.

- Skill: `soheilmomeniii/book-finder` (Agent Skill)
- Install (CLI): `npx skillmds@latest add soheilmomeniii/book-finder`
- Raw SKILL.md: https://api.skillmd.com/api/skills/soheilmomeniii/book-finder/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: soheilmomeniii (https://skillmd.com/u/soheilmomeniii)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/soheilmomeniii/book-finder

---


# Book Finder

Find and download books as PDF or EPUB files.

## When to Use

- User asks to "download [book]", "find [book]", "get me [book]"
- User shares a book title and wants the file

## How It Works

### Step 1 — Search for the book

Use web search to find PDF links across these sources (in priority order):

1. **Libgen** — scrape search results from `libgen.li` for MD5 hashes, then try download via `libgen.li/ads.php?md5=HASH` -> parse the `get.php` link from the page. If libgen.li times out, try libgen.rs and libgen.is.
2. **Anna's Archive** — from libgen results, try `https://en.annas-archive.gl/md5/HASH` or search directly on `annas-archive.org`
3. **University servers** — search `"book title" author site:edu filetype:pdf`
4. **Research libraries** — search `"book title" author filetype:pdf` (iuc.hr, fit.edu, mit.edu, stanford.edu, etc.)
5. **Archive.org** — search `"book title" author site:archive.org`
6. **Bookey CDN** — try `https://cdn.bookey.app/files/pdf/book/en/[slug].pdf` (slug = title lowercase, spaces to hyphens)
7. **General PDF search** — search `"book title" author PDF download`

### Libgen scraping method

```bash
# Step 1: Search libgen
curl -s -L --max-time 20 -H "User-Agent: Mozilla/5.0" "https://libgen.li/index.php?req=QUERY&columns%5B%5D=t&columns%5B%5D=a&objects%5B%5D=f&topics%5B%5D=l&res=25&gmode=on&filesuns=all" | grep -oiP 'ads\.php\?md5=[a-f0-9]+' | head -5

# Step 2: Get download link from ads page
curl -s -L --max-time 20 -H "User-Agent: Mozilla/5.0" "https://libgen.li/ads.php?md5=HASH" | grep -oiP 'get\.php\?md5=[^"]+' | head -1

# Step 3: Download
curl -s -L --max-time 30 -H "User-Agent: Mozilla/5.0" -H "Referer: https://libgen.li/" -o /tmp/book.pdf "https://libgen.li/get.php?md5=HASH&key=KEY"
```

Note: libgen mirrors are often blocked or return 503. If all libgen/anna's archive attempts fail, fall through to university servers and other sources.

### Step 2 — Download and verify

Once you find a URL:

```bash
curl -s -L --max-time 30 -H "User-Agent: Mozilla/5.0" -o /tmp/book-name.pdf "URL" -w "\n%{http_code} %{size_download}"
```

Then verify it's a real file:
```bash
head -c 5 /tmp/book-name.pdf
```

- `%PDF-` = valid PDF
- `PK` = valid EPUB/ZIP
- Anything else = HTML page or garbage, try another URL

Minimum file size: 50KB (anything smaller is likely an error page)

### Step 3 — Deliver to user

Send the verified file back to the user (attach it, save it to their working folder, or reply with it via whatever channel the request came in on).

## Tips

- **Older books (pre-2015)**: Usually findable on .edu servers, archive.org, or open repositories
- **Recent books (last 1-2 years)**: Much harder. Check bookey CDN, then tell user it's too new
- **Textbooks**: Often on university course pages — search `"book title" syllabus filetype:pdf`
- **Bookey CDN pattern**: `cdn.bookey.app/files/pdf/book/en/[title-slug].pdf` — slug is the title in lowercase with hyphens. Works for many popular books
- **If all sources fail**: Tell user the book is too new or too niche, give purchase links instead

## Common failure modes

- URL returns HTML instead of PDF -> check `head -c 5` output
- File too small (<50KB) -> it's an error/redirect page
- 403/timeout -> try a different source
- Book too new -> no free copies exist yet, give Amazon/Kindle link

## What this skill does NOT do

- Generate or create books
- Bypass paywalls on publisher sites

