A CLI tool for bulk editing audio file metadata.
git clone https://github.com/sitenee/metadator.git
cd metadator
pip install -r requirements.txtor by using venv (recommended)
git clone https://github.com/sitenee/metadator.git
cd metadator
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtgit clone https://github.com/sitenee/metadator.git
cd metadator
pip install -r requirements.txtor by using venv (recommended)
git clone https://github.com/sitenee/metadator.git
cd metadator
python -m venv venv
venv\Scripts\Activate.ps1
pip install -r requirements.txtYou can also check simplified usage instructions with :
metadator -hPATH specifies where operations are performed. Metadator accepts both folders and files as PATH. If left empty, works in current working directory. When working in folder, script finds all suitable music files, and perform chosen operation on all files.
metadator -p "music-folder" -mgThis line prints all tags values for all files in "music-folder". PATH also accepts muliple values at once, like this :
metadator -p "music-folder", "Poles 1469.mp3" -mgThat line will print all tags both for files from "music-folder", and file "Poles 1469.mp3".
You can use -n to perform any action, in selected folder and all it's subfolders.
metadator -p "music-folder" -mg -nThis line will print all tags for all files in "music-folder", and all it's subfolders.
In given tree :
music-all/
├── Rap
│ ├── Artist 1
│ └── Artist 2
│ ├── Album 1
│ └── Ep 1
└── Jazz
├── Artist 1
└── Artist 2Assuming that current working directory is "music-all", line :
metadator -mw -f "artist" -v "Frank Sinatra" -nWould change value of tag "artist" in every file, in every folder above, to "Frank Sinatra".
This variables works different depending on which mode is in use. In some modes you can use only part of those variables. Check what exatly those variables do in exact modes in descriptions below.
metadator operates in modes [ -m ]: get, write, replace, search empty
allows use of -c or -f, not both
-c- getscoverof file-f- pick field toget value
Without passing any arguments, metadator prints all found tag values in specified files :
metadator -mgIn this case for all files in current working directory.
With -c you can get cover of file/files and save it to file :
metadator -p "I Try.mp3" -mg -c "i_try_cover"Line above will get cover of "I Try.mp3", and save it to file with correct extenstion, in this case "i_try_cover.jpg".
With -f you can get values for specific tag
metadator -mg -f "artist"This can be usefull to compare values between files, or/and check if the tag value is not empty.
-c- overwrites cover, othervariablescan't be used with-c-f- decides whichtagto overwrite-v- value that will be put intotag
With -c you can set covers :
metadator -p "Poles 1469.mp3" -mw -c "cover.jpg"Line above will set "cover.jpg" as "Poles 1469.mp3" cover (also work for whole folders). If file/files have suitable cover, but in wrong aspect ratio, you can use -c [crop], to crop cover to square (at center), as in line below :
metadator -p "Love Scars.mp3" -mw -c [crop]Besides writing covers, this mode writes value to tags :
metadator -mw -f "artist" -v "Kanye West"Line above changes value of tag "artist", to "Kanye West", in all music files found in current working directory.
Write mode, also allows you to copy values from tag to tag, by using [tagname] :
metadator -mw -f "albumartist" -v [artist]Line above would copy value from tag "artist", to tag "albumartist" for each separate file found in current working directory. If in this path would be 2 files with values :
- "Limitless.mp3" -> artist: "Trippie Redd", albumartist: empty
- "blow it.mp3" -> artist: "UncleBac", albumartist: empty
Tag values would change to :
- "Limitless.mp3" -> artist: "Trippie Redd", albumartist: "Trippie Redd"
- "blow it.mp3" -> artist: "UncleBac", albumartist: "UncleBac"
-f- picktagin which toreplace string-v- statesvalueto be raplaced with
This mode allows you to replace some part of string value in selected tag. For example. If downloaded file has value of "artist" tag like this :
|
| | artist: Lil Tecca | Trippie Redd
|
But Navidrome expect format "Artst1; Artist2" for handling multiple artists, you can execute line :
metadator -mr -f "artist" -v " | " "; "Which will replace substring " | " with "; ", changing value of tag "artist" to :
|
| | artist: Lil Tecca; Trippie Redd
|
allows only -f variable
This mode searches for files with empty specified tags, giving you the list of paths.
For example, if mode get used like this :
metadator -mgSearched through all files in current working directory and found, that part of files, have tag "artist" with empty value, you can execute :
metadator -ms -f "artist"Which will return list of paths like :
/home/user/music/song1.mp3
/home/user/music/song4.mp3