Tool to extract CD audio from RAR archives and convert WAV+CUE pairs into individual FLAC tracks with correct names and synced lyrics.
unrar, cuetools, shntool, flacsudo apt-get install -y unrar cuetools shntool flacmutagen (FLAC tag handling)pycryptodome (Netease API encryption)pip3 install mutagen pycryptodomebash
python3 skills/cd2flac/scripts/cd2flac.py <directory> [options]
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/"
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/" --lyrics
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/" --lyrics-only
bash
python3 skills/cd2flac/scripts/lyric.py "/path/to/album/"
python3 skills/cd2flac/scripts/lyric.py "/path/to/track.flac"
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/" --dry-run
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/" --keep-wav --delete-rar
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/" --recursive --lyrics
bash
python3 skills/cd2flac/scripts/cd2flac.py "/path/to/album_with_wav/"
shnsplit to split each WAV into individual FLAC tracksCD1/, CD2/, etc. subdirectoriesLyrics are fetched using the same strategy as ESLyric:
Synced LRC is embedded as Vorbis comment LYRICS tag. If Netease provides
translation lyrics, they go in LYRICS_TRANSLATIONS tag.
The script auto-detects and fixes GBK→UTF-8 mojibake in track names by comparing the actual filename bytes against the CUE sheet's GBK-encoded titles.
If a directory contains multiple WAV+CUE pairs, they are treated as separate
discs and placed into CD1/, CD2/, etc. subdirectories.
If the RAR is already extracted but not yet converted, the script detects the WAV+CUE pairs and processes them directly.
bash
find /path/to/music -name "*.flac" -exec dirname {} \; | sort -u | \
xargs -I{} python3 skills/cd2flac/scripts/lyric.py "{}"