Claude Code skill for searching and downloading books from Z-Library and Anna's Archive
Overview
A Claude Code skill for searching and downloading books. Supports multiple backends with a unified CLI — full workflow from search to download in one skill. This skill is part of media-master, which bundles music, cloud drive, and book download skills: - with requests library (pip install requests) - (email + password) for search and download - (optional) — for Anna's Archive backend Edit ~/.claude/book-tools/.env with your Z-Library email and password: : Do not share credentials in chat. The skill reads them from the .env file only. Then add your API key (obtained via donation to Anna's Archive) to .env: In Claude Code, use any of these trigger phrases: 1. — queries the selected backend (or auto-detects) with filters (language, format, year) 2. — shows results as a numbered table grouped by language/edition 3. — user selects by number 4. — fetches the file to ~/Downloads/ and reports path + size
README
zlib-download-skill
A Claude Code skill for searching and downloading books. Supports multiple backends with a unified CLI — full workflow from search to download in one skill.
| Backend | Source | Auth | Best For |
|---|---|---|---|
| Z-Library | EAPI (reverse-engineered Android API) | Email + Password | Largest catalog, direct download, Chinese books |
| Anna’s Archive | annas-mcp Go binary | API Key (donation) | Aggregated sources, multiple mirrors |
Installation
Install all media skills at once (recommended)
This skill is part of media-master, which bundles music, cloud drive, and book download skills:
npx skills add psylch/media-master -g -y
Install this skill only
npx skills add psylch/zlib-download-skill -g -y
Via Claude Code Plugin Marketplace
/plugin marketplace add psylch/zlib-download-skill
/plugin install zlib-download@psylch-zlib-download-skill
Restart Claude Code after installation.
Prerequisites
- Python 3 with
requestslibrary (pip install requests) - Z-Library account (email + password) for search and download
- annas-mcp binary (optional) — for Anna’s Archive backend
Setup
1. Configure Credentials
mkdir -p ~/.claude/book-tools
cp ~/.agents/skills/zlib-download/scripts/.env.example ~/.claude/book-tools/.env
Edit ~/.claude/book-tools/.env with your Z-Library email and password:
[email protected]
ZLIB_PASSWORD=your_password_here
Important: Do not share credentials in chat. The skill reads them from the
.envfile only.
2. (Optional) Install Anna’s Archive
bash ~/.agents/skills/zlib-download/scripts/setup.sh install-annas
Then add your API key (obtained via donation to Anna’s Archive) to .env:
ANNAS_SECRET_KEY=your_api_key_here
3. Verify
python3 ~/.agents/skills/zlib-download/scripts/book.py setup
Usage
In Claude Code, use any of these trigger phrases:
find book about deep learning
search for machine learning textbooks
找一本关于强化学习的书
帮我搜几本莱姆的科幻小说
下载这本书
The skill handles the full workflow: search → present results → user picks → download.
How It Works
- Search — queries the selected backend (or auto-detects) with filters (language, format, year)
- Present — shows results as a numbered table grouped by language/edition
- Pick — user selects by number
- Download — fetches the file to
~/Downloads/and reports path + size
CLI Reference
# Search (auto-detect backend)
python3 book.py search "deep learning" --limit 10
# Search with filters
python3 book.py search "machine learning" --source zlib --lang english --ext pdf --limit 5
# Download from Z-Library
python3 book.py download --source zlib --id --hash -o ~/Downloads/
# Download from Anna's Archive
python3 book.py download --source annas --hash --filename book.pdf
# Book details
python3 book.py info --source zlib --id --hash
# Config management
python3 book.py config show
python3 book.py config set --zlib-email --zlib-password
python3 book.py setup
Credential Storage
| Source | Path | Priority |
|---|---|---|
.env file |
~/.claude/book-tools/.env |
Higher (overrides JSON) |
| Config JSON | ~/.claude/book-tools/config.json |
Lower (auto-managed) |
On first successful Z-Library login, remix tokens are cached in config.json — subsequent calls use tokens directly, skipping email/password login.
Troubleshooting
| Symptom | Fix |
|---|---|
| “Z-Library not configured” | Edit ~/.claude/book-tools/.env with credentials |
| “Z-Library login failed” | Verify credentials. Z-Library domains change frequently — vendored Zlibrary.py may need a domain update |
| “annas-mcp binary not found” | Run setup.sh install-annas |
| “No backend available” | Configure at least one backend in .env |
File Structure
zlib-download-skill/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── skills/
│ └── zlib-download/
│ ├── SKILL.md # Main skill definition
│ ├── scripts/
│ │ ├── book.py # Unified CLI wrapper
│ │ ├── Zlibrary.py # Vendored Z-Library API (MIT)
│ │ ├── setup.sh # Dependency check & install
│ │ └── .env.example # Credential template
│ └── references/
│ └── api_reference.md # API quick reference
├── README.md
├── README.zh.md
└── .gitignore
Credits
- Zlibrary-API by bipinkrish (MIT) — vendored Z-Library Python wrapper
- annas-mcp by iosifache — Anna’s Archive CLI + MCP server
License
MIT
Recommended Tools
Try a different keyword or remove a filter.
Install
npx skillfish add psylch/zlib-download-skill