Convert WeChat articles to PDF and EPUB for reading on e-readers and any device.
Paste a WeChat article URL, get PDF and EPUB files. Simple as that.
- Works with any WeChat Official Account (公众号) article
- Outputs both PDF and EPUB formats
- Optimized for e-ink readers (Kindle, Kobo, etc.)
- No account required
Frontend (Vercel/Cloudflare) Backend (VPS)
┌─────────────────────┐ ┌─────────────────────────┐
│ Static HTML/JS │ ──────> │ FastAPI + Playwright │
│ URL input form │ │ PDF/EPUB generation │
│ Stripe payment │ │ │
└─────────────────────┘ └─────────────────────────┘
Frontend:
- Static HTML/CSS/JS
- Hosted on Vercel or Cloudflare Pages
Backend:
- Python + FastAPI
- Playwright (headless browser for WeChat scraping)
- ebooklib (EPUB generation)
- Hosted on any VPS (Linode, DigitalOcean, etc.)
Payments:
- Stripe + Alipay
cd backend
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
playwright install chromium
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000
Just open frontend/index.html in a browser, or:
cd frontend
python3 -m http.server 3000To test the frontend from a phone on your local network:
-
Start a local server on your Mac:
cd frontend python3 -m http.server 8080 -
Find your Mac's local IP:
ipconfig getifaddr en0
This will return something like
192.168.1.100 -
On your phone, open:
http://<mac-ip>:8080Example:
http://192.168.1.100:8080
The frontend auto-detects local network IPs (192.168.x.x, 10.x.x.x, etc.) and will use the dev backend (dev-api.readly.space). You'll see "(dev)" on the Convert button to confirm.
When accessed from the public internet (e.g., readly.space), it uses the production backend (api.readly.space).
GET /health
POST /convert
Content-Type: application/json
{
"url": "https://mp.weixin.qq.com/s/..."
}
Response:
{
"job_id": "abc12345",
"title": "Article Title",
"pdf_url": "/download/abc12345/pdf",
"epub_url": "/download/abc12345/epub"
}GET /download/{job_id}/pdf
GET /download/{job_id}/epub
- A Linux VPS (Ubuntu/Debian recommended)
- Domain name pointed to your server
- nginx and certbot installed
git clone https://github.com/Inturious-Labs/readly.git ~/readly
cd ~/readly/backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
playwright install chromium
playwright install-depsEdit the service file and replace YOUR_USER with your Linux username:
sed -i 's/YOUR_USER/your_actual_username/g' ~/readly/deploy/readly.serviceCopy and enable the service:
sudo cp ~/readly/deploy/readly.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable readly
sudo systemctl start readlyCheck status:
sudo systemctl status readlyCreate nginx config:
sudo nano /etc/nginx/sites-available/readlyserver {
listen 80;
server_name api.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Enable and get SSL:
sudo ln -s /etc/nginx/sites-available/readly /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d api.yourdomain.com# View logs
sudo journalctl -u readly -f
# Restart service
sudo systemctl restart readly
# After code updates
cd ~/readly && git pull && sudo systemctl restart readly