Metadata-Version: 2.4
Name: novel-downloader
Version: 1.3.2
Summary: A command-line tool for downloading Chinese web novels from Qidian and similar platforms.
Author-email: Saudade Z <saudadez217@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Saudade Z
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/BowenZ217/novel-downloader
Project-URL: Source, https://github.com/BowenZ217/novel-downloader
Keywords: novel,web novel,qidian,biquge,downloader,parser,fiction,cli,automation,ebook
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: aiohttp
Requires-Dist: beautifulsoup4
Requires-Dist: DrissionPage
Requires-Dist: opencv-python
Requires-Dist: lxml
Requires-Dist: platformdirs
Requires-Dist: click
Requires-Dist: ebooklib
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: commitizen; extra == "dev"
Provides-Extra: font-recovery
Requires-Dist: scipy; extra == "font-recovery"
Requires-Dist: numpy; extra == "font-recovery"
Requires-Dist: tinycss2; extra == "font-recovery"
Requires-Dist: fonttools; extra == "font-recovery"
Requires-Dist: brotli; extra == "font-recovery"
Requires-Dist: pillow; extra == "font-recovery"
Requires-Dist: huggingface_hub; extra == "font-recovery"
Dynamic: license-file

# novel-downloader

一个基于 [DrissionPage](https://www.drissionpage.cn) 和 [requests](https://github.com/psf/requests) 的小说下载器。

---

## 项目简介

**novel-downloader** 是一个通用的小说下载库 / CLI 工具,
- 大多数支持的站点仅依赖 [`requests`](https://github.com/psf/requests) 进行 HTTP 抓取
- 对于起点中文网 (Qidian), 可在配置中选择:
  - `mode: session` : 纯 Requests 模式
  - `mode: browser`  : 基于 DrissionPage 驱动 Chrome 的浏览器模式 (可处理更复杂的 JS/加密)。
- 若配置 `login_required: true`, 程序会在运行时自动检查登录状态, 支持自动重用历史 Cookie, 仅在首次登录或 Cookie 失效时需要人工介入:
  - 若使用 `browser` 模式, 请在程序打开的浏览器窗口登录, 登录后回车继续
  - 若使用 `session` 模式, 请根据程序提示粘贴浏览器中登录成功后的 Cookie ([复制 Cookies](https://github.com/BowenZ217/novel-downloader/blob/main/docs/copy-cookies.md))

## 功能特性

- 爬取起点中文网的小说章节内容 (支持免费与已订阅章节)
- 爬取部分小说网站
- 断点续爬
- 自动整合所有章节并导出为
  - TXT
  - EPUB
- 支持活动广告过滤:
  - [x] 章节标题
  - [ ] 章节正文
  - [ ] 作者说

---

## 快速开始

```bash
# 克隆 + 安装
pip install novel-downloader

# 如需支持字体解密功能 (decode_font), 请使用:
# pip install novel-downloader[font-recovery]

# 初始化默认配置 (生成 settings.toml)
novel-cli settings init

# 编辑 ./settings.toml 完成 site/book_ids 等
# 可查看 docs/4-settings-schema.md

# 运行下载
novel-cli download 123456
```

- 详细可见: [支持站点列表](https://github.com/BowenZ217/novel-downloader/blob/main/docs/6-supported-sites.md)
- 更多使用方法, 查看 [使用示例](https://github.com/BowenZ217/novel-downloader/blob/main/docs/5-usage-examples.md)

## 从 GitHub 安装 (开发版)

如需体验开发中的最新功能, 可通过 GitHub 安装:

```bash
git clone https://github.com/BowenZ217/novel-downloader.git
cd novel-downloader
pip install .
# 或安装带可选功能:
# pip install .[font-recovery]
```

---

## 文档结构

- [项目简介](#项目简介)
- [安装](https://github.com/BowenZ217/novel-downloader/blob/main/docs/1-installation.md)
- [环境准备](https://github.com/BowenZ217/novel-downloader/blob/main/docs/2-environment-setup.md)
- [配置](https://github.com/BowenZ217/novel-downloader/blob/main/docs/3-configuration.md)
- [settings.toml 配置说明](https://github.com/BowenZ217/novel-downloader/blob/main/docs/4-settings-schema.md)
- [使用示例](https://github.com/BowenZ217/novel-downloader/blob/main/docs/5-usage-examples.md)
- [支持站点列表](https://github.com/BowenZ217/novel-downloader/blob/main/docs/6-supported-sites.md)
- [复制 Cookies](https://github.com/BowenZ217/novel-downloader/blob/main/docs/copy-cookies.md)
- [文件保存](https://github.com/BowenZ217/novel-downloader/blob/main/docs/file-saving.md)
- [TODO](https://github.com/BowenZ217/novel-downloader/blob/main/docs/todo.md)
- [开发](https://github.com/BowenZ217/novel-downloader/blob/main/docs/develop.md)
- [项目说明](#项目说明)

---

## 项目说明

- 本项目仅供学习和研究使用, 不得用于任何商业或违法用途。请遵守目标网站的 robots.txt 以及相关法律法规。
- 本项目开发者对因使用该工具所引起的任何法律责任不承担任何责任。
- 如果遇到网站结构变化或其他问题, 可能导致程序无法正常工作, 请自行调整代码或寻找其他解决方案。
