1

I have a fews of songs in a folder which I would like to add the metadata items of artist, title, genre and album to. I would like to take the metadata info for the title and artist from the file name itself.

For Example: I have a song file named Melvv - Glide.mp3. I would like to take the name of the artist Melvv and the title of the song Glide from the file name and add it as MetaData. For the Album and Genre, I'll add this in myself.

  1. Is there a way I can do this in the Linux environment via bash or python?
  2. Is there a way this can be done in the Windows environment?

3 Answers3

2

I do something like this, although I'm not adding in the same information (all I'm adding is album art.)

You need the package eyeD3.

For my particular use, I use the following command line (I incorporate it into a bash script, you could certainly use python):

eyeD3 --genre= --to-v2.3 --no-tagging-time-frame --remove-comments --add-image=$BASEPATH/$RELPATH/folder.jpg:OTHER:folder.jpg $SONG.mp3"

Here I'm removing any existing genre setting, making sure the format is ID3v2.3, removing comments, and adding album art. I've previously ensured that the source directory of every album contains a file called folder.jpg which contains the album art. eyeD3 supports all the metadata you want at the command line, you can customize it all you like.

for i in *.mp3; do
  SONG=`basename "$i" .mp3`
  ARTIST=`echo "$SONG" | awk -F " - " '{print $1}'`
  TITLE=`echo "$SONG" | awk -F " - " '{print $2}'`
  eyeD3 --artist "$ARTIST" --title "$TITLE" "$SONG.mp3"
done
nnsense
  • 103
unkilbeeg
  • 466
0

On Windows you can use Mp3tag: free, batch process, and tagging following the filename.

enter image description here

Franck Dernoncourt
  • 24,246
  • 64
  • 231
  • 400
0

This is typical work I used to do using Foobar2000. Works good enough under Wine.

Open the files into Foobar2000, open the context menu and look for "Tagging", "Manage Scripts". Then look for action "Guess values from filenames".

As guessing pattern took something like "%artist%\%album%\%tracknumber% - %title%", if for exmaple your files (named with number, space, dash, space, and title) are in folders for each album which themselves are in folders for each artist.

Giacomo1968
  • 58,727
Peter
  • 76