← 返回
未分类 中文

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...
将包含 WAV+CUE 对的 RAR 音频压缩包转换为结构化的 FLAC 文件,支持 RAR 解压、CUE 分割轨道、GBK编码修复等功能。
hanshojin hanshojin 来源
未分类 clawhub v1.3.1 2 版本 99783.1 Key: 无需
★ 0
Stars
📥 460
下载
💾 0
安装
2
版本
#audio#chinese#converter#cue#flac#latest#lyrics#music#netease#wav

概述

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 "{}"

版本历史

共 2 个版本

  • v1.3.1 当前
    2026-05-29 20:58 安全 安全
  • v1.2.1
    2026-05-07 23:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

Openai Whisper

steipete
使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)
★ 329 📥 93,063
design-media

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 426 📥 116,286
life-service

Xiaoya Download

hanshojin
搜索并从小雅 Alist 下载电影/剧集到本地目录。输入电影或剧集名称,通过小雅搜索接口查找,选择结果后下载到本地。安全修复 v1.3.2:强化路径穿越防护,使用 pathlib.relative_to() 做严格 containment
★ 1 📥 524