← Back to Skills Marketplace
gycdsj

伴奏提取器

by GuoGe · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
45
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install accompaniment-generator
Description
从 YouTube 或本地音频文件分离人声和伴奏,生成纯伴奏音乐。当用户需要提取伴奏、消除人声、制作卡拉OK版音频时使用。支持三种模式:(1) 歌名+歌手搜索 YouTube 下载后分离,(2) 直接提供视频 URL,(3) 处理本地音频文件。
README (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 搜索 + 下载:

  1. 用网页抓取 YouTube 搜索结果(无需 cookies)
  2. 选择第一个匹配结果
  3. 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}
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install accompaniment-generator
  3. After installation, invoke the skill by name or use /accompaniment-generator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Accompaniment Generator 1.0.0 初始发布 - 支持从 YouTube 或本地音频文件分离人声与伴奏,生成纯伴奏 MP3。 - 提供四种使用方式:歌名+歌手检索、视频 URL、本地文件、带 cookies 下载。 - 采用 Demucs AI 人声分离,输出伴奏和可选人声文件。 - 输出目录集中管理,支持 JSON 格式结构化返回,方便自动化集成。 - 提供详细依赖安装与 YouTube cookies 获取指引。
Metadata
Slug accompaniment-generator
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 伴奏提取器?

从 YouTube 或本地音频文件分离人声和伴奏,生成纯伴奏音乐。当用户需要提取伴奏、消除人声、制作卡拉OK版音频时使用。支持三种模式:(1) 歌名+歌手搜索 YouTube 下载后分离,(2) 直接提供视频 URL,(3) 处理本地音频文件。 It is an AI Agent Skill for Claude Code / OpenClaw, with 45 downloads so far.

How do I install 伴奏提取器?

Run "/install accompaniment-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 伴奏提取器 free?

Yes, 伴奏提取器 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 伴奏提取器 support?

伴奏提取器 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 伴奏提取器?

It is built and maintained by GuoGe (@gycdsj); the current version is v1.0.0.

💬 Comments