WANGXIN-567/weread-book-exporter
Productivity & UtilitiesExport WeRead books you can access into PDF, EPUB, and Markdown for offline reading and knowledge-base archiving.
Project overview
WeRead Book Exporter is a Python tool that captures the full text of books you have purchased or can read through a WeRead membership on the web reader, then converts them into three formats: a paginated PDF with dual-font typography (PingFang body text and KaiTi quotations), a standard EPUB with an embedded table of contents and images, and Markdown suitable for Obsidian or Notion. It is aimed at readers who want offline copies, full-text search, or a personal knowledge base built from books they already have access to.
The approach is browser automation rather than reverse-engineering an API. It drives the web reader through Playwright, switches to the horizontal two-column paging mode, and reads the rendered page contents page by page. Because of that, the README highlights two features: avoiding skipped text that occurs with very long virtual-scroll containers, and rebuilding paragraph order and sentence continuity across page breaks and inline images. Styling is inferred from font size and weight on the rendered page to distinguish chapter headings, block quotations, bold subheadings, and body text features and format table.
Quick start
Prerequisites: Python 3.9+ and a modern Chrome or Edge install. Clone and install dependencies:
git clone https://github.com/WANGXIN-567/weread-book-exporter.git
cd weread-book-exporter
pip install -r requirements.txt -i https://mirrors.cloud.tencent.com/pypi/simple/
The README notes a domestic PyPI mirror to avoid timeouts and says the code detects an installed Edge or Chrome, so the ~200 MB Playwright Chromium download is normally unnecessary; run playwright install chromium only if neither browser is present install instructions.
Then pass a full WeRead web reader URL (a book ID also works):
python main.py https://weread.qq.com/web/reader/3b132980813ab94eeg013129
On first run a browser window opens; scan the QR code with WeChat to log in once. The script then walks chapters, downloads the cover and illustrations, renders the PDF, builds the EPUB, and writes Markdown into output/ usage example. For stepwise control, python crawl_weread.py <url-or-id> captures the book and python export_book.py <url-or-id> exports it.
Operational constraints
- A WeRead account with legitimate access to the book is required; the tool operates on the logged-in web reader, not on a public catalog.
- Capture is intentionally slow. Page turns wait a random 8–20 seconds, and every 10–20 pages triggers a 1–2 minute pause to reduce load on the service rate-limiting design. Long books therefore take a substantial amount of wall-clock time.
- Only Chrome or Edge is supported as the automation browser unless Chromium is installed separately.
- Output is limited to what the web reader renders, and paragraph/heading reconstruction depends on font-size and weight heuristics; unusual layouts may need manual cleanup.
- The project is MIT licensed but explicitly scopes use to personal study and notes, and asks users not to redistribute exported files disclaimer.
HotRepo's take
The repository appeared in HotRepo's new-project list on 2026-11-06, recording 203 stars and 15 forks, with 57 stars gained in the roughly one-hour window from 02:45 to 03:45 UTC. That is a short observation window, so it supports only a same-day snapshot rather than a trend. What stands out technically is the choice to work through the rendered canvas and horizontal paging layout instead of assuming a simple scroll capture, which is the failure mode the project explicitly targets; the randomized delays and long pauses are a practical acknowledgement that full-book capture is a slow, service-sensitive operation.
Written by AI from the project's README, updated . The project's own docs are the source of truth.