whatisgithub

What is weread-exporter?

lbq110/weread-exporter — explained in plain English

Analysis updated 2026-05-18

145PythonAudience · developer

In one sentence

A Python tool that automates a browser to capture WeRead's canvas-drawn book text and exports full books as Markdown.

Mindmap

mindmap
  root((WeRead Exporter))
    What it does
      Captures canvas text
      Rebuilds paragraphs
      Exports to Markdown
    Tech stack
      Python
      Playwright
      Chromium
    Use cases
      Export owned books
      Personal study archive
      Canvas hook technique
    Audience
      Developers
    Limits
      Requires account access
      App only books blocked
      Slow per chapter export

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Export a book you have access to on WeRead into readable Markdown chapter files.

USE CASE 2

Reconstruct canvas-rendered text into normal paragraphs using captured character coordinates.

USE CASE 3

Keep a persistent logged-in WeRead session after scanning a QR code once.

USE CASE 4

Study how a page renders text via Canvas can be intercepted with a fillText hook.

What is it built with?

PythonPlaywrightChromium

How does it compare?

lbq110/weread-exportermurphylmf/unishriyagoelrs/tiktok-scraper
Stars145145145
LanguagePythonPythonPython
Setup difficultyhard
Complexity5/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

So what is it?

This is a Python tool for exporting full books from WeRead, a Chinese ebook reading platform, and converting them into Markdown files. The web version of WeRead does not display its text as normal selectable webpage text. Instead it draws each character directly onto a Canvas element, which normally makes the content much harder to extract. To work around this, the tool uses Playwright to automate a Chromium browser and keep you logged into your WeRead account after a single QR code scan. Before the page's own code runs, it injects a hook into the browser's Canvas drawing function, so it can intercept every individual character the page tries to draw, along with its screen position. Because WeRead renders both the current page and the next page onto the same canvas at once as a performance trick, the tool detects where the vertical position resets to correctly split the captured characters into separate pages. It then reconstructs full lines and paragraphs from the individual characters based on their x and y coordinates, and cleans up the line breaks introduced by canvas rendering so the result reads as natural paragraphs. To use it, you install Playwright and its Chromium browser, then run the script with either a book's URL or its book ID. You can choose an output folder and optionally skip saving the raw captured canvas coordinate data to save disk space. The first run opens a browser window asking you to scan a QR code to log into your WeRead account, and that login session is then reused for later runs. The output includes a metadata file with the book's title, author, and chapter list, a Markdown file for each chapter, and one combined Markdown file for the whole book. The tool only works for books you already have access to through your account, and some publishers block web reading entirely, showing an app only message instead, which this tool cannot get around. Exporting is fairly slow, taking roughly 20 to 30 seconds per chapter due to page turning delays. The README states the tool is intended only for personal study and research, not for commercial use or wide redistribution, and asks users to respect copyright.

Copy-paste prompts

Prompt 1
Explain how the Canvas fillText hook in this tool captures text that WeRead renders as images.
Prompt 2
Walk me through running this script to export a book using its book ID.
Prompt 3
How does this tool separate the current page from the pre-rendered next page on the same canvas.
Prompt 4
What does the --no-raw flag do when running weread_export.py.

Frequently asked questions

What is weread-exporter?

A Python tool that automates a browser to capture WeRead's canvas-drawn book text and exports full books as Markdown.

What language is weread-exporter written in?

Mainly Python. The stack also includes Python, Playwright, Chromium.

Who is weread-exporter for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.