跳到正文
cccskills
免费在 GitHub 公开

youtube

Interact with YouTube — search videos, get video details, browse channels, read comments, view trending, browse playlists, like/unlike videos, subscribe/unsubscribe to channels. Use this skill whenever the user mentions YouTube, wants to search for videos, get video info, read comments, browse a channel, check trending videos, view a playlist, or interact with YouTube content. Also trigger when the user pastes a YouTube URL (e.g. youtube.com/watch?v=..., youtu.be/...) or mentions a YouTube channel.

中文简介正在准备中。当前显示原文说明。

集成工具YouTube
查看安装方法

包含的文件(19)

  • SKILL.md8.7 KB
  • references/provider-config.yaml534 B
  • scripts/youtube_channel.py4.6 KB
  • scripts/youtube_client.py5.2 KB
  • scripts/youtube_comments.py3.0 KB
  • scripts/youtube_like.py1.7 KB
  • scripts/youtube_playlist.py4.2 KB
  • scripts/youtube_search.py2.4 KB
  • scripts/youtube_subscribe.py2.3 KB
  • scripts/youtube_trending.py4.4 KB
  • scripts/youtube_video.py2.0 KB
  • tests/test_youtube_channel.py4.9 KB
  • tests/test_youtube_comments.py4.2 KB
  • tests/test_youtube_like.py1.8 KB
  • tests/test_youtube_playlist.py5.9 KB
  • tests/test_youtube_search.py3.8 KB
  • tests/test_youtube_subscribe.py2.2 KB
  • tests/test_youtube_trending.py3.8 KB
  • tests/test_youtube_video.py3.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

YouTube

Search videos, get video details, browse channels, read comments, view trending, browse playlists, and interact with YouTube.

Skill Directory

<SKILL_DIR> is the directory containing this SKILL.md file. Determine it ONCE at the start and reuse it.

Setup (run FIRST — every time, before any operation)

You MUST complete this setup before running any script. Do NOT skip this step.

sig status youtube 2>&1

Check the JSON output fields configured and valid:

  • configured: false → run Provider Setup below. Do NOT proceed without completing it.
  • valid: false (but configured: true) → run sig login youtube, then re-check.
  • valid: true → detect proxy (see below), then execute the user's request.

Provider Setup

  1. Read <SKILL_DIR>/references/provider-config.yaml
  2. Append the provider block to ~/.sig/config.yaml under providers:
  3. IMPORTANT! ASK THE USER: "Do you need a proxy to access this site?" — if yes, add networkProxy: <url> under the provider in config.yaml
  4. Run sig login youtube (with --network-proxy <url> if proxy was specified)
  5. Verify: run sig status youtube again — must show valid: true before proceeding

Proxy Detection (after provider is valid)

grep -A15 "^\s*youtube:" ~/.sig/config.yaml | grep networkProxy | awk '{print $2}'

If this outputs a URL, prefix ALL python3 commands with HTTPS_PROXY=<url> HTTP_PROXY=<url>. If using socks5, convert to socks5h for python (e.g. socks5://... → socks5h://...). If empty, no proxy needed.

Running Scripts

All scripts require setup to be completed first (see above).

Read operations — use sig run to inject cookie (enables authenticated features):

sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_video.py --cookie "$SIG_YOUTUBE_COOKIE" --video dQw4w9WgXcQ'

Write operations — require sig run (cookie is mandatory):

sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_like.py --cookie "$SIG_YOUTUBE_COOKIE" --video dQw4w9WgXcQ'

Env var: SIG_YOUTUBE_COOKIE

On auth error (401/403): run sig login youtube automatically (no user prompt), then retry.

Scripts Reference

All scripts are in this skill's scripts/ directory. Run via Bash tool.

Read Operations

ScriptPurposeAuth
youtube_video.pyVideo detailsNone
youtube_search.pySearch videosNone
youtube_channel.pyChannel info and videosNone
youtube_comments.pyVideo commentsNone
youtube_trending.pyTrending videosNone
youtube_playlist.pyPlaylist info and videosNone

Write Operations

ScriptPurposeAuth
youtube_like.pyLike/unlike a videoRequired
youtube_subscribe.pySubscribe/unsubscribeRequired

youtube_video.py

--video URL           YouTube video URL or video ID (required)

youtube_search.py

--query TEXT          Search query (required)
--limit N            Max results (default: 20)

youtube_channel.py

--channel ID         Channel ID (UCxxxx), handle (@name), or URL (required)
--limit N            Max recent videos (default: 10)

youtube_comments.py

--video URL          YouTube video URL or video ID (required)
--limit N            Max comments (default: 20)

youtube_trending.py

--limit N            Max videos (default: 20)

youtube_playlist.py

--playlist ID        Playlist URL or ID (PLxxxxxx) (required)
--limit N            Max videos (default: 50)

youtube_like.py

--cookie COOKIE      YouTube session cookie (required)
--video URL          YouTube video URL or video ID (required)
--action ACTION      Action: like, unlike (default: like)

youtube_subscribe.py

--cookie COOKIE      YouTube session cookie (required)
--channel ID         Channel ID (UCxxxx), handle (@name), or URL (required)
--action ACTION      Action: subscribe, unsubscribe (default: subscribe)

Safety

youtube_like.py and youtube_subscribe.py are reversible — use --action unlike to remove a like, --action unsubscribe to unsubscribe.

Key Concepts

Video IDs — youtube_video.py and youtube_comments.py accept: bare ID (dQw4w9WgXcQ), full URL (https://www.youtube.com/watch?v=dQw4w9WgXcQ), short link (https://youtu.be/dQw4w9WgXcQ), or shorts/embed/live URLs.

Channel IDs — Accept UCxxxx channel IDs, @handle format, or full channel URLs. Handles are resolved to channel IDs automatically.

Playlist IDs — Accept PLxxxxxx playlist IDs or full playlist URLs. The list= parameter is extracted from URLs.

InnerTube API — All operations use YouTube's InnerTube API (/youtubei/v1/), which is the same internal API the YouTube website uses. Read operations require no auth; write operations require SAPISIDHASH authentication derived from session cookies.

SAPISIDHASH Auth — Write operations compute SAPISIDHASH {timestamp}_{SHA1(timestamp + " " + SAPISID + " " + origin)} from the SAPISID cookie for the Authorization header.

Error Handling

ErrorCauseFix
HTTP_403Forbidden or rate limitedWait and retry
HTTP_404Video/channel not foundCheck the ID is correct
AUTH_REQUIREDNo cookie for write opAuto-run sig login (no user prompt needed), retry
AUTH_EXPIREDSession cookie expiredAuto-run sig login (no user prompt needed), retry
INVALID_CHANNELCannot resolve channel IDUse UCxxxx format instead of handle

Workflow Examples

Get video details

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_video.py --cookie "$SIG_YOUTUBE_COOKIE" --video dQw4w9WgXcQ'
  2. Or with URL: sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_video.py --cookie "$SIG_YOUTUBE_COOKIE" --video "https://www.youtube.com/watch?v=dQw4w9WgXcQ"'

Search for videos

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_search.py --cookie "$SIG_YOUTUBE_COOKIE" --query "python tutorial" --limit 10'

Browse a channel

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_channel.py --cookie "$SIG_YOUTUBE_COOKIE" --channel @RickAstleyYT --limit 5'
  2. Or by ID: sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_channel.py --cookie "$SIG_YOUTUBE_COOKIE" --channel UCuAXFkgsw1L7xaCfnd5JJOw'

Read video comments

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_comments.py --cookie "$SIG_YOUTUBE_COOKIE" --video dQw4w9WgXcQ --limit 30'

View trending videos

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_trending.py --cookie "$SIG_YOUTUBE_COOKIE" --limit 10'

Browse a playlist

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_playlist.py --cookie "$SIG_YOUTUBE_COOKIE" --playlist PLxxxxxxxx --limit 20'
  2. Or with URL: sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_playlist.py --cookie "$SIG_YOUTUBE_COOKIE" --playlist "https://www.youtube.com/playlist?list=PLxxxxxxxx"'

Like a video

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_like.py --cookie "$SIG_YOUTUBE_COOKIE" --video dQw4w9WgXcQ'

Unlike a video

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_like.py --cookie "$SIG_YOUTUBE_COOKIE" --video dQw4w9WgXcQ --action unlike'

Subscribe to a channel

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_subscribe.py --cookie "$SIG_YOUTUBE_COOKIE" --channel @RickAstleyYT'

Unsubscribe from a channel

  1. sig run youtube -- bash -c 'python3 <SKILL_DIR>/scripts/youtube_subscribe.py --cookie "$SIG_YOUTUBE_COOKIE" --channel UCuAXFkgsw1L7xaCfnd5JJOw --action unsubscribe'

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

bilibili

免费

Interact with Bilibili (B站) — browse trending videos, view video details, read comments, search videos and users, view user profiles, like, coin, and favorite videos. Use this skill whenever the user mentions Bilibili, B站, wants to browse Bilibili content, search Bilibili videos, read Bilibili comments, look up Bilibili users, or interact with Bilibili content. Also trigger when the user pastes a Bilibili URL (e.g. bilibili.com/video/BV...) or mentions a BV ID.

中文简介正在准备中。当前显示原文说明。

sigcli/sigcli2922026年9月28日 更新

douyin

免费

Provide authenticated cookies for Douyin (抖音/TikTok China) — two providers: douyin (www.douyin.com for scraping) and douyin-live (live.douyin.com for livestream). Use this skill whenever the user needs Douyin cookies for scraping tools like DouYin_Spider, or needs to authenticate with Douyin services. Trigger when the user mentions 抖音, Douyin, TikTok China, douyin cookies, or wants to use tools that require Douyin login cookies.

中文简介正在准备中。当前显示原文说明。

sigcli/sigcli2922026年9月28日 更新

Interact with Hacker News (news.ycombinator.com) — browse top, new, and best stories, read item details and comment threads, look up user profiles, and search posts via Algolia. Use this skill whenever the user mentions Hacker News, HN, YCombinator news, ycombinator.com, news.ycombinator.com, wants to browse tech news, read HN discussions, search HN posts, or look up HN users. Also trigger when the user pastes an HN URL (e.g. news.ycombinator.com/item?id=12345). Keywords: Hacker News, HN, YC, ycombinator, tech news, Show HN, Ask HN, HN front page.

中文简介正在准备中。当前显示原文说明。

sigcli/sigcli2922026年9月28日 更新

linkedin

免费

Interact with LinkedIn — view your profile, browse other profiles, read the feed, search jobs/posts/people, get job details, create posts, like/unlike posts, comment, send connection requests, and follow/unfollow users. Use this skill whenever the user mentions LinkedIn, wants to search for jobs or people, read their LinkedIn feed, view a profile, get job details, create a post, like or comment on content, send a connection request, or follow someone. Also trigger when the user pastes a LinkedIn URL (e.g. linkedin.com/in/..., linkedin.com/jobs/view/...) or mentions LinkedIn networking.

中文简介正在准备中。当前显示原文说明。

sigcli/sigcli2922026年9月28日 更新

msteams

免费

Interact with Microsoft Teams — send and read messages, search conversations, look up people, check calendar, get meeting transcripts, and manage chats. Use this skill whenever the user mentions Teams, MS Teams, Microsoft Teams, wants to send a message, read chat history, search conversations, look up a colleague, check their calendar, find meeting recordings or transcripts, see direct reports or manager, or do anything involving Teams communication. Also trigger when the user asks about scheduling, org chart, people search, or wants to message someone.

中文简介正在准备中。当前显示原文说明。

sigcli/sigcli2922026年9月28日 更新

outlook

免费

Interact with Outlook email — read inbox, send emails, search messages, reply/forward, manage folders, download attachments. Use this skill whenever the user mentions email, Outlook, inbox, mail, send email, check email, unread messages, email search, attachments, reply to email, forward email, 邮件, 收件箱, or wants to read, send, search, reply to, forward, or manage emails.

中文简介正在准备中。当前显示原文说明。

sigcli/sigcli2922026年9月28日 更新

查看 sigcli 的全部技能

报告此技能的问题