开发者

Getting specific fields from ID3 tags using command line tool?

开发者 https://www.devze.com 2023-02-01 13:51 出处:网络
I\'m looking for a way that would let me get specific fields from ID3 tags from mp3 files. All tools I have so far found return all fields, and they also format them for \"easier reading\". I nee开发

I'm looking for a way that would let me get specific fields from ID3 tags from mp3 files.

All tools I have so far found return all fields, and they also format them for "easier reading". I nee开发者_Go百科d just some fields, and formatted differently (artist\talbum\ttitle\n) for reporting purposes.

Is there any such tool? I would love tool that would let me output separately values from ID3v1 and ID3v2.


id3v2 -R sounds like it does what you want. Debian package name is id3v2, upstream is http://id3v2.sourceforge.net/

From the manpage:

   -R, --list-rfc822
          Lists using an rfc822-style format for output

Example:

$ id3v2 -R 365-Days-Project-04-26-sprinkle-leland-w-the-great-stalacpipe-organ.mp3 

Filename: 365-Days-Project-04-26-sprinkle-leland-w-the-great-stalacpipe-organ.mp3
TALB: Released independently through Luray Caverns
TPE1: Leland W. Sprinkle
TIT2: The Great Stalacpipe Organ
COMM: ()[eng]: � 2004, Copyright resides with the artist, The 365 Days Project,  and UbuWeb (http://ubu.com) / PennSound (http://www.writing.upenn.edu/pennsound/). All materials at UbuWeb / PennSound are available for free exchange for noncommerical purposes.
365-Days-Project-04-26-sprinkle-leland-w-the-great-stalacpipe-organ.mp3: No ID3v1 tag


The easiest way is creating a bash script.

grep the fields returned by your tool so you get just the ones you want. Then you use awk (if you know how to use it), or cut, etc.

If you give us the format used by one of the tools you found, we can help you to write it. The more simple the format is, the more simple the script will be.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号