$npx -y skills add AlexAI-MCP/hermes-CCC --skill youtube-contentYouTube research and content operations — search, download, transcript extraction, and audio processing via yt-dlp.
| 1 | # YouTube Content |
| 2 | |
| 3 | Download videos, extract transcripts, process audio, and research YouTube content with yt-dlp. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | ```bash |
| 8 | pip install yt-dlp |
| 9 | # or |
| 10 | brew install yt-dlp |
| 11 | ``` |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Download Video |
| 16 | |
| 17 | ```bash |
| 18 | # Default best quality |
| 19 | yt-dlp "https://www.youtube.com/watch?v=VIDEO_ID" |
| 20 | |
| 21 | # Best video + audio |
| 22 | yt-dlp -f "bestvideo+bestaudio" "URL" |
| 23 | |
| 24 | # Specific resolution |
| 25 | yt-dlp -f "bestvideo[height<=720]+bestaudio" "URL" |
| 26 | |
| 27 | # List available formats first |
| 28 | yt-dlp -F "URL" |
| 29 | ``` |
| 30 | |
| 31 | --- |
| 32 | |
| 33 | ## Audio Only |
| 34 | |
| 35 | ```bash |
| 36 | # MP3 |
| 37 | yt-dlp -x --audio-format mp3 "URL" |
| 38 | |
| 39 | # Best audio quality |
| 40 | yt-dlp -x --audio-quality 0 "URL" |
| 41 | |
| 42 | # WAV for transcription |
| 43 | yt-dlp -x --audio-format wav "URL" |
| 44 | ``` |
| 45 | |
| 46 | --- |
| 47 | |
| 48 | ## Transcripts / Subtitles |
| 49 | |
| 50 | ```bash |
| 51 | # Download auto-generated subtitles (no video) |
| 52 | yt-dlp --write-auto-sub --skip-download --sub-lang en "URL" |
| 53 | |
| 54 | # Download manual subtitles |
| 55 | yt-dlp --write-sub --sub-lang en,ko --skip-download "URL" |
| 56 | |
| 57 | # Convert to readable text |
| 58 | yt-dlp --write-auto-sub --skip-download --sub-lang en \ |
| 59 | --convert-subs srt "URL" |
| 60 | |
| 61 | # List available subtitle languages |
| 62 | yt-dlp --list-subs "URL" |
| 63 | ``` |
| 64 | |
| 65 | Parse SRT to plain text: |
| 66 | ```python |
| 67 | import re |
| 68 | |
| 69 | with open("video.en.srt") as f: |
| 70 | content = f.read() |
| 71 | |
| 72 | # Remove timestamps and indices |
| 73 | text = re.sub(r'\d+\n\d{2}:\d{2}:\d{2}.*?\n', '', content) |
| 74 | text = re.sub(r'\n{2,}', '\n', text).strip() |
| 75 | print(text) |
| 76 | ``` |
| 77 | |
| 78 | --- |
| 79 | |
| 80 | ## Output Naming |
| 81 | |
| 82 | ```bash |
| 83 | # Custom filename |
| 84 | yt-dlp -o "%(title)s.%(ext)s" "URL" |
| 85 | |
| 86 | # With date |
| 87 | yt-dlp -o "%(upload_date)s-%(title)s.%(ext)s" "URL" |
| 88 | |
| 89 | # Into subdirectory |
| 90 | yt-dlp -o "downloads/%(uploader)s/%(title)s.%(ext)s" "URL" |
| 91 | ``` |
| 92 | |
| 93 | --- |
| 94 | |
| 95 | ## Playlists and Channels |
| 96 | |
| 97 | ```bash |
| 98 | # Full playlist |
| 99 | yt-dlp "https://www.youtube.com/playlist?list=PLAYLIST_ID" |
| 100 | |
| 101 | # Channel (recent 20) |
| 102 | yt-dlp --playlist-end 20 "https://www.youtube.com/@channelname" |
| 103 | |
| 104 | # Skip already downloaded |
| 105 | yt-dlp --download-archive downloaded.txt "PLAYLIST_URL" |
| 106 | ``` |
| 107 | |
| 108 | --- |
| 109 | |
| 110 | ## Thumbnails and Metadata |
| 111 | |
| 112 | ```bash |
| 113 | # Download thumbnail only |
| 114 | yt-dlp --write-thumbnail --skip-download "URL" |
| 115 | |
| 116 | # Write metadata JSON |
| 117 | yt-dlp --write-info-json --skip-download "URL" |
| 118 | |
| 119 | # Embed thumbnail in audio file |
| 120 | yt-dlp -x --audio-format mp3 --embed-thumbnail "URL" |
| 121 | ``` |
| 122 | |
| 123 | --- |
| 124 | |
| 125 | ## Rate Limiting (Be Polite) |
| 126 | |
| 127 | ```bash |
| 128 | # Limit download speed |
| 129 | yt-dlp --rate-limit 1M "URL" |
| 130 | |
| 131 | # Add sleep between downloads |
| 132 | yt-dlp --sleep-interval 3 --max-sleep-interval 10 "PLAYLIST_URL" |
| 133 | |
| 134 | # Use cookies (for age-restricted / logged-in content) |
| 135 | yt-dlp --cookies-from-browser chrome "URL" |
| 136 | ``` |
| 137 | |
| 138 | --- |
| 139 | |
| 140 | ## Extract Info Without Downloading |
| 141 | |
| 142 | ```python |
| 143 | import yt_dlp |
| 144 | |
| 145 | ydl_opts = {"quiet": True} |
| 146 | with yt_dlp.YoutubeDL(ydl_opts) as ydl: |
| 147 | info = ydl.extract_info("URL", download=False) |
| 148 | print(info["title"]) |
| 149 | print(info["description"]) |
| 150 | print(info["duration"]) # seconds |
| 151 | print(info["view_count"]) |
| 152 | print(info["upload_date"]) |
| 153 | ``` |
| 154 | |
| 155 | --- |
| 156 | |
| 157 | ## YouTube Data API v3 (Search) |
| 158 | |
| 159 | Requires API key from Google Cloud Console: |
| 160 | |
| 161 | ```python |
| 162 | import requests |
| 163 | |
| 164 | API_KEY = "your-youtube-api-key" |
| 165 | query = "machine learning tutorial" |
| 166 | |
| 167 | resp = requests.get( |
| 168 | "https://www.googleapis.com/youtube/v3/search", |
| 169 | params={ |
| 170 | "key": API_KEY, |
| 171 | "q": query, |
| 172 | "part": "snippet", |
| 173 | "type": "video", |
| 174 | "maxResults": 10, |
| 175 | "order": "relevance", |
| 176 | } |
| 177 | ) |
| 178 | |
| 179 | for item in resp.json()["items"]: |
| 180 | print(item["id"]["videoId"], item["snippet"]["title"]) |
| 181 | ``` |
| 182 | |
| 183 | --- |
| 184 | |
| 185 | ## Transcript → Summary Workflow |
| 186 | |
| 187 | ```bash |
| 188 | # 1. Download transcript |
| 189 | yt-dlp --write-auto-sub --skip-download --sub-lang en --convert-subs srt "URL" |
| 190 | |
| 191 | # 2. Parse to plain text (see above) |
| 192 | |
| 193 | # 3. Ask Claude to summarize |
| 194 | # "Summarize this transcript: <text>" |
| 195 | ``` |