youtube-to-ebook

Transform YouTube videos into beautifully formatted ebook articles with transcripts

16 stars

Best use case

youtube-to-ebook is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Transform YouTube videos into beautifully formatted ebook articles with transcripts

Teams using youtube-to-ebook should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/youtube-to-ebook/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/youtube-to-ebook/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/youtube-to-ebook/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How youtube-to-ebook Compares

Feature / Agentyoutube-to-ebookStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Transform YouTube videos into beautifully formatted ebook articles with transcripts

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# YouTube to Ebook

Transform YouTube videos from your favorite channels into well-written magazine-style articles, delivered as an EPUB ebook.

## What This Skill Does

1. Fetches latest videos from YouTube channels (filtering out Shorts)
2. Extracts transcripts from those videos
3. Transforms transcripts into polished articles using Claude
4. Packages articles into an EPUB ebook for reading on any device

## Quick Start

Ask: "Set up YouTube to ebook for me"

I'll guide you through:
1. Creating a project folder
2. Setting up YouTube API access
3. Configuring your favorite channels
4. Generating your first ebook

## Requirements

- Python 3.8+
- YouTube Data API key (free from Google Cloud Console)
- Anthropic API key (for Claude)

## Commands

| Command | Description |
|---------|-------------|
| `python main.py` | Generate ebook from latest videos |
| `python main.py --channels` | Edit channel list |
| `python dashboard.py` | Launch web dashboard |

## Key Files

```
youtube-newsletter/
├── get_videos.py      # Fetch latest videos
├── get_transcripts.py # Extract transcripts
├── write_articles.py  # Transform to articles
├── send_email.py      # Create EPUB & send
├── main.py            # Run full pipeline
├── channels.txt       # Your channel list
└── .env               # API keys
```

## Known Pitfalls & Solutions

### 1. YouTube Shorts Detection
**Problem**: Filtering by duration doesn't work—some Shorts are longer than 60 seconds.

**Solution**: Check if the `/shorts/` URL resolves:
```python
def is_youtube_short(video_id):
    shorts_url = f"https://www.youtube.com/shorts/{video_id}"
    response = requests.head(shorts_url, allow_redirects=True, timeout=5)
    return "/shorts/" in response.url
```

### 2. Videos Not in Chronological Order
**Problem**: YouTube Search API doesn't return truly chronological results.

**Solution**: Use the channel's uploads playlist via `playlistItems` API:
```python
# Get uploads playlist ID from channel
channel_info = youtube.channels().list(
    part="contentDetails",
    forHandle=handle
).execute()
uploads_playlist_id = channel_info["items"][0]["contentDetails"]["relatedPlaylists"]["uploads"]

# Fetch from uploads playlist (always chronological)
youtube.playlistItems().list(
    part="snippet",
    playlistId=uploads_playlist_id,
    maxResults=15
).execute()
```

### 3. Transcript API Syntax
**Problem**: `YouTubeTranscriptApi.get_transcript()` no longer works.

**Solution**: Use instance method:
```python
from youtube_transcript_api import YouTubeTranscriptApi

ytt_api = YouTubeTranscriptApi()
transcript = ytt_api.fetch(video_id)
```

### 4. Rate Limiting on Transcripts
**Problem**: Fetching many transcripts quickly triggers rate limits.

**Solution**: Add 2-second delays between requests:
```python
import time
for video in videos:
    transcript = get_transcript(video["video_id"])
    time.sleep(2)
```

### 5. Transcript Accuracy (Names, Terms)
**Problem**: Auto-transcripts misspell names and technical terms.

**Solution**: Include video title and description in Claude's context—these usually have correct spellings.

### 6. Cloud Automation Blocked
**Problem**: GitHub Actions and cloud servers are blocked by YouTube for transcript fetching.

**Solution**: Run automation locally on your Mac using `launchd`:
```xml
<!-- ~/Library/LaunchAgents/com.youtube.ebook.plist -->
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.youtube.ebook</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/python3</string>
        <string>/path/to/main.py</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Weekday</key>
        <integer>3</integer>
        <key>Hour</key>
        <integer>7</integer>
    </dict>
</dict>
</plist>
```

## Customization

### Writing Style
Edit the prompt in `write_articles.py` to change article tone:
- Magazine style (default)
- Academic summary
- Casual blog post
- Technical documentation

### Email Delivery (Optional)
Add Gmail credentials to `.env` to receive ebooks via email:
```
GMAIL_ADDRESS=your@gmail.com
GMAIL_APP_PASSWORD=your-app-password
```

## Workflow

```
┌─────────────┐    ┌──────────────┐    ┌───────────────┐    ┌────────────┐
│ Fetch Videos│───▶│Get Transcripts│───▶│Write Articles │───▶│Create EPUB │
│ (YouTube API)│    │(Transcript API)│    │  (Claude AI)  │    │ (ebooklib) │
└─────────────┘    └──────────────┘    └───────────────┘    └────────────┘
```

## Example Output

The generated EPUB contains:
- Table of contents with all articles
- Clean, readable formatting
- Original video links for reference
- Mobile-friendly styling

Related Skills

youtube-summarizer

16
from diegosouzapw/awesome-omni-skill

Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks

youtube-shorts-automation

16
from diegosouzapw/awesome-omni-skill

YouTube Shorts 자동 생성 및 업로드 파이프라인. Deevid AI Agent로 이미지→영상(BGM+음성 포함) 생성 후 YouTube에 업로드. 크론잡으로 매일 자동 실행 가능. Use when generating short-form vertical videos, creating AI-generated video content, uploading to YouTube Shorts, or automating daily video content pipelines.

youtube-automation

16
from diegosouzapw/awesome-omni-skill

Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.

Facebook Automation

16
from diegosouzapw/awesome-omni-skill

Automate Facebook Page management including post creation, scheduling, video uploads, Messenger conversations, and audience engagement via Composio

Automate YouTube Top-Ten Video Creation with OpenAI and Safe Image Search

16
from diegosouzapw/awesome-omni-skill

Integrates OpenAI API for content generation, Bing Image Search API for safe image retrieval, and Pexels API for video footage. Handles authentication via Bearer token, enforces safe search, formats ChatGPT responses into a top-ten list, and includes error handling for API failures.

open-notebook

16
from diegosouzapw/awesome-omni-skill

Self-hosted, open-source alternative to Google NotebookLM for AI-powered research and document analysis. Use when organizing research materials into notebooks, ingesting diverse content sources (PDFs, videos, audio, web pages, Office documents), generating AI-powered notes and summaries, creating multi-speaker podcasts from research, chatting with documents using context-aware AI, searching across materials with full-text and vector search, or running custom content transformations. Supports 16+ AI providers including OpenAI, Anthropic, Google, Ollama, Groq, and Mistral with complete data privacy through self-hosting.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

moai-lang-r

16
from diegosouzapw/awesome-omni-skill

R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.

moai-lang-python

16
from diegosouzapw/awesome-omni-skill

Python 3.13+ development specialist covering FastAPI, Django, async patterns, data science, testing with pytest, and modern Python features. Use when developing Python APIs, web applications, data pipelines, or writing tests.

moai-icons-vector

16
from diegosouzapw/awesome-omni-skill

Vector icon libraries ecosystem guide covering 10+ major libraries with 200K+ icons, including React Icons (35K+), Lucide (1000+), Tabler Icons (5900+), Iconify (200K+), Heroicons, Phosphor, and Radix Icons with implementation patterns, decision trees, and best practices.

moai-foundation-trust

16
from diegosouzapw/awesome-omni-skill

Complete TRUST 4 principles guide covering Test First, Readable, Unified, Secured. Validation methods, enterprise quality gates, metrics, and November 2025 standards. Enterprise v4.0 with 50+ software quality standards references.

moai-foundation-memory

16
from diegosouzapw/awesome-omni-skill

Persistent memory across sessions using MCP Memory Server for user preferences, project context, and learned patterns