Ubuntu – Download lastfm tags into mp3 comment or genre tag


for a long time I dream to have a songs lastfm tags in my music library, so I can use them to quickly generate playlists.

There used to be a way to do that in amarok 1.4, but it never was stable.

Than there is MusicBrainz Picard's lastfm/lastfmplus plugin. It is partially fine, but I cannot manage to make it look ONLY for the lastfm tags and put them into comments/genre/whatever but it always hast to tag everything. And it isn't particularly good with it, especially with small bands, songs without album etc.

My music library is rather well organised. Most of the tags are correct. I also have quite some songs without an album. And I don't want it to find the albums for those songs, since it'd mess up my album view. So it must not touch the fields track name, track number, artist and album. All I want is that the most popular lastfm tags get into the genre or comments tag of the mp3, separated by semicolons, commas or whatever.

I think I remember a script that did this job, but I cannot find.

Does anybody know if there is anything like this? Would it be to hard to write this, for example as Banshee plugin?

Thank you

Best Answer

I cooked one Python script quickly. You can review it here: http://db.tt/yGa14ZA or download from here: http://db.tt/Rnkhpod

As I understand your library is in MP3 format, so I used ID3 tagger. Script fetches last.fm top-tags and puts them in COMMENT tag.
If you ask me, although "TopTags" are more meaningful then "TrackTags" they can consist lots of garbage

Script uses Standard Python Library, except for module that writes tags - eyeD3 (sudo apt-get install python-eyed3)

Example usage (parse all files in current folder):

$ for f in *.mp3 ; do python lastfm_top-tags.py "$f" ; done

Similar bash line can crawl through all subfolders also.

Hope it's useful :)

Related Question