reddit-digest-to-epub

Convert AskHistorians Reddit digest URLs into self-contained EPUB ebooks via Playwright browser scraping.

1|Updated Dec 18, 2009
One-click install
npx skills add https://github.com/thurn/dotfiles --skill reddit-digest-to-epub-thurn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: reddit-digest-to-epub
Source: https://github.com/thurn/dotfiles/tree/main/.llms/skills/reddit-digest-to-epub
Command: npx skills add https://github.com/thurn/dotfiles --skill reddit-digest-to-epub-thurn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright-core, jszip, and includes scripts (resource) components.

What problem does it solve? Turning a Reddit r/AskHistorians Sunday Digest into an offline-readable ebook normally requires manually opening dozens of threads and copy-pasting answers. This Skill automates the entire conversion, rendering each linked question and its answer-comment branches into a polished EPUB without needing Reddit OAuth or API access. ## Core Features & Use Cases - Browser-based scraping: Uses Playwright with a persistent Chrome/Chromium profile to read Reddit's rendered DOM, handling JavaScript challenges and rate-limit cooldowns with bounded exponential backoff. - Resumable caching: Completed thread captures are cached locally, so rerunning the same command resumes where it left off instead of re-scraping. - Flexible controls: Flags like --max-threads, --max-comments, --max-words-per-thread, --concurrency, and --headless let you build preview books or tune large 200-300 link digests. - Use Case: Before a long flight, convert the latest AskHistorians Sunday Digest into an EPUB and AirDrop it to an iPhone for offline reading. ## Quick Start Use the reddit-digest-to-epub skill to turn this AskHistorians Sunday Digest URL into an offline EPUB saved to my chosen output path.

Frequently Asked Questions about reddit-digest-to-epub

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a Reddit AskHistorians digest into an EPUB?▼

Run the bundled script with node scripts/reddit-digest-to-epub.mjs DIGEST_URL --output /absolute/path/book.epub after running npm install in the skill directory. It scrapes each linked thread with Playwright and packages the rendered questions and answers into an EPUB.

Does scraping Reddit require OAuth or API access?▼

No Reddit OAuth or API access is required. The script reads Reddit's rendered browser DOM through Playwright with a dedicated persistent Chrome profile, and the skill explicitly forbids replacing it with .json endpoints or an API client.

How long does converting a large Reddit digest take?▼

A small uncached digest takes roughly 10-30 minutes, while a large digest with 200-300 links takes 30-90 minutes. Reddit challenges and cooldowns can extend the run, and the script prints a calibrated estimate after discovering the digest links.

What happens when Reddit rate-limits or blocks the scraper?▼

The script detects block pages and HTTP 403/429 responses, then cools down with bounded exponential backoff and retries up to the configured limit. It treats block pages as errors rather than silently producing an empty EPUB.

Can I resume an interrupted Reddit digest conversion?▼

Yes, completed thread captures are cached in ~/.cache/reddit-digest-to-epub/threads, so rerunning the same command resumes from cached data. Use --refresh only when you want to ignore cached captures and re-scrape everything.

How do I make a smaller preview EPUB from a large digest?▼

Pass --max-threads N to limit how many digest links are captured, and combine it with --max-comments or --max-words-per-thread to shrink each chapter. This produces a quick validation book before committing to a full multi-hour run.