youtube

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

YouTube Skill

YouTube Skill

Overview

概述

Automates YouTube viewer operations including managing subscriptions, playlists, watch history, and engagement through the main YouTube interface.
通过YouTube主界面自动化执行观看者操作,包括管理订阅、播放列表、观看历史和互动操作。

Quick Install

快速安装

bash
curl -sSL https://canifi.com/skills/youtube/install.sh | bash
Or manually:
bash
cp -r skills/youtube ~/.canifi/skills/
bash
curl -sSL https://canifi.com/skills/youtube/install.sh | bash
或者手动安装:
bash
cp -r skills/youtube ~/.canifi/skills/

Setup

配置

Configure via canifi-env:
bash
undefined
通过canifi-env进行配置:
bash
undefined

First, ensure canifi-env is installed:

首先,确保已安装canifi-env:

canifi-env set GOOGLE_EMAIL "your-email@example.com" canifi-env set GOOGLE_PASSWORD "your-password"
undefined
canifi-env set GOOGLE_EMAIL "your-email@example.com" canifi-env set GOOGLE_PASSWORD "your-password"
undefined

Privacy & Authentication

隐私与认证

Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭据,由你掌控。Canifi LifeOS 尊重你的隐私。

Option 1: Manual Browser Login (Recommended)

选项1:手动浏览器登录(推荐)

If you prefer not to share credentials with Claude Code:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
  1. 使用CDP模式完成浏览器自动化配置
  2. 在Playwright控制的Chrome窗口中手动登录该服务
  3. Claude将使用你的已认证会话,全程不会获取你的密码

Option 2: Environment Variables

选项2:环境变量

If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
注意:存储在canifi-env中的凭据仅能在你的本地机器上访问,绝不会被传输。

Capabilities

功能

  • Search and find videos
  • Manage subscriptions
  • Create and edit playlists
  • Like and comment on videos
  • View watch history
  • Save videos to watch later
  • Access subscription feed
  • Manage video preferences
  • 搜索并查找视频
  • 管理订阅
  • 创建和编辑播放列表
  • 点赞和评论视频
  • 查看观看历史
  • 将视频保存至“稍后观看”
  • 访问订阅推送
  • 管理视频偏好设置

Usage Examples

使用示例

Example 1: Search Videos

示例1:搜索视频

User: "Find the latest videos about machine learning"
Claude: I'll search for those videos.
- Navigate to youtube.com
- Search "machine learning"
- Filter by upload date
- Present top results with metadata
用户:“查找关于机器学习的最新视频”
Claude:我会搜索这些视频。
- 导航至youtube.com
- 搜索“machine learning”
- 按上传日期筛选
- 展示包含元数据的顶部结果

Example 2: Create Playlist

示例2:创建播放列表

User: "Create a playlist called 'Learning Python'"
Claude: I'll create that playlist.
- Navigate to Library
- Click Create playlist
- Name it "Learning Python"
- Set privacy to private or public
- Confirm creation
用户:“创建一个名为'Learning Python'的播放列表”
Claude:我会创建这个播放列表。
- 导航至“库”页面
- 点击“创建播放列表”
- 将其命名为“Learning Python”
- 设置隐私为私有或公开
- 确认创建

Example 3: Manage Subscriptions

示例3:管理订阅

User: "Subscribe to this channel"
Claude: I'll subscribe to the channel.
- Navigate to channel page
- Click Subscribe button
- Enable notifications if requested
- Confirm subscription
用户:“订阅这个频道”
Claude:我会订阅该频道。
- 导航至频道页面
- 点击“订阅”按钮
- 如请求启用通知
- 确认订阅

Example 4: Check Subscription Feed

示例4:查看订阅推送

User: "Show me new videos from my subscriptions"
Claude: I'll check your subscriptions.
- Navigate to Subscriptions page
- List recent uploads
- Present videos with titles and channels
- Note which are new since last check
用户:“展示我订阅频道的新视频”
Claude:我会查看你的订阅内容。
- 导航至“订阅”页面
- 列出最近上传的视频
- 展示包含标题和频道信息的视频
- 标注自上次检查以来的新视频

Authentication Flow

认证流程

  1. Navigate to youtube.com via Playwright MCP
  2. Sign in with Google credentials from canifi-env
  3. Handle 2FA if enabled (notify user via iMessage)
  4. Verify home page access
  5. Maintain session cookies
  1. 通过Playwright MCP导航至youtube.com
  2. 使用canifi-env中的Google凭据登录
  3. 若启用了2FA则处理(通过iMessage通知用户)
  4. 验证主页访问权限
  5. 维护会话Cookie

Error Handling

错误处理

  • Login Failed: Retry Google sign-in flow
  • Session Expired: Re-authenticate automatically
  • 2FA Required: iMessage for verification code
  • Video Unavailable: Check region or privacy restrictions
  • Playlist Error: Verify ownership and permissions
  • Rate Limited: Implement backoff
  • Age Restricted: May need verification
  • Channel Not Found: Verify channel name
  • 登录失败:重试Google登录流程
  • 会话过期:自动重新认证
  • 需要2FA:通过iMessage发送验证码
  • 视频不可用:检查地区或隐私限制
  • 播放列表错误:验证所有权和权限
  • 速率限制:实现退避机制
  • 年龄限制:可能需要验证
  • 频道未找到:验证频道名称

Self-Improvement Instructions

自我改进说明

When encountering new YouTube features:
  1. Document new UI elements
  2. Add support for new video types
  3. Log successful playlist patterns
  4. Update for YouTube changes
当遇到YouTube新功能时:
  1. 记录新的UI元素
  2. 添加对新视频类型的支持
  3. 记录成功的播放列表操作模式
  4. 根据YouTube的更新进行适配

Notes

注意事项

  • YouTube Studio is separate skill for creators
  • Playlists can be public, unlisted, or private
  • Subscription notifications are optional
  • Premium features require subscription
  • Some videos are region-locked
  • Comments may be disabled on videos
  • Watch history affects recommendations
  • YouTube Studio是面向创作者的独立技能
  • 播放列表可以设为公开、不公开或私有
  • 订阅通知为可选功能
  • 高级功能需要订阅
  • 部分视频受地区限制
  • 部分视频可能禁用评论
  • 观看历史会影响推荐内容