← 返回 Skills 市场
45
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install accompaniment-generator
功能描述
从 YouTube 或本地音频文件分离人声和伴奏,生成纯伴奏音乐。当用户需要提取伴奏、消除人声、制作卡拉OK版音频时使用。支持三种模式:(1) 歌名+歌手搜索 YouTube 下载后分离,(2) 直接提供视频 URL,(3) 处理本地音频文件。
使用说明 (SKILL.md)
伴奏生成器 (Accompaniment Generator)
概述
从歌曲中分离人声,输出纯伴奏音乐。核心流程:获取音频 → Demucs AI 分离人声/伴奏 → 输出 MP3。
核心脚本
scripts/get_accompaniment.py
四种使用模式
# 1. 搜索 YouTube + 下载 + 分离
python3 scripts/get_accompaniment.py "歌名" "歌手名"
# 2. 直接提供视频 URL
python3 scripts/get_accompaniment.py --url "https://youtube.com/watch?v=xxx"
# 3. 处理本地音频文件
python3 scripts/get_accompaniment.py --file /path/to/song.mp3
# 4. 带 cookies(免 YouTube bot 验证)
python3 scripts/get_accompaniment.py "歌名" "歌手" --cookies cookies.txt
输出
输出到 ~/accompaniment_output/ 目录,包含:
{歌名}_伴奏.mp3— 纯伴奏(已消除人声){歌名}_人声.mp3— 仅人声(可选)
参数说明
| 参数 | 说明 |
|---|---|
song artist |
歌名和歌手(搜索用) |
--url |
直接指定视频 URL |
--file (-f) |
处理本地音频文件 |
--output (-o) |
输出目录 |
--cookies |
YouTube cookies 文件路径 |
--json |
JSON 格式输出(供 agent 解析) |
工作流程
获取音频
YouTube 搜索 + 下载:
- 用网页抓取 YouTube 搜索结果(无需 cookies)
- 选择第一个匹配结果
- 用
yt-dlp下载音频(mp3,192kbps)
⚠️ 当前 YouTube 对未认证请求做 bot 限制。首次使用需提供 cookies:
- Chrome 安装扩展 "Get cookies.txt LOCALLY"
- 访问 youtube.com 登录后导出 cookies.txt
- 放入
~/.yt-dlp/cookies.txt或运行时--cookies指定
本地文件: 直接传入文件路径,跳过下载。
AI 分离
使用 Demucs(htdemucs 模型)分离人声和伴奏:
--two-stems vocals:分离为 vocals + no_vocals- 输出 MP3 192kbps
依赖安装
# yt-dlp(YouTube 下载)
pip install yt-dlp
# Demucs(AI 人声分离,建议在虚拟环境中安装)
pip install demucs
# ffmpeg(格式转换)
# Ubuntu/Debian: sudo apt install ffmpeg
# macOS: brew install ffmpeg
# Deno(JS 运行时,可选,用于 YouTube 签名解算)
# curl -fsSL https://deno.land/install.sh | sh
Agent 集成
使用 --json 参数获取结构化输出,便于自动化调用:
{"success": true, "song": "晴天", "accompaniment": "/path/to/伴奏.mp3", "vocals": "/path/to/人声.mp3", "accompaniment_size_mb": 7.3}
安全使用建议
Before installing, decide whether you are comfortable giving the skill access to YouTube/Google session cookies. Prefer running it in a virtual environment or sandbox, avoid primary-account cookies, and review or disable the remote GitHub component behavior if you do not need it.
功能分析
Type: OpenClaw Skill
Name: accompaniment-generator
Version: 1.0.0
The skill provides legitimate audio separation functionality but employs high-risk execution patterns. Specifically, `scripts/get_accompaniment.py` invokes `yt-dlp` with the `--remote-components ejs:github` flag, which allows the tool to fetch and execute remote code from GitHub. The script also requests sensitive YouTube session cookies for authentication and utilizes external runtimes (Deno) for signature decryption. While these features are often used to bypass YouTube's bot detection, they represent a significant attack surface for remote code execution and credential handling.
能力评估
Purpose & Capability
The visible artifacts are broadly coherent with the stated goal of downloading or processing audio and separating vocals/accompaniment.
Instruction Scope
The workflow supports use of exported YouTube cookies, including a default persistent cookies file, which is high-impact account/session access.
Install Mechanism
The skill has no install spec but the script invokes yt-dlp with a remote GitHub component setting, creating a runtime provenance gap.
Credentials
Network access, local file conversion, and output under ~/accompaniment_output are expected for this audio-processing purpose.
Persistence & Privilege
The skill does not show background persistence, but it can reuse a persistent ~/.yt-dlp/cookies.txt session file if present.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install accompaniment-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/accompaniment-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Accompaniment Generator 1.0.0 初始发布
- 支持从 YouTube 或本地音频文件分离人声与伴奏,生成纯伴奏 MP3。
- 提供四种使用方式:歌名+歌手检索、视频 URL、本地文件、带 cookies 下载。
- 采用 Demucs AI 人声分离,输出伴奏和可选人声文件。
- 输出目录集中管理,支持 JSON 格式结构化返回,方便自动化集成。
- 提供详细依赖安装与 YouTube cookies 获取指引。
元数据
常见问题
伴奏提取器 是什么?
从 YouTube 或本地音频文件分离人声和伴奏,生成纯伴奏音乐。当用户需要提取伴奏、消除人声、制作卡拉OK版音频时使用。支持三种模式:(1) 歌名+歌手搜索 YouTube 下载后分离,(2) 直接提供视频 URL,(3) 处理本地音频文件。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 45 次。
如何安装 伴奏提取器?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install accompaniment-generator」即可一键安装,无需额外配置。
伴奏提取器 是免费的吗?
是的,伴奏提取器 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
伴奏提取器 支持哪些平台?
伴奏提取器 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 伴奏提取器?
由 GuoGe(@gycdsj)开发并维护,当前版本 v1.0.0。
推荐 Skills