Just a Bunch Of Music Library Scripts
A collection of Python scripts for maintaining and organizing music libraries. These tools help with cleanup, transcoding, metadata management, and library maintenance tasks.
- Python 3.6+
- ffmpeg (must be installed and available in PATH)
- Dependencies listed in
requirements.txt:ffmpeg-pythonfiletypemutagen(for FLAC metadata editing)
- Clone or download this repository
- Install dependencies:
pip install -r requirements.txt
- Ensure
ffmpegis installed and accessible from your command line
Removes directories that contain only a single image file (typically orphaned cover art directories).
Usage:
python cleanup_orphan_dirs.py -p /path/to/music/libraryExample: The following directory would be deleted:
/Music/Talk Talk/[1991] Laughing Stock/
└── cover.jpg
The following directory would not be deleted (contains audio files):
/Music/Talk Talk/[1982] The Party's Over/
├── cover.jpg
├── 01 Talk Talk.flac
├── 02 It's So Serious.flac
└── ...
Finds album directories (at depth 1: library/artist/album) that don't contain audio files. Checks for audio files with a specific pattern (looking for '01 ' in filenames). If an album directory doesn't contain matching audio files, it will offer to delete the directory.
Usage:
python cleanup_orphan_dirs_v2.py -p /path/to/music/libraryAn improved version of the orphan directory cleanup script. Uses the filetype library to properly detect audio files and recursively checks subdirectories for any music files. If an album directory (at depth 1: library/artist/album) has no music files anywhere within it, it will offer to delete the directory. More reliable than v2 as it uses proper audio file detection rather than filename pattern matching.
Usage:
python cleanup_orphan_dirs_v3.py -p /path/to/music/libraryFinds and deletes numbered cover art files (e.g., cover.1.jpg, cover.2.png) from a directory structure. Recursively searches through all subdirectories and matches files with the pattern cover.N.jpg or cover.N.png where N is any integer >= 1. The script will display all matching files and prompt for user confirmation before deletion.
Usage:
python delete_numbered_covers.py -p /path/to/music/libraryExample: The following files would be deleted:
/Music/Radiohead/[1997] OK Computer/
├── cover.jpg
├── cover.1.jpg ← deleted
├── cover.2.jpg ← deleted
└── cover.3.png ← deleted
Note: Only files matching cover.N.jpg or cover.N.png where N >= 1 will be deleted. Files like cover.jpg or cover.0.jpg are not affected.
Transcodes FLAC files in a directory to MP3 format. Supports both 320kbps and V0 quality settings.
Usage:
python flac_to_lame.py -p /path/to/flac/directory -t 320 v0Options:
-p, --path: Path to directory containing FLAC files-t, --transcodes: Transcode options - choose320(320kbps),v0(V0 quality), or both
Note: Creates subdirectories mp3_320/ and/or mp3_v0/ in the source directory.
Transcodes lossless audio files (FLAC, WAV, MKA) to CD quality FLAC (16-bit, 44.1kHz).
Usage:
python hifi_to_cdq.py -p /path/to/audio/directoryNote: Creates a transcode/ subdirectory in the source directory with the converted files.
Recursively transcodes lossless audio files (FLAC, WAV) throughout a directory structure and rebuilds the original folder structure at the destination. Converts to ALAC format by default.
Usage:
python recursive_transcode.py -p /path/to/source -o /path/to/destinationOptions:
-p, --path: Source directory to transcode-o, --output_path: Destination directory for transcoded files
Updates RELEASETYPE metadata tags in FLAC files to the format required by Plex/Plexamp. Plex/Plexamp requires specific formatting for release types to properly categorize albums.
Usage:
python plexamp_release_type.py -p /path/to/music/libraryExample: A file with release type "Live" will be updated to "album;live" so it appears under Plex/Plexamp's Live Albums grouping.
Supported Release Types:
| Original Release Type | Updated Release Type |
|---|---|
| live | album;live |
| compilation | album;compilation |
| remix | album;remix |
| mixtape | album;mixtape |
| soundtrack | album;soundtrack |
Renames folder.jpg files to cover.jpg throughout a directory structure. Useful for standardizing cover art filenames in your music library.
Usage:
python folder_to_cover.py -p /path/to/music/libraryReports album directories (those with "[" in the path, indicating album naming convention) that don't have a cover.jpg file. Prints out the paths of directories missing cover art.
Usage:
python no_cover.py -p /path/to/music/libraryScans a music library and reports on lossless albums (at depth 1: library/artist/album) that do not have a log file in the album directory. Useful for identifying albums that may be missing EAC/ripping logs.
Usage:
python non_log_flacs.py -p /path/to/music/libraryExample: The following directory would show up in the report (no log file):
/Music/Radiohead/[1997] Karma Police (Single)/
├── cover.jpg
└── 01 Karma Police.flac
The following directory would not show up (has log file):
/Music/Radiohead/[1997] Karma Police (Single)/
├── cover.jpg
├── 01 Karma Police.flac
└── Karma Police.log
Contributions are welcome! Feel free to submit issues, improvements, or new scripts.