MelodyMine
Health Warn
- License รขโฌโ License: MIT
- Description รขโฌโ Repository has a description
- Active repo รขโฌโ Last push 3 days ago
- Low visibility รขโฌโ Only 5 GitHub stars
Code Fail
- rm -rf รขโฌโ Recursive force deletion command in scripts/audiobook_install.sh
Permissions Pass
- Permissions รขโฌโ No dangerous permissions requested
No AI report is available for this listing yet.
๐ต Download music from Bilibili, YouTube, YouTube Music, Spotify, NetEase, Kuwo, Audius & Soulseek (P2P). Multi-source metadata (MusicBrainz + NetEase + iTunes), synced lyrics, clean ID3 tags, auto cover art. AI skill (WorkBuddy / Hermes / OpenClaw) or standalone CLI.
MelodyMine
Multi-Platform Music Downloader & Metadata Engine
Search, download, and tag music from 10+ platforms โ with lossless FLAC, auto metadata, synced lyrics, and zero-config setup. One CLI to rule them all.
Highlights
| Capability | Details |
|---|---|
| 10+ Sources | Bilibili, YouTube, YouTube Music, Spotify, Soulseek P2P, Kuwo, Kugou, Audius, NetEase, SoundCloud, Bandcamp |
| Lossless Audio | FLAC / WAV / ALAC from Kuwo, Kugou, Soulseek, NetEase โ auto-detected per source |
| Smart Metadata | MusicBrainz + NetEase + iTunes multi-source lookup, cover art embedding, auto rename |
| Synced Lyrics | LRCLIB + Kuwo โ time-synced .lrc beside every track, plus lyrics-sync to backfill a whole library |
| Whole Audiobooks | Multi-part Bilibili uploads downloaded chapter by chapter into Audiobookshelf, tagged with album/artist/track number plus a Douban cover |
| Originals First | Accompaniment, cover, live and remix editions are ranked below the studio recording |
| Zero Config | Auto-detects Python runtime, installs deps, finds ffmpeg โ one setup command |
| AI-Native | Runs as a standalone CLI or as a file-based skill for AI assistants; --json on search/download |
| Stdlib-First | API clients use Python stdlib only โ minimal dependencies, maximum portability |
Supported Platforms
| Platform | Type | Auth | Lossless | Notes |
|---|---|---|---|---|
| Bilibili | Search + Download | None | Via yt-dlp | Fallback for Chinese queries; pasted video URLs download directly |
| YouTube | Search + Download | Optional | Via yt-dlp | Default for international queries; proxy support |
| YouTube Music | Search + Download | None | Via yt-dlp | Catalog search via ytmusicapi |
| Spotify | URL Download | None | Via spotDL | Paste any Spotify URL; auto-installs spotDL |
| Soulseek | P2P Search + Download | Username/Pass | Native FLAC | Multi-candidate retry; persistent session |
| Kuwo | Search + Direct Download | None | Native FLAC | Second tier for Chinese queries; CDN resolution with a first-party MP3 fallback |
| Kugou | Search + Direct Download | None | Native FLAC | First tier for Chinese queries; container sniffed from the file |
| Audius | Search + Stream | None | 320kbps MP3 | Web3 music platform; zero auth required |
| NetEase | URL Resolve + Download | None | 128kbps MP3 | CDN direct for free songs; auto fallback |
| SoundCloud | Direct Download | None | Via yt-dlp | Paste URL directly |
| Bandcamp | Direct Download | None | Via yt-dlp | Paste URL directly |
Quick Start
# One-time setup (auto-detects Python, installs deps, finds ffmpeg)
python scripts/music_helper.py setup
# Download โ just type the song name
# Chinese queries resolve from the Kugou/Kuwo CDNs (studio original, native
# FLAC, ~15s); anything else goes to Soulseek/YouTube.
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ"
python scripts/music_helper.py download "The Weeknd Blinding Lights"
# Lossless FLAC from a Chinese catalogue
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --platform kuwo --format flac
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --platform kugou --format flac
# Paste any URL โ Spotify, NetEase, YouTube, SoundCloud, Bandcamp, Bilibili
python scripts/music_helper.py download "https://open.spotify.com/track/..."
python scripts/music_helper.py download "https://music.163.com/song?id=185809"
python scripts/music_helper.py download "https://www.bilibili.com/video/BV1xx411c7XX"
Usage
Search & Download
# Search only โ see results before committing
python scripts/music_helper.py search "ๅจๆฐไผฆ ็จป้ฆ" --platform kuwo
# Pick a specific search result
python scripts/music_helper.py download "็จป้ฆ" --index 2
# Force a platform
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --platform bilibili
python scripts/music_helper.py download "Air Supply" --platform soulseek
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --platform kugou --format flac
# Format & output control
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --format mp3 --bitrate 320K
python scripts/music_helper.py download "Artist Song" --output "D:\Music"
# Proxy & cookies for restricted networks
python scripts/music_helper.py download "The Weeknd" --proxy socks5://127.0.0.1:7897
python scripts/music_helper.py download "Artist Song" --cookies "cookies.txt"
# Skip lyrics or metadata
python scripts/music_helper.py download "Song" --no-lyrics
python scripts/music_helper.py download "Song" --no-metadata
Metadata & Lyrics
# Update metadata for an existing file (multi-source lookup + cover + lyrics)
python scripts/music_helper.py meta "D:\Music\song.mp3"
python scripts/music_helper.py meta "D:\Music\song.mp3" --query "ๅจๆฐไผฆ ็จป้ฆ"
# Backfill lyrics for a whole library: writes <song>.lrc beside each track.
# Audio files are only read, never modified; existing lyrics are left alone.
python scripts/music_helper.py lyrics-sync "D:\Music"
python scripts/music_helper.py lyrics-sync "D:\Music" --dry-run # report only
python scripts/music_helper.py lyrics-sync "D:\Music" --overwrite # re-fetch
Audiobooks (multi-part Bilibili uploads)
When every part of an upload is a chapter of one book, download the whole thing
as a folder of NNNN-<chapter>.m4a files tagged with album/artist/title/track,
so a player can resume inside a 14-hour book.
# Read the part list first (the real title/author/translator live in the description, not the title)
python scripts/bili_album_probe.py BV1nFcLzaEGb probe.txt
# Download every part; set --album/--artist from the description, not the uploader handle
python scripts/bili_album_dl.py --bvid BV1nFcLzaEGb --out "D:\ab" \
--album "ไบบ็ฑป็ฎๅฒ๏ผไปๅจ็ฉๅฐไธๅธ" --artist "ๅฐค็ฆๅฐยท่ตซๆๅฉ" --strip-regex "^ๅฎๆด็๏ผ"
# Independent check: re-derives the expected names and tags from book.json, writes md5.txt / verify.txt
python scripts/bili_album_verify.py "D:\ab"
# Douban cover: choose the edition by its infobox (translator/publisher/year)
python scripts/douban_cover.py --out "D:\ab" "ไบบ็ฑป็ฎๅฒ๏ผไปๅจ็ฉๅฐไธๅธ"
Server-side installation is scripts/audiobook_install.sh โ Audiobookshelf
watches its library folder, so dropping the files in audiobooks/<title>/ is
picked up without touching the UI.
Dry Run & JSON
# Preview what would happen without downloading
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --platform kuwo --dry-run
# Machine-readable output for automation
python scripts/music_helper.py download "ๅจๆฐไผฆ ็จป้ฆ" --json
python scripts/music_helper.py search "ๅจๆฐไผฆ ็จป้ฆ" --platform kuwo --json
python scripts/music_helper.py lyrics-sync "D:\Music" --json
CLI Reference
python scripts/music_helper.py download "query" [options]
Options:
--platform {auto,bilibili,youtube,ytmusic,soulseek,kuwo,kugou,audius}
Platform to search (default: auto)
--format {auto,mp3,flac,m4a,opus,wav,vorbis}
Output format (default: auto)
--output PATH Output directory
--proxy URL Proxy URL (e.g. socks5://host:port)
--cookies PATH cookies.txt for YouTube
--bitrate RATE Audio bitrate (e.g. 320K)
--index N Search result index (1-based)
--no-thumbnail Skip cover art embedding
--no-lyrics Skip lyrics fetching
--no-metadata Skip metadata enhancement
--dry-run Preview without executing
--json Machine-readable JSON output
--debug Write session log for troubleshooting
--slsk-user USER Soulseek username (or SLSK_USERNAME env)
--slsk-pass PASS Soulseek password (or SLSK_PASSWORD env)
python scripts/music_helper.py search "query" [options]
Options:
--platform {auto,bilibili,youtube,ytmusic,soulseek,kuwo,kugou,audius}
Platform to search (default: auto)
--limit N Number of results (default: 5)
--proxy URL Proxy URL for YouTube
--json Machine-readable JSON output
python scripts/music_helper.py meta "filepath" [options]
Options:
--query QUERY Search query for metadata lookup
--no-thumbnail Skip cover art embedding
--no-lyrics Skip lyrics fetching
--json Machine-readable JSON output
python scripts/music_helper.py lyrics-sync "directory" [options]
Options:
--overwrite Re-fetch even when a .lrc already exists
--dry-run Report what would be written, write nothing
--limit N Stop after N audio files
--json Machine-readable JSON output
Platform Routing
| Input | Route | Fallback Chain |
|---|---|---|
| Chinese query | Auto โ Kugou โ Kuwo | Kugou โ Kuwo โ Soulseek โ Bilibili โ YouTube |
| English / international query | Auto โ YouTube | Soulseek โ YouTube |
--platform kuwo |
Kuwo direct | Kuwo search โ CDN โ first-party antiserver |
--platform kugou |
Kugou direct | Kugou search โ CDN download (plain HTTP: the CDN cert does not match its hosts) |
--platform audius |
Audius direct | Audius search โ stream URL, no auth |
| Spotify URL | spotDL | โ |
| NetEase URL | NetEase CDN | NetEase โ Bilibili โ YouTube |
| Bilibili URL | yt-dlp direct | That exact video, no search step |
| YouTube / SoundCloud / Bandcamp URL | yt-dlp direct | โ |
--platform soulseek |
Soulseek P2P | Soulseek โ YouTube |
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ music_helper.py โ
โ (CLI entry + platform dispatch) โ
โโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโค
โ Bilibili โ YouTube โDirect APIโ Soulseek โ NetEase โ
โ Pipelineโ Pipeline โ Pipeline โ Pipeline โ Pipeline โ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ metadata.py โ โ lyrics_clientโ โ melodymine โ โ
โ โ (MusicBrainzโ โ LRCLIB + Kuwoโ โ _common.py โ โ
โ โ + NetEase + โ โ synced .lrc โ โ (Python/venv/ โ โ
โ โ iTunes + โ โ plain lyrics โ โ pip/ffmpeg) โ โ
โ โ cover art) โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โbili_ โ โkuwo/kugouโ โaudius_ โ โnetease_ โ โ
โ โclient.py โ โclient.py โ โclient.py โ โclient.py โ โ
โ โ(WBI API) โ โ(CDN API) โ โ(Audius โ โ(CDN URL) โ โ
โ โ โ โ โ โ REST API)โ โ โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โytmusic_ โ โsoulseek_ โ โmbrainz_ โ โcover_ โ โ
โ โclient.py โ โclient.py โ โclient.py โ โclient.py โ โ
โ โ(ytmusic- โ โ(aioslsk โ โ(Music- โ โ(URLโfile) โ โ
โ โ api) โ โ P2P) โ โ Brainz) โ โ โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The Direct API pipeline is shared by Kuwo, Kugou and Audius: search โ resolve a CDN/stream URL โ download โ sniff the container from its magic bytes โ convert โ tag. No yt-dlp is involved.
AI Skill Integration
Drop MelodyMine into any AI assistant's skill directory:
| Platform | Path |
|---|---|
| WorkBuddy | ~/.workbuddy/skills/melodymine/ |
| OpenClaw | ~/.openclaw/workspace/skills/melodymine/ |
| Hermes | ~/.hermes/skills/melodymine/ |
Then just ask naturally:
ไธ่ฝฝๅจๆฐไผฆ็็จป้ฆ๏ผ่ฆๆ ๆ้ณ่ดจ
Download Blinding Lights by The Weeknd
ไธ่ฝฝ่ฟไธช Spotify ้พๆฅ https://open.spotify.com/track/...
Testing
# Run all 391 tests
python -m pytest tests/ -v
# Run a specific test module
python -m unittest tests.test_new_clients -v
File Structure
MelodyMine/
โโโ scripts/
โ โโโ music_helper.py # CLI entry + platform dispatch + download pipelines
โ โโโ melodymine_common.py # Shared infra: Python/venv/pip/ffmpeg/proxy detection
โ โโโ metadata.py # Multi-source metadata (MusicBrainz + NetEase + iTunes)
โ โโโ spotify_helper.py # Advanced spotDL operations (playlist sync, URL resolve)
โ โโโ bili_client.py # Bilibili WBI API search (stdlib only)
โ โโโ kuwo_client.py # Kuwo Music search + CDN download URL + lyrics (stdlib only)
โ โโโ audius_client.py # Audius Web3 music search + stream (stdlib only)
โ โโโ kugou_client.py # Kugou Music search + download (stdlib only)
โ โโโ netease_client.py # NetEase Cloud Music API (stdlib only)
โ โโโ ytmusic_client.py # YouTube Music API search (ytmusicapi)
โ โโโ soulseek_client.py # Soulseek P2P search/download (aioslsk)
โ โโโ lyrics_client.py # LRCLIB + Kuwo lyrics โ synced + plain (stdlib only)
โ โโโ mbrainz_client.py # MusicBrainz metadata lookup (stdlib only)
โ โโโ cover_client.py # Cover art downloader (stdlib only)
โโโ tests/ # 391 unit tests (stdlib unittest + mocked HTTP)
โโโ .github/workflows/ci.yml # GitHub Actions CI (ruff + pytest)
โโโ SKILL.md # AI assistant skill definition
โโโ references/ # spotDL CLI & config reference docs
Disclaimer
MelodyMine is for personal learning and archival use only. Downloading copyrighted audio may be illegal in your jurisdiction. Do not distribute, share, or monetize downloaded files. You are solely responsible for complying with your local laws and the terms of service of each platform.
This project does not host, store, or transmit any copyrighted content, does not bypass DRM, and is not affiliated with or endorsed by any of the mentioned platforms.
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found