accompaniment-generator

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

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "accompaniment-generator" with this command: npx skills add gycdsj/accompaniment-generator

伴奏生成器 (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)输出目录
--cookiesYouTube cookies 文件路径
--jsonJSON 格式输出(供 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}

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

小红书登录

小红书 MCP 登录流程。当用户需要登录小红书、小红书登录过期、或需要获取小红书登录二维码时使用此 skill。

Registry SourceRecently Updated
General

Send Email Tool

邮件发送工具。配置 SMTP 发件人后,通过脚本发送纯文本或 HTML 邮件,支持附件、抄送、密送。在需要发送邮件通知、报告、自动化邮件时触发。

Registry SourceRecently Updated
General

Chat Refiner

Refine conversation history by deleting useless/redundant/process exchanges. Keep explicit instructions, disciplines, important configs, skills learned (how)...

Registry SourceRecently Updated
General

Auto Publisher

Multi-platform video auto-publisher. Automatically upload videos to Douyin, WeChat Channels, Xiaohongshu, Bilibili, YouTube and more. Supports batch publishi...

Registry SourceRecently Updated