Download music from YouTube/YouTube Music and stream to Chromecast via Home Assistant. Complete CLI toolset with web server integration, configuration wizard, and playback controls.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install ytm-cast或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install ytm-cast⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/ytm-cast/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: youtube-music-cast description: Download music from YouTube/YouTube Music and stream to Chromecast via Home Assistant. Complete CLI toolset with web server integration, configuration wizard, and playback controls. version: "6.0.0" author: Wobo license: MIT homepage: https://github.com/clawdbot/skills repository: https://github.com/clawdbot/skills/tree/main/youtube-music-cast user-invocable: true triggers: - play music - cast to chromecast - youtube music - download music - cast music keywords: - youtube - music - chromecast - home-assistant - cast - media-player - streaming - yt-dlp - google-cast - audio - mp3 - free-music category: media requires: bins: - yt-dlp - python3 - curl - jq env: [] config: stateDirs: - ~/.youtube-music-cast metadata: clawdbot: emoji: "🎵"
---
YouTube music → your Chromecast. Simple, free, works.
Download audio from YouTube or YouTube Music and stream it through Home Assistant to any Cast-enabled device. No subscriptions, no cloud services, just your local network.
Download your favorite tracks in the morning, cast them throughout the day. No waiting, no buffering.
Download a playlist before guests arrive, then queue up songs without fumbling with phones or apps.
Play ambient music or podcasts while you work without worrying about ads or interruptions.
Stream the same track to multiple Chromecasts simultaneously (bedroom + living room + kitchen).
| Feature | YouTube Music Cast | Spotify Premium | YouTube Premium | |---------|-------------------|------------------|------------------| | Cost | Free forever | $10.99/month | $13.99/month | | Quality | 320K MP3 | Up to 320K | Up to 1080p video | | Offline | Yes, forever | Download limit | Download limit | | Ads | None | None | None | | Platforms | Any Chromecast | Spotify Connect devices | YouTube apps | | Privacy | Local only | Cloud-based | Cloud-based |
# 1. Setup (one time, takes 2 minutes)
cast-setup
# 2. Download your first song
cast-download https://youtube.com/watch?v=dQw4w9WgXcQ
# 3. Start the web server
cast-server start
# 4. Cast it to your default device
cast-play never-gonna-give-you-up.mp3
That's it. Your music is playing through your Chromecast.
Three simple steps, one command each:
yt-dlp grabs audio from YouTube or YouTube Music, extracts it as MP3 (320K quality).
A lightweight Python HTTP server makes your downloaded files accessible over your local network. No setup required — just Python 3.
Home Assistant's media_player.play_media service sends the HTTP URL to your Chromecast, which streams the audio.
Home Assistant's play_media service requires a URL, not a file path. The web server bridges that gap.
# ✅ This works — HA can fetch via HTTP
media_content_id: "http://192.168.1.81:8735/song.mp3"
# ❌ This fails — HA can't read file paths
media_content_id: "/tmp/youtube-music/song.mp3"
Architecture:
YouTube URL → yt-dlp → MP3 file → Python HTTP server → Home Assistant API → Chromecast
yt-dlp, Python 3, curl, jq# Clone or download the skill
cd youtube-music-cast
# Make all scripts executable
chmod +x scripts/*
# Install globally (recommended)
./install.sh --global
# Or install locally
./install.sh
cast-setup
The wizard will ask for:
http://homeassistant.local:8123media_player.bedroom_display# Download a test song
cast-download https://youtube.com/watch?v=dQw4w9WgXcQ
# Start the server
cast-server start
# Cast it
cast-play song.mp3
If music plays, you're ready!
| Command | Description | Example | |---------|-------------|----------| | cast-setup | Run configuration wizard | cast-setup | | cast-download | Download from YouTube/YouTube Music | cast-download https://youtube.com/watch?v=... --video | | cast-radio | Start radio mode with related songs | cast-radio https://youtube.com/watch?v=... --count 10 | | cast-server [start|stop|status] | Manage HTTP server | cast-server start | | cast-play | Cast music or video file to device | cast-play song.mp4 | | cast-stop [device] | Stop playback | cast-stop | | cast-status [device] | Show player status | cast-status | | cast-devices | List all available media players | cast-devices | | cast-list | List downloaded files | cast-list | | cast-help | Show help | cast-help |
# Download from YouTube
cast-download https://youtube.com/watch?v=dQw4w9WgXcQ
# Rename for cleaner URL (recommended)
mv "/tmp/youtube-music/Rick Astley - Never Gonna Give You Up.mp3" \
"/tmp/youtube-music/never-gonna-give-you-up.mp3"
# Start the web server
cast-server start
# Cast to your default device
cast-play never-gonna-give-you-up.mp3
# Living room TV
cast-play song.mp3 media_player.living_room
# Kitchen speaker
cast-play song.mp3 media_player.kitchen_speaker
# Bedroom Chromecast
cast-play song.mp3 media_player.bedroom_display
# Multiple rooms at once (run multiple commands)
cast-play song.mp3 media_player.living_room & \
cast-play song.mp3 media_player.bedroom_display
# Default device
cast-status
# Specific device
cast-status media_player.bedroom_display
Output:
📺 media_player.bedroom_display
State: playing
Friendly Name: Bedroom display
Volume: 22%
Now Playing:
Title: Never Gonna Give You Up
Artist: Rick Astley
Duration: 3:32
App: Default Media Receiver
# Stop default device
cast-stop
# Stop specific device
cast-stop media_player.living_room
# List all music files with sizes
cast-list
Output:
🎵 Downloaded Music
boneheads-bank-holiday.mp3 9.3M
never-gonna-give-you-up.mp3 8.2M
song-for-nary.mp3 7.8M
Total: 3 files
cast-devices
Output:
📺 Available Media Players
media_player.bedroom_display
Name: Bedroom display
State: idle
Supported: play_media, volume_set, volume_mute, ...
media_player.living_room
Name: Living room TV
State: off
Supported: play_media, volume_set, ...
Default device: media_player.bedroom_display
Radio mode automatically discovers and downloads related songs based on YouTube recommendations. After downloading a seed song, it searches for similar tracks and adds them to your queue.
...
安装 YouTube Music Cast 后,可以对 AI 说这些话来触发它
Help me get started with YouTube Music Cast
Explains what YouTube Music Cast does, walks through the setup, and runs a quick demo based on your current project
Use YouTube Music Cast to download music from YouTube/YouTube Music and stream to Chromecast ...
Invokes YouTube Music Cast with the right parameters and returns the result directly in the conversation
What can I do with YouTube Music Cast in my design & creative workflow?
Lists the top use cases for YouTube Music Cast, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/ytm-cast/ 目录(个人级,所有项目可用),或 .claude/skills/ytm-cast/(项目级)。重启 AI 客户端后,用 /ytm-cast 主动调用,或让 AI 根据上下文自动发现并使用。
YouTube Music Cast 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
YouTube Music Cast 可免费安装使用。请查阅仓库了解许可证信息。
Download music from YouTube/YouTube Music and stream to Chromecast via Home Assistant. Complete CLI toolset with web server integration, configuration wizard, and playback controls.
YouTube Music Cast 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my design & creative tasks using YouTube Music Cast
Identifies repetitive steps in your workflow and sets up YouTube Music Cast to handle them automatically