Music Management Scripts

All your music automation scripts in one place. Copy, download, and run them directly.

Scanning & Indexing

Music File Scanner (Full Scan)

Python

Initial scan of your music directory. Scans all music files and imports metadata into MongoDB. Use this for the first scan or complete rebuild.

Requires:Python 3pymongomutagen

Install dependencies:

pip3 install pymongo mutagen

Usage:

python3 music_scanner.py

Music File Scanner (Sync Mode)

Python

Fast incremental sync. Only processes new, modified, or deleted files. Use this for daily updates after initial scan. Much faster than full scan.

Requires:Python 3pymongomutagen

Install dependencies:

pip3 install pymongo mutagen

Usage:

python3 music_scanner_sync.py

Music File Scanner

Python

Scans your music directory and imports all metadata into MongoDB. Used to populate the My Music database.

Requires:Python 3pymongomutagen

Install dependencies:

pip3 install pymongo mutagen

Usage:

python3 music_scanner.py

Tag Management

Remove ID3 Tags (Auto-Generated)

Bash

Remove album, genre, or title tags from selected music files. Generated automatically from My Music page based on your filters.

Requires:id3v2 (MP3)AtomicParsley (M4A/AAC)metaflac (FLAC)

Install dependencies:

brew install id3v2 atomicparsley flac

Usage:

Generated via "Generate Tag Cleanup" button in My Music

Organization

Rename ALAC Folders

Python

Finds folders containing predominantly ALAC files (.m4a) that have "FLAC" in their name and renames them to use "ALAC" instead. Shows preview before renaming.

Requires:Python 3

Usage:

python3 rename_alac_folders.py [path] [min_percentage]

Find FLAC-Only Folders

Python

Scans your music library and returns folder paths that contain ONLY FLAC files (no MP3, M4A, etc. mixed in)

Requires:Python 3

Usage:

python3 find_flac_folders.py [optional_path]

Import & Export

Add to Apple Music (Auto-Generated)

Bash + AppleScript

Bulk import selected files into Apple Music using AppleScript. Generated automatically from My Music page.

Requires:macOSApple Music app

Usage:

Generated via "Add to Apple Music" button in My Music

Quick Tips

  • • Make scripts executable: chmod +x script.py
  • • Run Python scripts: python3 script.py
  • • Run Bash scripts: ./script.sh
  • • Install Homebrew (if needed): /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"