Skip to content

About

Automate adding metadata to music files exported from DistroKid Vault. Fetches release data, converts WAV to FLAC, downloads artwork, and tags files.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DistroKid Scripts

Scripts to fetch release data from DistroKid and adding metadata to the music files, like title, artist, album, genre, etc.

Why?

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.

What it does

  • 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

Requirements

Setup

  1. Install dependencies:

    go get

    You need to install the flac CLI tool from https://xiph.org/flac/download.html

  2. 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 Authorization header
    • Copy the JWT token value
    • Update jwtToken constant in main.go
  3. Update genre in main.go:

    • Edit the genre variable (line 44) to match your music genre
  4. Update the music directory path:

    • Edit musicDir constant in main.go
    • Edit MUSIC_DIR in prepare.sh
    • Edit MUSIC_DIR in import.sh

Usage Order

⚠️ 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.

  1. Fetch releases: Run the Go program to generate releases.json and create directories

    go run main.go

    This will:

    • Fetch release metadata from DistroKid
    • Create directories for each album (MUSIC_DIR/Album Title/)
    • Generate releases.json with release data
  2. Download audio files: Download .wav files from DistroKid UI and place them directly into the created album directories (e.g., MUSIC_DIR/Album Title/)

  3. 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 flac CLI tool)
    • Download artwork to cover.jpg in each directory
    • Rename FLAC files to match folder names
  4. Import tags: Import metadata into FLAC files

    ./import.sh

About

Automate adding metadata to music files exported from DistroKid Vault. Fetches release data, converts WAV to FLAC, downloads artwork, and tags files.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages