Munager is a music library management helper that have several functions:
- Automatically search for lyric files on online services like Netease Music, etc.
- Syncs your music library between devices with customizable transcoding rules.
If you wanna compile yourself, just clone this project and run go build .
.
If you just want to run the binary, find it in Releases
or Github Actions Artifacts
for CI Build.
Munager is quite self-explained. Use --help
for explainations.
Type munager lyric
for help. It have several subcommand which does:
query
Querys lyric for given keyword.fetch
Fetches lyrics for every songs in provided path.
Type munager sync
for help. It have several subcommands which does:
client
Starts a client. It can automatically discover server side and syncs local music library with server side. You can also transcode your received songs to another format (FFmpeg) using--transcode
flag.server
Starts a server. It broadcasts its existance to local network, and serves local music library as you expected.
Now you have an folder which contains some songs:
THE BOOK
โโโ 01. Epilogue.flac
โโโ 02. ใขใณใณใผใซ.flac
โโโ 03. ใใซใธใชใณ.flac
โโโ 04. ใใฎๅคขใใชใใฃใฆ.flac
โโโ 05. ใใถใ.flac
โโโ 06. ็พค้.flac
โโโ 07. ใใซใซ.flac
โโโ 08. ๅคใซ้งใใ.flac
โโโ 09. Prologue.flac
โโโ cover.png
1 directory, 10 files
To fetch lyric for it, just run
$ munager lyric fetch --path="./THE BOOK/"
2023-07-14 09:43:53 [I] Found 9 songs without lyrics
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| (9/9, 7 it/s)
2023-07-14 09:43:55 [I] Done!
Then you should see some .lrc
files in your sweet folder.
THE BOOK
โโโ 01. Epilogue.flac
โโโ 01. Epilogue.lrc
โโโ 02. ใขใณใณใผใซ.flac
โโโ 02. ใขใณใณใผใซ.lrc
โโโ 03. ใใซใธใชใณ.flac
โโโ 03. ใใซใธใชใณ.lrc
โโโ 04. ใใฎๅคขใใชใใฃใฆ.flac
โโโ 04. ใใฎๅคขใใชใใฃใฆ.lrc
โโโ 05. ใใถใ.flac
โโโ 05. ใใถใ.lrc
โโโ 06. ็พค้.flac
โโโ 06. ็พค้.lrc
โโโ 07. ใใซใซ.flac
โโโ 07. ใใซใซ.lrc
โโโ 08. ๅคใซ้งใใ.flac
โโโ 08. ๅคใซ้งใใ.lrc
โโโ 09. Prologue.flac
โโโ 09. Prologue.lrc
โโโ cover.png
1 directory, 19 files
Imagine you have two devices which contains music library that is not synced.
server
โโโ THE BOOK
โโโ 01. Epilogue.flac
โโโ 01. Epilogue.lrc
โโโ 02. ใขใณใณใผใซ.flac
โโโ 02. ใขใณใณใผใซ.lrc
โโโ 03. ใใซใธใชใณ.flac
โโโ 03. ใใซใธใชใณ.lrc
โโโ 04. ใใฎๅคขใใชใใฃใฆ.flac
โโโ 04. ใใฎๅคขใใชใใฃใฆ.lrc
โโโ 05. ใใถใ.flac
โโโ 05. ใใถใ.lrc
โโโ 06. ็พค้.flac
โโโ 06. ็พค้.lrc
โโโ 07. ใใซใซ.flac
โโโ 07. ใใซใซ.lrc
> โโโ 08. ๅคใซ้งใใ.flac
> โโโ 08. ๅคใซ้งใใ.lrc
> โโโ 09. Prologue.flac
> โโโ 09. Prologue.lrc
โโโ cover.png
client
โโโ THE BOOK
โโโ 01. Epilogue.flac
โโโ 01. Epilogue.lrc
โโโ 02. ใขใณใณใผใซ.flac
โโโ 02. ใขใณใณใผใซ.lrc
โโโ 03. ใใซใธใชใณ.flac
โโโ 03. ใใซใธใชใณ.lrc
โโโ 04. ใใฎๅคขใใชใใฃใฆ.flac
โโโ 04. ใใฎๅคขใใชใใฃใฆ.lrc
โโโ 05. ใใถใ.flac
โโโ 05. ใใถใ.lrc
โโโ 06. ็พค้.flac
โโโ 06. ็พค้.lrc
โโโ 07. ใใซใซ.flac
โโโ 07. ใใซใซ.lrc
โโโ cover.png
4 directories, 34 files
On server side, just run munager sync server
, and on client side, just run munager sync client
. After they do their stuff, the music library should be synced.
Adding a --transcode
flag can also achieve this:
server
โโโ THE BOOK
โโโ 01. Epilogue.flac
โโโ 02. ใขใณใณใผใซ.flac
โโโ 03. ใใซใธใชใณ.flac
โโโ 04. ใใฎๅคขใใชใใฃใฆ.flac
โโโ 05. ใใถใ.flac
โโโ 06. ็พค้.flac
โโโ 07. ใใซใซ.flac
โโโ 08. ๅคใซ้งใใ.flac
โโโ 09. Prologue.flac
โโโ cover.png
client
โโโ THE BOOK
โโโ 01. Epilogue.opus
โโโ 02. ใขใณใณใผใซ.opus
โโโ 03. ใใซใธใชใณ.opus
โโโ 04. ใใฎๅคขใใชใใฃใฆ.opus
โโโ 05. ใใถใ.opus
โโโ 06. ็พค้.opus
โโโ 07. ใใซใซ.opus
โโโ 08. ๅคใซ้งใใ.opus
โโโ 09. Prologue.opus
โโโ cover.png
4 directories, 20 files
- Netease API is somehow encrypted, I took some code from mxget for reference.