当前位置: 首页 > Skill >

Z-Library

Z-Library

Z-Library

从Z-Library搜索并下载书籍。缓存登录会话至 ~/.zlibrary-session.,下载书籍文件(EPUB/PDF)至 ~/Downloads/。

2.1.0 2026.11.18 936
获取Skill文件查看使用说明
作 者:周景 许可证: 更新时间:2026.11.18
本文目录展开

Z-Library

Search and download books from Z-Library using their eAPI.

Authentication

Credentials come from environment variables ZLIBRARY_EMAIL and ZLIBRARY_PASSWORD.

Session tokens are cached at ~/.zlibrary-session.json so login only happens once.

Login

Before any operation, check for a cached session:

cat ~/.zlibrary-session.json 2>/dev/null

If the file does not exist or is empty, log in:

curl -s -X POST "https://z-lib.sk/eapi/user/login" 
  -H "User-Agent: Mozilla/5.0 (Android 12; Mobile)" 
  -d "email=$ZLIBRARY_EMAIL&password=$ZLIBRARY_PASSWORD"

The response contains user.id and user.remix_userkey. Save them:

echo '{"remix_userid":"<id>","remix_userkey":"<key>"}' > ~/.zlibrary-session.json

All subsequent requests must include these as cookies:

-b "remix_userid=<id>; remix_userkey=<key>"

Search

curl -s -X POST "https://z-lib.sk/eapi/book/search" 
  -H "User-Agent: Mozilla/5.0 (Android 12; Mobile)" 
  -b "remix_userid=<id>; remix_userkey=<key>" 
  -d "message=<query>&limit=10"

Optional search parameters (append to -d):

  • yearFrom=YYYY — filter by start year
  • yearTo=YYYY — filter by end year
  • languages[]=english — filter by language (repeatable)
  • extensions[]=epub — filter by format (repeatable)
  • order=popular — sort order

Response: { "success": 1, "books": [...] }. Each book has id, hash, title, author, extension, filesizeString, and dl fields.

Present results as a numbered list showing title, author, format, and size. Ask the user which book they want before downloading.

Get Available Formats

To see all available formats for a book:

curl -s "https://z-lib.sk/eapi/book/<id>/<hash>/formats" 
  -H "User-Agent: Mozilla/5.0 (Android 12; Mobile)" 
  -b "remix_userid=<id>; remix_userkey=<key>"

Response: { "success": 1, "books": [...] } where each entry has id, hash, extension, filesize, and filesizeString.

Download

Two-step process:

Step 1 — Get the download link

curl -s "https://z-lib.sk/eapi/book/<id>/<hash>/file" 
  -H "User-Agent: Mozilla/5.0 (Android 12; Mobile)" 
  -b "remix_userid=<id>; remix_userkey=<key>"

Response: { "success": 1, "file": { "downloadLink": "<url>", "extension": "epub", ... } }

Step 2 — Download the file

curl -s -L -o ~/Downloads/<filename>.<ext> 
  -H "User-Agent: Mozilla/5.0 (Android 12; Mobile)" 
  "<downloadLink>"

Always download to ~/Downloads/ unless the user specifies otherwise. Use a clean filename based on the book title.

User Profile

Check download limits and account info:

curl -s "https://z-lib.sk/eapi/user/profile" 
  -H "User-Agent: Mozilla/5.0 (Android 12; Mobile)" 
  -b "remix_userid=<id>; remix_userkey=<key>"

Shows downloads_today, downloads_limit, and account details.

Error Handling

  • If any request returns {"success":0,"error":"Please login"}, delete ~/.zlibrary-session.json and re-authenticate.
  • If login returns a validation error, tell the user their credentials are wrong and ask them to check ZLIBRARY_EMAIL and ZLIBRARY_PASSWORD.
  • The free tier allows 10 downloads per day. If the user hits the limit, inform them.

Notes

  • The base domain z-lib.sk may change. If requests start failing, check for an updated domain.
  • Always include the User-Agent: Mozilla/5.0 (Android 12; Mobile) header on every request.
  • When downloading, prefer EPUB over PDF when both are available, unless the user asks for a specific format.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Z-Library
    • Authentication
      • Login
    • Search
    • Get Available Formats
    • Download
      • Step 1 — Get the download link
      • Step 2 — Download the file
    • User Profile
    • Error Handling
    • Notes
  • 项目或源文件

相关 Skill

更多
Book2kindle Book2kindle 搜索 Z-Library 并发送 EPUB 到 Kindle
WeRead Book Finder WeRead Book Finder 输入图书名称,优先在微信读书搜索并加入书架;若微信读书没有可信命中或无法加入书架,则自动回退到 Z-Library 搜索并优先下载非 PDF 格式。适用于“把《xxx》加入微信读书书架,不行就去 Z-Library 下载”这类请求。
ZLibrary2Kindle ZLibrary2Kindle 在 Z-Library 上搜索书籍、下载后发送到 Kindle。
电子书搜索引擎 电子书搜索引擎 一个"找某本书的电子版"的公开情报检索器。把需求当 OSINT 任务:用多源交叉验证在公开渠道定位电子版, 按「公共领域 > 图书馆借阅 > 合法预览/购买」的优先级返回结构化结果,每个结果标注格式/合法性/来源置信度。 触发场景(满足任一即触发): 1. 用户给书名/作者/ISBN,想找电子版(为读 or 想喂给 book-to-skill-adapter 蒸馏成 skill) 2. 用户问"这本书有电子版吗""哪里能合法读到 X" 3. 用户想确认某书是否在公共领域 / 可合法获取 核心原则(OSINT 合规): - 合法优先:公共领域(CC0/PD) > 图书馆合法借阅 > 合法预览/购买 - 盗版/影子库(Anna's Archive、Z-Library 等)标注「⛔ 版权风险」,不提供访问方式、不默认、不推荐 - 每个结果必须标注:格式 + 合法性 + 来源置信度 - 不迎合用户:找不到合法版就直说,不导向侵权路径 不用于: - 提供或引导获取受版权保护作品的盗版副本(违法,且违背本 skill 合规底线) - 代替图书馆/书店的正式借阅购买流程(本 skill 是"检
doubanbookplus-skill doubanbookplus-skill 豆瓣读书增强技能——输入豆瓣书籍详情页链接(电脑端 book.douban.com/subject/* 或移动端 douban.com/doubanapp/dispatch/book/*)或书名/ISBN,调用各电子书平台 API 解析并输出微信读书、得到、豆瓣阅读、多看阅读、网易蜗牛读书、Z-Library、Anna's Archive 的直达阅读链接。触发场景:(1) 用户给出豆瓣书籍链接(电脑端 book.douban.com 或移动端 doubanapp/dispatch/book 链接)想找电子版,(2) 用户说「这本书在哪能看/读」「找《XXX》的电子版/直达链接」「豆瓣读书增强」「一键找阅读源」,(3) 用户给了书名/ISBN 想跨平台查询在线阅读地址。不用于普通网页搜索或图书购买比价(那是别的技能)。