agentsclimarketplace

YouTubeToEbook

Skill mj-deving/pai-skills/skills/ContentAnalysis/YouTubeToEbook

Curated, sanitized export of 21 agent-skill packages for Claude Code and Codex, gated by an automated publication audit (no secrets, no local paths).

Install
npx -y skills add mj-deving/pai-skills --skill YouTubeToEbook

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Transform YouTube videos into beautifully formatted ebook articles with transcripts

SKILL.md

5.0 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

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

CommandDescription
python main.pyGenerate ebook from latest videos
python main.py --channelsEdit channel list
python dashboard.pyLaunch 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:

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:

# 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:

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:

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:

<!-- ~/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:

[email protected]
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

What ships with it: 8 files

56.4 KB alongside SKILL.md, 7 of them executable

scripts/

Gives 0 of the 12 instructions most social media skills give in ~1.2k tokens

Counted across 489 of the 492 authors here whose files we hold, read 2026-08-07

  • Adapt formats and tone to each platformin 26 of 489, across 14 files
  • Build content around three to five pillarsin 25 of 489, across 13 files
  • Read product marketing context before asking questionsin 23 of 489, across 13 files
  • Respond to all comments on your postsin 21 of 489, across 9 files
  • Use the output flag to specify an output directoryin 14 of 489, across 4 files
  • Generate output logo images with white backgroundin 13 of 489, across 4 files
  • Fix failing generation scripts directlyin 13 of 489, across 4 files
  • Ask user about HTML preview after logo generationin 12 of 489, across 3 files
  • Run the download script with a URLin 12 of 489, across 3 files
  • Implement exponential backoff for 429 responsesin 12 of 489, across 3 files
  • Write the hook firstin 12 of 489, across 7 files
  • Include a single clear call to actionin 12 of 489, across 9 files

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.