cd2flac

Convert CD audio archives (RAR files containing WAV+CUE pairs) into organized FLAC files. Handles RAR extraction, CUE-based track splitting, GBK encoding fix for Chinese filenames, multi-CD album organization, and auto-fetch synced lyrics from Netease Cloud Music (with Kugou fallback). Use whenever someone needs to extract and convert CD-quality audio archives (WAV+CUE in RAR/7z/ZIP) to per-track FLAC files. Also handles direct WAV+CUE pairs without archives.

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 "cd2flac" with this command: npx skills add hanshojin/cd2flac

CD to FLAC Converter

Tool to extract CD audio from RAR archives and convert WAV+CUE pairs into individual FLAC tracks with correct names and synced lyrics.

Requirements

  • System packages: unrar, cuetools, shntool, flac
  • Install: sudo apt-get install -y unrar cuetools shntool flac

Python dependencies

  • mutagen (FLAC tag handling)
  • pycryptodome (Netease API encryption)
  • Install: pip3 install mutagen pycryptodome

Usage

python3 skills/cd2flac/scripts/cd2flac.py <directory> [options]

Basic — process RAR archives in a directory

python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/"

With synced lyrics (Netease + Kugou)

python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/" --lyrics

Inject lyrics into already converted FLACs (no conversion)

python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/" --lyrics-only

Standalone lyric injector (for any FLAC directory)

python3 skills/cd2flac/scripts/lyric.py "/path/to/album/"
python3 skills/cd2flac/scripts/lyric.py "/path/to/track.flac"

Dry run — preview without changes

python3 skills/cd2flac/scripts/cd2flac.py "/path/to/albums/" --dry-run

Keep WAV/CUE, delete RAR after extraction

python3 skills/cd2flac/scripts/cd2flac.py "/path/" --keep-wav --delete-rar

Process subdirectories recursively

python3 skills/cd2flac/scripts/cd2flac.py "/path/" --recursive --lyrics

Process already-extracted WAV+CUE pairs (no RAR)

python3 skills/cd2flac/scripts/cd2flac.py "/path/to/album_with_wav/"

What It Does

  1. Extract: Unpacks RAR archives in the target directory
  2. Parse CUE: Reads CUE sheets in GBK/GB18030/UTF-8 encoding, extracts track titles
  3. Split: Uses shnsplit to split each WAV into individual FLAC tracks
  4. Fix names: Renames garbled tracks (CUE files in Chinese encodings produce mojibake filenames) using correct track titles from the CUE sheet
  5. Organize: Multi-CD albums get CD1/, CD2/, etc. subdirectories
  6. Lyrics: Auto-fetch synced lyrics from Netease Cloud Music (primary) and Kugou (fallback), inject as FLAC LYRICS tag with translation support
  7. Clean up: Deletes original WAV and CUE files (optional: keep them)

Lyric Injection

Lyrics are fetched using the same strategy as ESLyric:

  • Primary: Netease Cloud Music via linuxapi (AES-ECB encryption, no login needed)
  • Fallback: Kugou Music

Synced LRC is embedded as Vorbis comment LYRICS tag. If Netease provides translation lyrics, they go in LYRICS_TRANSLATIONS tag.

Common Scenarios

Chinese album with garbled filenames

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.

Multi-CD albums

If a directory contains multiple WAV+CUE pairs, they are treated as separate discs and placed into CD1/, CD2/, etc. subdirectories.

Already extracted albums

If the RAR is already extracted but not yet converted, the script detects the WAV+CUE pairs and processes them directly.

Add lyrics to an existing FLAC library

find /path/to/music -name "*.flac" -exec dirname {} \; | sort -u | \
  xargs -I{} python3 skills/cd2flac/scripts/lyric.py "{}"

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

Chinese Bedtime Story Generator

生成多角色中文睡前故事并合成语音。适用于用户想为孩子定制个性化睡前故事的场景:根据孩子姓名、年龄和兴趣,由 LLM 创建完整世界观和角色,生成分段故事文本(每段标注说话人),再由 TTS 以不同音色合成旁白、主角、小伙伴和长者的语音,最终拼接为完整 MP3 音频文件。支持连载模式(`--continue`)在多次...

Registry SourceRecently Updated
2931Profile unavailable
General

Pinyin Converter

Convert Chinese text to Pinyin (拼音). 中文转拼音工具,支持声调标记、去声调、首字母大写。适合语言学习、输入法开发、中文处理。Chinese to Pinyin converter with tone marks.

Registry SourceRecently Updated
560Profile unavailable
General

music-downloader

支持从1000+音乐平台下载音频、封面、元数据及歌词,自动选择最佳音质并嵌入封面。

Registry SourceRecently Updated
850Profile unavailable
General

Metal Lyrics

Generate authentic metal lyrics across subgenres (death metal, black metal, power metal, doom metal, gothic metal, industrial metal, metalcore, nu metal, alt...

Registry SourceRecently Updated
960Profile unavailable