AgentSkillsCN

youtube-get-channel-latest

从YouTube频道获取最新视频、直播、短视频或播客。

SKILL.md
--- frontmatter
name: youtube-get-channel-latest
description: Get latest videos, livestreams, shorts, or podcasts from a YouTube channel
license: MIT
metadata:
  version: 1.0.0
  author: kouko
  tags:
    - youtube
    - channel
    - videos
    - livestream
    - shorts
    - podcast
compatibility:
  claude-code: ">=1.0.0"

YouTube Channel Latest Content

Get the latest content from a YouTube channel with type filtering.

Quick Start

code
/youtube-get-channel-latest <channel> [limit] [type]

Parameters

ParameterRequiredDefaultDescription
channelYes-Channel URL, @handle, username, or video URL
limitNo10Number of items (1-50)
typeNoallContent type filter

Type Options

TypeTab URLDescription
allAll tabsFetches from /videos, /shorts, /streams, /podcasts and merges by date
videos/videosRegular videos
live/streamsLivestreams (current, past, upcoming)
shorts/shortsYouTube Shorts
podcasts/podcastsPodcast episodes

Examples

  • /youtube-get-channel-latest @GoogleDevelopers - Latest 10 items from channel
  • /youtube-get-channel-latest @MKBHD 5 videos - Latest 5 regular videos
  • /youtube-get-channel-latest @NASA 10 live - Latest 10 livestreams
  • /youtube-get-channel-latest @shorts 20 shorts - Latest 20 shorts
  • /youtube-get-channel-latest https://www.youtube.com/@TED 3 podcasts - Latest 3 podcast episodes
  • /youtube-get-channel-latest https://www.youtube.com/watch?v=xxx 5 - Get latest from video's channel
  • /youtube-get-channel-latest https://youtu.be/xxx 5 shorts - Get shorts from video's channel

How it Works

  1. Parse channel parameter (URL, @handle, username, or video URL)
  2. If video URL: extract channel URL using yt-dlp
  3. Normalize to channel base URL
  4. Execute: {baseDir}/scripts/channel-latest.sh "<channel>" <limit> <type>
  5. For specific types: fetch from corresponding tab URL
  6. For all type: fetch from all 4 tabs, deduplicate, sort by upload_date, return top N
  7. Return JSON array of content items

Output Format

Success:

json
[
  {
    "id": "dQw4w9WgXcQ",
    "title": "Video Title",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "duration_string": "3:32",
    "view_count": 1500000000,
    "upload_date": "20091025",
    "channel": "Rick Astley",
    "live_status": "not_live",
    "description": "First 200 chars of description..."
  }
]

Error:

json
{
  "status": "error",
  "message": "No content found for this channel"
}

Output Fields

FieldTypeDescription
idstringYouTube video ID
titlestringVideo title
urlstringFull YouTube URL
duration_stringstringHuman-readable duration (e.g., "10:23")
view_countnumberView count (may be null for upcoming)
upload_datestringUpload date in YYYYMMDD format
channelstringChannel name
live_statusstringStatus: not_live, is_live, was_live, is_upcoming
descriptionstringFirst 200 characters of description

Notes

  • Auto-downloads yt-dlp and jq on first run
  • Supports video URL input: automatically extracts channel and fetches latest content
  • Uses YouTube's official tab classification for each content type
  • all type fetches from 4 tabs, deduplicates, and sorts by upload date
  • Live status values: not_live, is_live, was_live, is_upcoming
  • Podcasts require the channel to have a podcasts tab enabled
  • For channels without specific content types, returns empty array