← 返回 Skills 市场
cclam5

Youtube To Ebook

作者 cclam5 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
37
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install youtube-to-ebook
功能描述
Transform YouTube videos into beautifully formatted ebook articles with transcripts
使用说明 (SKILL.md)

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:

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:

\x3C!-- ~/Library/LaunchAgents/com.youtube.ebook.plist -->
\x3Cplist version="1.0">
\x3Cdict>
    \x3Ckey>Label\x3C/key>
    \x3Cstring>com.youtube.ebook\x3C/string>
    \x3Ckey>ProgramArguments\x3C/key>
    \x3Carray>
        \x3Cstring>/usr/bin/python3\x3C/string>
        \x3Cstring>/path/to/main.py\x3C/string>
    \x3C/array>
    \x3Ckey>StartCalendarInterval\x3C/key>
    \x3Cdict>
        \x3Ckey>Weekday\x3C/key>
        \x3Cinteger>3\x3C/integer>
        \x3Ckey>Hour\x3C/key>
        \x3Cinteger>7\x3C/integer>
    \x3C/dict>
\x3C/dict>
\x3C/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
安全使用建议
Before installing, create a separate project folder and virtual environment, keep API keys in a private .env file, add only the providers you intend to use, and inspect the full email/dashboard behavior before enabling Gmail or launchd automation. Pin dependencies if you want more reproducible installs.
功能分析
Type: OpenClaw Skill Name: youtube-to-ebook Version: 1.0.0 The skill bundle exhibits high-risk behaviors by using a Streamlit dashboard (`dashboard.py`) that modifies its own Python source code (`get_videos.py`, `write_articles.py`) via regex based on user input, creating a significant code injection vulnerability. It also utilizes `subprocess` to manage system-level persistence through macOS `launchctl` and contains hardcoded paths to a specific corporate user environment (`/Users/bytedance/` in `run_newsletter.sh`). While these functions serve the stated purpose of scheduling and configuration, the implementation lacks basic security sanitization and employs dangerous execution patterns that could be exploited to achieve remote code execution.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The core behavior is coherent with the stated purpose: fetch YouTube videos, obtain transcripts, generate articles with Claude, and create an EPUB. The code also includes optional email delivery and dashboard/automation features, which are related but should be reviewed.
Instruction Scope
The provided instructions do not show prompt overrides, hidden goal changes, or attempts to make the skill authoritative over the user. Video transcripts are used as model input for article generation, which is central to the skill.
Install Mechanism
There is no install spec, the source/homepage are unknown, and Python dependencies are unpinned. This is not unusual for a small script-style project, but users should install in a virtual environment and review dependencies.
Credentials
The skill uses several external services and credentials: YouTube, Anthropic, Supadata, and optionally Gmail. These are purpose-aligned, but registry metadata declares no required env vars, so the credential requirements are under-described.
Persistence & Privilege
The Mac launchd automation is optional and user-directed, but it creates recurring local execution that can consume API quota and send email if configured.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install youtube-to-ebook
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /youtube-to-ebook 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of youtube-to-ebook! Convert YouTube videos from your favorite channels into polished magazine-style EPUB articles. - Fetches latest videos (excluding Shorts) and extracts transcripts - Transforms transcripts into well-written articles using Claude - Packages articles into a clean EPUB ebook, ready to read on any device - Includes solutions for common YouTube API and transcript issues - Offers customization for writing style and optional email delivery
元数据
Slug youtube-to-ebook
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Youtube To Ebook 是什么?

Transform YouTube videos into beautifully formatted ebook articles with transcripts. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 37 次。

如何安装 Youtube To Ebook?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install youtube-to-ebook」即可一键安装,无需额外配置。

Youtube To Ebook 是免费的吗?

是的,Youtube To Ebook 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Youtube To Ebook 支持哪些平台?

Youtube To Ebook 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Youtube To Ebook?

由 cclam5(@cclam5)开发并维护,当前版本 v1.0.0。

💬 留言讨论