youtube-to-ebook: The Anti-SaaS Pipeline for the Slow Web

How a local Python daemon uses Claude 3.5 Sonnet to transform chaotic video feeds into curated, magazine-grade EPUBs.

7 min read • View on GitHub • More from zarazhangrui

A chaotic web of film strips feeding into a mechanical printing press that outputs a perfectly bound book. This illustrates the transformation of noisy video media into quiet, structured text.
Converting the algorithmic feed into a finished, offline product.
Key Takeaways

The Prompt is the Editor-in-Chief

Most transcription wrappers treat text as raw data. They summarize, extract, and dump words into a database. The youtube-to-ebook project takes a different approach. It acts as an automated editorial desk. Its goal is to produce a finished, literary product that you can read offline.

Convert YouTube videos into stylish EPUB ebooks, complete with polished transcripts and optional email delivery for effortless reading.

HoangTheElegant/youtube-to-ebook README, Project Documentation · HoangTheElegant/youtube-to-ebook

The most fascinating intellectual choice in the codebase is how it handles context. AI transcriptions are notorious for phonetic hallucinations. If a speaker mentions the math channel 3Blue1Brown, a raw transcript might read 'Mark Brown'. To solve this, the script passes the video description into Claude alongside the transcript to act as an anchor.

Two hands working on a manuscript. A mechanical hand writes with a pen while a human hand holds up a reference index card. This visualizes the use of a video description as ground-truth context to guide the LLM.
Context injection forces the LLM into the role of a fact-checking editor.

Surviving the Extraction War

Scraping YouTube is a brittle endeavor. Standard libraries are frequently rate-limited or blocked by Google. The project abandons native scraping in favor of the Supadata API. This offloads the proxy rotation and bot-detection bypass to a dedicated service.

It also employs a clever HTTP redirect hack to filter out YouTube Shorts. Instead of relying on flawed metadata, a simple requests.head call checks if the URL redirects. If it does, the script instantly discards the short-form content.

The isolated pipeline ensures atomicity. If a step fails, the local state prevents duplicate processing.

A Daemon, Not a Web App

This is deliberately not a cloud application. By running locally via macOS LaunchAgents, the tool avoids server costs and bypasses cloud IP blocks. It maintains a strict state using a local JSON file to ensure atomicity before emailing the final EPUB.

def mark_videos_processed(video_ids):
    processed = load_processed_videos()
    processed.update(video_ids)
    with open("processed_videos.json", "w") as f:
        json.dump(list(processed), f)

The Reader vs. The Note-Taker

The YouTube-to-text space is divided by philosophy. Tools like Ebrizzzz focus on Markdown for knowledge graphs and study notes. The youtube-to-ebook pipeline is built for the Slow Web reader who wants a finished, offline magazine delivered to their inbox.

Featureyoutube-to-ebookEbrizzzz
Target OutputEPUB & EmailMarkdown
Primary AIClaude 3.5 SonnetGemini
Extraction MethodSupadata APINative API
Execution EnvironmentLocal DaemonDesktop App
Core PhilosophySlow Web ReadingKnowledge Base Ingestion