DJ MP3 Sourcer
DJ-oriented music downloading skill. Takes any music link and finds the best available source, prioritizing extended mixes and MP3 320k output.
⚠️ Legal Notice: This skill is intended for downloading music you have the right to access — purchases, free releases, creative commons, etc. Respect copyright laws in your jurisdiction. The author is not responsible for misuse.
Dependencies
CODEBLOCK0
Source Priority
Search in this order — stop at the first match:
- 1. Bandcamp — supports artists directly, often has extended mixes
- Beatport — DJ-standard, has BPM/key metadata, extended mixes
- Amazon Music — digital purchase option
- Spotify (via
spotdl) — good metadata/tagging, 320k MP3 - YouTube (via
yt-dlp) — fallback, always works
For paid sources (bandcamp, beatport, amazon), surface the purchase link with price. For free sources, download directly.
If free only mode is enabled, skip steps 1-3 and go straight to spotdl → yt-dlp.
Core Rule: Prefer Extended Mixes
Always prefer the extended mix over radio edits. An extended mix from a lower-priority source beats a radio edit from a higher-priority one.
Example: extended mix on YouTube > radio edit on Spotify.
When searching, append "extended mix" to queries. If only a radio edit exists, note it in the output.
Workflow
- 1. Identify the track — extract artist + title:
yt-dlp --dump-json "<url>" | jq '{title, artist: .artist // .uploader, duration}'
- 2. Search each source using web_search:
"<artist> <title> extended mix site:bandcamp.com"
"<artist> <title> extended mix site:beatport.com"
"<artist> <title> site:amazon.com/music"
- 3. Download or link — free sources download; paid sources return purchase URL with price
- Tag the file — artist, title, album, cover art. Note BPM/key if available from beatport.
Download Commands
spotdl
CODEBLOCK3
yt-dlp
CODEBLOCK4
Post-Download: Filename Normalization
yt-dlp filenames are often messy (NA - prefixes, (Official Video) suffixes, label names, wrong artist credits). Always run the normalization script after downloads complete.
Usage:
CODEBLOCK5
The script fuzzy-matches each mp3 in the directory to a tracklist entry and renames to clean Artist - Title.mp3 format. Unmatched files are left untouched.
The tracklist is the source of truth for filenames, not YouTube metadata.
Configuration
| Setting | Default | Notes |
|---|
| Output directory | INLINECODE5 | Where files are saved (subfolder per set when used with dj-set-ripper) |
| Format |
mp3 320k | High-bitrate MP3; configurable to flac if needed |
| Extended mix | always | Prefer extended/original mix over radio edit |
| Free only | false | When true, skip paid sources (bandcamp, beatport, amazon) — only use spotdl and yt-dlp |
Batch Processing
When given multiple links, process in parallel using sub-agents (sessions_spawn). Report results as each track completes.
Edge Cases
- - DJ mixes / long sets — download via yt-dlp directly, skip source searching
- Unavailable tracks — report clearly, suggest alternatives if found
- Region-locked content — note restriction, try alternative sources
- Remix vs original — if the link is a specific remix, search for that exact remix, not the original
DJ MP3 源获取器
面向DJ的音乐下载技能。接收任意音乐链接,寻找最佳可用来源,优先选择加长混音版和MP3 320k输出。
⚠️ 法律声明: 此技能仅用于下载您有权访问的音乐——包括已购买内容、免费发布作品、创作共用许可等。请遵守您所在地区的版权法律。作者不对滥用行为负责。
依赖项
bash
pip install yt-dlp spotdl
brew install ffmpeg # yt-dlp提取音频所需
可选
pip install bandcamp-dl # 用于免费bandcamp下载
来源优先级
按以下顺序搜索——在第一个匹配项处停止:
- 1. Bandcamp —— 直接支持艺术家,通常有加长混音版
- Beatport —— DJ标准平台,包含BPM/调性元数据,加长混音版
- Amazon Music —— 数字购买选项
- Spotify(通过spotdl)—— 良好的元数据/标签,320k MP3
- YouTube(通过yt-dlp)—— 备用方案,始终可用
对于付费来源(bandcamp、beatport、amazon),显示带价格的购买链接。对于免费来源,直接下载。
如果启用了仅免费模式,则跳过步骤1-3,直接使用spotdl → yt-dlp。
核心规则:优先选择加长混音版
始终优先选择加长混音版而非电台剪辑版。 来自较低优先级来源的加长混音版优于来自较高优先级来源的电台剪辑版。
示例:YouTube上的加长混音版 > Spotify上的电台剪辑版。
搜索时,在查询词后追加extended mix。如果只有电台剪辑版可用,则在输出中注明。
工作流程
- 1. 识别曲目 —— 提取艺术家+标题:
bash
yt-dlp --dump-json
| jq {title, artist: .artist // .uploader, duration}
- 2. 使用web_search搜索每个来源:
<艺术家> <标题> extended mix site:bandcamp.com
<艺术家> <标题> extended mix site:beatport.com
<艺术家> <标题> site:amazon.com/music
- 3. 下载或提供链接 —— 免费来源直接下载;付费来源返回带价格的购买URL
- 标记文件 —— 艺术家、标题、专辑、封面图。如果来自beatport,记录BPM/调性信息。
下载命令
spotdl
bash
spotdl download --output {artist} - {title} --format mp3 --bitrate 320k
yt-dlp
bash
yt-dlp -x --audio-format mp3 --audio-quality 0 \
--embed-thumbnail --add-metadata \
--metadata-from-title %(artist)s - %(title)s \
-o %(artist)s - %(title)s.%(ext)s
下载后处理:文件名规范化
yt-dlp生成的文件名通常很混乱(包含NA -前缀、(Official Video)后缀、厂牌名称、错误的艺术家署名等)。始终在下载完成后运行规范化脚本。
使用方法:
bash
1. 将曲目列表写入JSON(来自步骤2中解析的曲目列表)
cat > /tmp/tracklist.json << EOF
[{artist: Karol G, title: Ivonny Bonita}, {artist: Doja Cat, title: Woman (Never Dulls Disco Rework)}]
EOF
2. 运行规范化脚本
scripts/normalize-filenames.sh ~/Downloads/set-name /tmp/tracklist.json
该脚本会将目录中的每个mp3文件与曲目列表条目进行模糊匹配,并重命名为干净的艺术家 - 标题.mp3格式。未匹配的文件保持不变。
文件名以曲目列表为准,而非YouTube元数据。
配置选项
| 设置项 | 默认值 | 说明 |
|---|
| 输出目录 | ~/Downloads/ | 文件保存位置(与dj-set-ripper配合使用时,每个曲集保存到子文件夹) |
| 格式 |
mp3 320k | 高比特率MP3;可按需配置为flac |
| 加长混音版 | 始终 | 优先选择加长/原始混音版而非电台剪辑版 |
| 仅免费 | false | 启用时跳过付费来源(bandcamp、beatport、amazon)——仅使用spotdl和yt-dlp |
批量处理
当提供多个链接时,使用子代理(sessions_spawn)并行处理。每首曲目完成后报告结果。
边界情况
- - DJ混音/长串烧 —— 直接通过yt-dlp下载,跳过来源搜索
- 不可用的曲目 —— 清晰报告,如果找到替代方案则提供建议
- 地区限制内容 —— 注明限制,尝试其他来源
- 混音版与原始版 —— 如果链接指向特定混音版,搜索该确切混音版,而非原始版本