番茄小说下载、风格蒸馏、AI 续写与润色工具
🌐 在线体验: http://43.159.149.223:5173/
测试账号:
test@xiaoshuo.com/test888(内含 1,000,000 Token,可直接体验全部功能)
本项目的所有代码仅供学习和研究目的使用。
- 仅限学习 — 本项目旨在帮助开发者学习 Node.js 爬虫技术、浏览器自动化、AI 文本生成等编程知识,严禁用于任何商业用途或非法牟利行为。
- 版权归属 — 番茄小说(fanqienovel.com)平台上的所有内容(包括但不限于小说文本、字体文件等)的版权均归其原始权利人所有。本项目不存储、不分发任何受版权保护的内容。
- 用户责任 — 用户对使用此程序引发的任何法律责任和风险负有全部责任。 使用者应自行确保其使用行为符合所在地法律法规及第三方平台的服务条款。项目作者和项目贡献者不对因使用本程序而导致的任何损失、损害或法律纠纷承担责任。
- 法律咨询 — 在使用此程序之前,请确保您已理解并遵守相关法律法规以及网站的使用政策。如有任何疑问或担忧,请咨询法律顾问。
- 禁止商业化 — 严禁将本项目的代码或衍生产品用于任何形式的商业服务、付费平台、或任何可能侵犯原始平台权益的场景。
- 无保证 — 本项目按"原样"提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性。
如果您是番茄小说的版权方或运营方,认为本项目侵犯了您的合法权益,请联系项目作者,我们将在核实后第一时间处理。
| 功能 | 说明 |
|---|---|
| 📥 番茄小说下载 | 输入 Book ID 即可下载整本小说(支持锁定章节),自动处理 PUA 字体反爬 |
| 🧪 风格蒸馏 | 从番茄小说或上传的 TXT 中提取风格特征(节奏、用词、句式等),用于 AI 仿写 |
| ✍️ AI 续写/生成 | 支持整本和单章模式,国产网文 + 日式轻小说双引擎 |
| ✨ 文本润色 | 自定义润色方案,同步去 AI 味处理,流式输出实时预览 |
| 🎯 风格对齐 | 生成时自动匹配蒸馏库中的参考风格,使 AI 输出更贴合目标风格 |
| 🌸 轻小说生成 | 日式 ACGN 风格,支持萌属性、动画感描写,6 种轻小说类型 |
| 🌐 中英双语 | 界面支持中文/English 一键切换 |
- Node.js >= 18
- MongoDB >= 6.0
- Playwright Chromium(用于番茄小说下载)
git clone git@github.com:Aerdelan/MirrorNovel.git
cd MirrorNovelcd server && npm install
cd ../client && npm install
cd ../admin && npm installcd server
cp .env.example .env编辑 server/.env,关键配置:
MONGODB_URI=mongodb://localhost:27017/mirrornovel
JWT_SECRET=your_random_jwt_secret_here
JWT_EXPIRES_IN=7d
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your_admin_password
AI_API_BASE=https://api.siliconflow.cn/v1
AI_API_KEY=your_api_key_here
AI_MODEL=deepseek-ai/DeepSeek-V4-Flash管理员账号在服务启动时自动创建,默认
admin@xiaoshuo.com/admin888,首次部署后请修改默认密码。
cd server
npx playwright install chromium# 终端 1 - 后端 API(端口 3001)
cd server && npm run dev
# 终端 2 - 前端页面(端口 5173)
cd client && npm run dev
# 终端 3 - 管理后台(端口 5174)
cd admin && npm run dev# 前台(用户端)
http://localhost:5173
# 管理后台
http://localhost:5174
# 生产环境 HTTPS(需要自签名证书,第一次访问需点"高级→继续前往")
https://43.159.149.223:5173- Chrome 打开
https://fanqienovel.com并登录 - 按 F12 → Application → Cookies →
fanqienovel.com - 右键任意 cookie → "显示以 URL 编码" → 全选复制
- 打开 MirrorNovel 前端 → 蒸馏 → Cookie 设置 → 粘贴保存
MirrorNovel/
├── server/ # 后端服务(Express + MongoDB)
│ ├── config/ # 配置(小说类型、去AI味规则等)
│ ├── routes/ # API 路由
│ ├── services/ # 核心服务(AI、番茄抓取、字体解码)
│ ├── models/ # Mongoose 数据模型
│ └── middleware/ # 鉴权中间件
├── client/ # 前端(Vue 3 + Pinia + Vite)
│ └── src/
│ ├── views/ # 页面组件
│ ├── stores/ # 状态管理
│ ├── composables/ # 组合式函数(i18n 等)
│ ├── locales/ # 国际化翻译(中/英)
│ └── components/ # 公共组件
├── admin/ # 管理后台(Vue 3)
└── test_fanqie/ # 测试脚本
如果页面通过 HTTP 访问(如 http://43.159.149.223:5173),Chrome/Edge 会拦截对 localhost:11434 的请求,报 CORS 错误。
解决办法(三选一):
- 使用 HTTPS 访问(推荐):
https://43.159.149.223:5173,首次访问点"高级→继续前往"即可 - 修改浏览器 flags:
chrome://flags/#block-insecure-private-network-requests改为 Disabled - 换 Firefox 浏览器:没有这个限制
MirrorNovel 使用 Playwright 无头浏览器代理 来绕过番茄小说的反爬机制:
- a_bogus 签名 — 通过浏览器原生
fetch自动生成,无需逆向算法 - PUA 字体编码 — 从页面动态下载字体文件,用
fontkit构建映射后解码 - 锁定章节 — 通过官方 API (
/api/reader/full) 获取完整内容,配合 SVIP Cookie
用户输入 Book ID
→ 服务器启动 Playwright 无头浏览器
→ 浏览器加载 fanqienovel.com(初始化 a_bogus JS)
→ 调用 API 获取章节列表 + 完整内容
→ 提取字体文件 → fontkit 构建 PUA 映射
→ 解码为正常中文 → 输出 TXT / 风格蒸馏
| 层 | 技术 |
|---|---|
| 前端 | Vue 3, Pinia, Vite |
| 后端 | Express, Mongoose |
| 数据库 | MongoDB |
| AI | OpenAI 兼容 API / Ollama |
| 浏览器自动化 | Playwright |
| 字体解析 | fontkit |
本项目的开发过程中参考或使用了以下开源项目:
| 项目 | 说明 | 链接 |
|---|---|---|
| fanqienovel-downloader | 番茄小说下载器(Python),提供了下载思路和 API 分析参考 | ying-ck/fanqienovel-downloader |
| fanqienovel-decryptor | 番茄小说字体解密,font_mapping.json 字符映射来源于此 |
romcere/fanqienovel-decryptor |
| Playwright | 微软出品的浏览器自动化框架,用于处理 a_bogus 签名 | microsoft/playwright |
| fontkit | 高级字体引擎,用于解析 woff2 字体文件 | foliojs/fontkit |
AGPL-3.0 — 使用本项目的源代码时,请遵守 AGPL-3.0 协议 的要求。
Fanqie Novel download, style distillation, AI continuation & polishing tool
🌐 Online Demo: http://43.159.149.223:5173/
Test Account:
test@xiaoshuo.com/test888(1,000,000 Tokens included, try all features directly)
All code in this project is provided for educational and research purposes only.
- Educational Purpose Only — This project is intended to help developers learn web scraping techniques, browser automation, AI text generation, and related programming knowledge. Commercial use or any profit-making activities are strictly prohibited.
- Copyright Ownership — All content on the fanqienovel.com platform (including but not limited to novel texts, font files, etc.) belongs to its respective rights holders. This project does not store or distribute any copyrighted content.
- User Responsibility — Users bear full responsibility for any legal consequences and risks arising from the use of this program. Users must ensure their usage complies with applicable laws, regulations, and third-party platform terms of service. The project authors and contributors shall not be held liable for any loss, damage, or legal disputes resulting from the use of this program.
- Legal Consultation — Before using this program, please ensure you understand and comply with relevant laws, regulations, and website usage policies. Consult a legal professional if you have any questions or concerns.
- No Commercial Use — The code or derivative works of this project must not be used in any form of commercial service, paid platform, or any scenario that may infringe upon the rights of the original platform.
- No Warranty — This project is provided "as is" without any express or implied warranties, including but not limited to merchantability, fitness for a particular purpose, and non-infringement.
| Feature | Description |
|---|---|
| 📥 Fanqie Novel Download | Download entire novels with locked chapter support, auto PUA font decoding |
| 🧪 Style Distillation | Extract writing style (rhythm, vocabulary, sentence patterns) for AI imitation |
| ✍️ AI Generation & Continuation | Full-novel & single-chapter modes, Chinese web novel + Japanese light novel engines |
| ✨ Text Polishing | Custom polish schemes with de-AI processing, streaming preview |
| 🎯 Style Reference | Auto-match distilled styles from library for consistent AI output |
| 🌸 Light Novel | Japanese ACGN-style generation with moe traits, anime descriptions, 6 genres |
| 🌐 Bilingual UI | Toggle between Chinese and English with one click |
- Node.js >= 18
- MongoDB >= 6.0
- Playwright Chromium (for Fanqie Novel download)
git clone git@github.com:Aerdelan/MirrorNovel.git
cd MirrorNovelcd server && npm install
cd ../client && npm install
cd ../admin && npm installcd server
cp .env.example .envEdit server/.env:
MONGODB_URI=mongodb://localhost:27017/mirrornovel
JWT_SECRET=your_random_jwt_secret_here
JWT_EXPIRES_IN=7d
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your_admin_password
AI_API_BASE=https://api.siliconflow.cn/v1
AI_API_KEY=your_api_key_here
AI_MODEL=deepseek-ai/DeepSeek-V4-FlashAdmin account is auto-created on startup. Default:
admin@xiaoshuo.com/admin888. Change it after first deploy.
cd server
npx playwright install chromium# Terminal 1 - Backend API (port 3001)
cd server && npm run dev
# Terminal 2 - Frontend (port 5173)
cd client && npm run dev
# Terminal 3 - Admin Panel (port 5174)
cd admin && npm run devMirrorNovel/
├── server/ # Backend (Express + MongoDB)
│ ├── config/ # Configuration
│ ├── routes/ # API routes
│ ├── services/ # Core services
│ ├── models/ # Data models
│ └── middleware/ # Auth middleware
├── client/ # Frontend (Vue 3 + Pinia + Vite)
│ └── src/
│ ├── views/ # Page components
│ ├── stores/ # State management
│ ├── composables/ # Composables (i18n, etc.)
│ ├── locales/ # Translations (zh/en)
│ └── components/ # Shared components
├── admin/ # Admin panel
└── test_fanqie/ # Test scripts
If the page is accessed via HTTP (e.g. http://43.159.149.223:5173), Chrome/Edge blocks requests to localhost:11434 with a CORS error.
Solutions:
- Use HTTPS:
https://43.159.149.223:5173(click "Advanced → Proceed" on first visit) - Disable Chrome flag: Go to
chrome://flags/#block-insecure-private-network-requestsand set to Disabled - Switch to Firefox: No such restriction
| Layer | Technology |
|---|---|
| Frontend | Vue 3, Pinia, Vite |
| Backend | Express, Mongoose |
| Database | MongoDB |
| AI | OpenAI-compatible API / Ollama |
| Browser | Playwright |
| Font | fontkit |
AGPL-3.0 — See LICENSE for details.