Last active
April 15, 2023 04:22
-
-
Save infojunkie/d8c2bf6221fcd661c2253df3d4938298 to your computer and use it in GitHub Desktop.
Discogs artists to flac metatag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Requirements: curl, jq, metaflac | |
# | |
# Assumes that the files are already sorted by track number. | |
# | |
curl -s https://api.discogs.com/releases/$1 --user-agent "discogs-tag/1.0" | jq -r '.tracklist[].artists | map(.name) | join(", ") | gsub(" \\(\\d+\\)"; "")' > artists | |
IFS=$'\n' artists=($(<artists)) i=0; for f in *.flac; do metaflac "$f" --remove-tag=ARTIST --set-tag="ARTIST=${artists[$i]}"; ((i=i+1)); done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment