Skip to main content

novel-downloader

PyPI Python CI Hits-of-Code

中文 | English

异步、可扩展的小说下载与处理工具包。

支持断点续爬、多格式导出、文本处理流水线, 并提供 CLI 与可选 Web 界面。

文档: 项目文档

运行要求: Python 3.11+ (CI 覆盖: 3.11 ~ 3.14)


功能特性

  • 异步与高性能下载
  • 可恢复下载 (断点续爬)
  • 可插拔 HTTP 后端: aiohttp / httpx / curl_cffi
  • 多格式导出: TXT / EPUB / HTML
  • 文本处理流水线: 去广告、繁简转换、自动翻译等
  • 图片章节与混淆章节支持 (可选 OCR)
  • 插件系统: 可扩展站点解析器、导出器、Pipeline 等
  • CLI 与可选 Web GUI

完整功能列表见: 功能总览


安装与更新

使用 pip 安装最新稳定版本:

pip install -U novel-downloader-spiritlhl

PyPI 发行包名为 novel-downloader-spiritlhl, 安装后的导入名与 CLI 命令保持不变, 仍然使用 novel_downloader、novel-cli、novel-web。

如需启用 Web GUI:

pip install novel-downloader-spiritlhl[web-ui]

如需启用其它可选功能 (Web UI、图片转文字、额外后端等), 请参见: 安装指南

图片章节转文字需要安装 image-utils、paddlepaddle 与 paddleocr, 并在 settings.toml 的 [general.parser] 中设置 enable_ocr = true。对飞卢等图片 VIP 章节, 程序会先做站点专属图像预处理再 OCR; 若 OCR 无结果或异常, HTML/EPUB 导出会保留原始图片作为回退。


快速开始 (CLI)

# 下载一本小说
novel-cli download https://www.example.com/book/123/

# 使用站点 + 书籍 ID
novel-cli download --site n23qb 12282

更多示例见: CLI 使用示例

编程接口 (Programmatic API)

import asyncio
from novel_downloader.plugins import registrar
from novel_downloader.schemas import BookConfig, ClientConfig

async def main() -> None:
    site = "n23qb"

    # 指定书籍 ID
    book = BookConfig(book_id="12282")

    # 创建客户端
    cfg = ClientConfig(request_interval=0.5)
    client = registrar.get_client(site, cfg)

    # 在异步上下文中执行下载
    async with client:
        await client.download_book(book)

    # 下载完成后执行导出操作
    client.export_book(book, formats=["txt", "epub"])

if __name__ == "__main__":
    asyncio.run(main())

更多示例见: API 示例


贡献与开发

git clone https://github.com/spiritLHLS/novel-downloader.git
cd novel-downloader

# 可选: 为多语言支持编译翻译文件
# pip install babel
# pybabel compile -d src/novel_downloader/locales

pip install .
# 或安装带可选功能:
# pip install .[all]
# pip install -e .[dev,all]

欢迎提交 Issue / PR。


致谢

本仓库基于上游项目 saudadez21/novel-downloader 演化维护, 在此向原项目及历史贡献者致谢。


注意事项

  • 站点结构变更: 若目标站点页面结构更新或章节抓取异常, 欢迎提 Issue 或提交 PR
  • 登录支持范围: 登录功能受站点策略与接口限制, 部分场景需要手动配置 Cookie 或进行账号绑定
  • 请求频率: 请合理设置抓取间隔, 避免触发风控或导致 IP 限制

项目说明

  • 本项目仅供学习和研究使用, 不得用于任何商业或违法用途
  • 请遵守目标网站的 robots.txt 及相关法律法规
  • 使用本项目产生的任何法律责任由使用者自行承担, 作者不承担相关责任

Metadata

Release files for novel-downloader-spiritlhl 3.1.1.post2026062701

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for novel-downloader-spiritlhl 3.1.1.post2026062701
File Size Uploaded Provenance Actions
novel_downloader_spiritlhl-3.1.1.post2026062701.tar.gz 710.8 kB Without provenance Details for novel_downloader_spiritlhl-3.1.1.post2026062701.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for novel-downloader-spiritlhl 3.1.1.post2026062701
File Interpreter ABI Platform Actions
novel_downloader_spiritlhl-3.1.1.post2026062701-py3-none-any.whl Python 3 none any Details for novel_downloader_spiritlhl-3.1.1.post2026062701-py3-none-any.whl

Total release size: 1.7 MB

Release files / novel_downloader_spiritlhl-3.1.1.post2026062701.tar.gz

Download URL novel_downloader_spiritlhl-3.1.1.post2026062701.tar.gz
Size 710.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a2f18872268554fbcd871f34530ad9295ed579eeb0006870a698c05c4cbac84b
BLAKE2b-256 checksum
How to use checksums
c59750adef5d9c229547fe487585274eda62b44dfdfec6444f04ae959ab71427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Release files / novel_downloader_spiritlhl-3.1.1.post2026062701-py3-none-any.whl

Download URL novel_downloader_spiritlhl-3.1.1.post2026062701-py3-none-any.whl
Size 946.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1ab5d52fe53c423f3090c8b60b50728c14b4873cf89e156025b60e6675234c1
BLAKE2b-256 checksum
How to use checksums
d8fcf6a55b652cd1072fbebb3c1000ec4caead926951e6fb2596a8de5ad77b16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.13

Security for novel-downloader-spiritlhl 3.1.1.post2026062701

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page