Scripts to fetch release data from DistroKid and adding metadata to the music files, like title, artist, album, genre, etc.
DistroKid does not export these metadata to the music files, when exporting your music from their Vault. This script fetches the metadata from the DistroKid API and adds it to the music files. You will then have a organized music library with metadata to import into your favorite music player.
- Fetches release metadata from DistroKid API
- Creates directory structure for each album
- Exports to JSON with album info and artwork URLs
- Converts WAV files to FLAC format
- Downloads album artwork
- Renames FLAC files to match folder names
- Imports tags into FLAC files using kid3
jqfor JSON processingkid3-clifor FLAC tag editing (see https://kid3.kde.org)curlfor downloading artworkflacCLI tools for WAV to FLAC conversion (see https://xiph.org/flac/download.html)
-
Install dependencies:
go get
You need to install the
flacCLI tool from https://xiph.org/flac/download.html -
Get your DistroKid JWT token:
- Log into your DistroKid account in a browser
- Open Developer Tools
- Go to the Network tab
- Navigate to any page on DistroKid
- Find any HTTP request and check the
Authorizationheader - Copy the JWT token value
- Update
jwtTokenconstant inmain.go
-
Update genre in
main.go:- Edit the
genrevariable (line 44) to match your music genre
- Edit the
-
Update the music directory path:
- Edit
musicDirconstant inmain.go - Edit
MUSIC_DIRinprepare.sh - Edit
MUSIC_DIRinimport.sh
- Edit
⚠️ Disclaimer:
Before running these scripts, make sure to backup your existing music files and directories. While care has been taken to avoid data loss, operations like converting, renaming, or moving files could cause accidental overwrites or deletions if files already exist or there is a script failure. Always keep backups of the downloaded music files until you have verified everything works as expected.
-
Fetch releases: Run the Go program to generate
releases.jsonand create directoriesgo run main.go
This will:
- Fetch release metadata from DistroKid
- Create directories for each album (
MUSIC_DIR/Album Title/) - Generate
releases.jsonwith release data
-
Download audio files: Download .wav files from DistroKid UI and place them directly into the created album directories (e.g.,
MUSIC_DIR/Album Title/) -
Prepare files: Convert WAV to FLAC, download artwork, and rename FLAC files
./prepare.sh
This script will:
- Convert all .wav files to .flac format (requires
flacCLI tool) - Download artwork to
cover.jpgin each directory - Rename FLAC files to match folder names
- Convert all .wav files to .flac format (requires
-
Import tags: Import metadata into FLAC files
./import.sh