2026-10-10 23:21:20 +07:00
2026-10-08 21:36:48 +07:00
2026-10-08 22:28:53 +07:00
2026-10-09 15:19:32 +07:00
2026-10-10 23:21:20 +07:00
2026-09-12 13:48:18 +08:00
2026-09-06 17:00:35 +07:00
2026-09-06 16:31:03 +07:00
2026-09-12 13:48:18 +08:00
2026-09-12 13:48:18 +08:00
2026-09-06 16:31:03 +07:00
2026-09-06 16:31:03 +07:00

Silksoup

Turn online web novels and light novels into clean, beautifully formatted EPUB e-books with a single click or command.

Silksoup scrapes web novel index pages, uses an OpenAI-compatible LLM to detect volumes and chapters, cleans out site ads and junk, downloads illustrations, and packages everything into an offline .epub file ready for your e-reader, phone, or tablet.


Key Features

  • Dual Modes: Use the visual Web Dashboard or the terminal CLI tool—both share the same engine.
  • Smart Chapter Extraction: Uses AI to understand complex table of contents, volumes, and reading order.
  • Clean Reading Experience: Strips navigation links, donation banners, and website watermarks while preserving important translator notes, formatting, and character dialogue.
  • Image & Illustration Support: Downloads cover art and embedded chapter illustrations (supports WEBP, JPEG, PNG, GIF) with anti-hotlinking headers.
  • Smart Caching (PostgreSQL & SQLite): Stores downloaded chapters so re-runs and updates don't re-download what you already have.
  • Self-Hostable & Docker Ready: Run it locally or host it on a VPS behind WireGuard / VPN.

Quick Start (Web App)

  1. Clone the repository:

    git clone https://github.com/your-username/silksoup.git
    cd silksoup
    
  2. Set up your environment variables:

    cp .env.example .env
    

    Open .env and configure your OpenAI-compatible LLM:

    LLM_API_KEY=your_api_key_here
    LLM_BASE_URL=https://api.openai.com/v1
    LLM_MODEL=ds/deepseek-v4-flash
    
    # Optional: Connect to your PostgreSQL database (leave blank to use local SQLite)
    DATABASE_URL=postgresql://user:password@localhost:5432/silksoup
    
  3. Start the service:

    docker compose up -d --build
    
  4. Open your browser: Go to http://localhost:8000 (or http://YOUR_SERVER_IP:8000).


Option B: Running Locally with Python

  1. Install dependencies:

    pip install -r requirements.txt
    # or with uv:
    uv pip install -r requirements.txt
    
  2. Configure .env (see step 2 above).

  3. Start the web server:

    python server.py
    

    Open http://localhost:8000 in your browser.


Web Dashboard Guide

  1. Enter Novel URL: Paste the main index or table-of-contents link of the novel into the input box.
  2. Start Scraping: Click "Start Scraping -> EPUB".
  3. Live Progress: Watch real-time progress as chapters are fetched, cleaned, and compiled into the EPUB.
  4. Download & Manage: Once complete, click "Download EPUB" or manage your compiled books directly from the built-in Library.

CLI Usage

If you prefer working from the terminal, run main.py directly:

CLI Syntax:

python main.py <url> [-o OUTPUT] [--refresh [{none,llm,all}]]

Flags & Options:

Option / Flag Type Description
url Positional (Required) The main index / table-of-contents URL of the novel.
-o, --output Optional Output directory for the compiled EPUB file (default: ./output).
--refresh Optional (Choice) Cache refresh mode: none (default, full cache), llm (reuse HTML, re-run AI), or all (full scrape anew). Providing --refresh without an argument defaults to all.
-h, --help Optional (Flag) Show command-line help message and exit.

Where Are My EPUB Files?

All compiled .epub files are saved directly inside the output/ directory in the project folder:

  • Host Path: ./output/<novel-title>.epub
  • Docker Path: /app/output/<novel-title>.epub

You can move these files to your e-reader (Kindle, Kobo, Boox) or integrate the folder with media servers like Calibre-Web, Kavita, or Audiobookshelf.


Configuration Reference

All settings can be configured inside your .env file:

Variable Description Default
LLM_API_KEY Required. Your API key for the OpenAI-compatible LLM. None
LLM_BASE_URL Required. Base URL of any OpenAI-compatible API endpoint. None
LLM_MODEL Required. Model identifier used for extraction & cleaning. None
DATABASE_URL PostgreSQL connection string. If omitted, uses local sqlite.db. None (SQLite)
OUTPUT_DIR Directory where compiled EPUBs are stored. output
S
Description
Clean web novel scraper and EPUB generator with Web UI and CLI
Readme
1.5 MiB
Languages
Python 62.1%
HTML 22.6%
CSS 15%
Dockerfile 0.3%