Last.Fm Genre Tagger

Amarok 1.x Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
Fetches artist tags from last.fm and uses the most popular as genre id3tag for current playing song

Dependencies
ruby
ruby-taglib
kdialog (kdebase on my distro)

kdialog is not required to run
Last changelog:

If anyone has pointers on how to rescan single files in the collection database, I would be glad to hear them.

Known Issues:
Amarok database isn't updated before a collection rescan
Script crashes on wma files (who wants to use those anyway)

0.3.3:
Blacklist is now configurable from the configure menu.
If you don't have kdialog installed then edit the file manually at ~/.kde/share/apps/amarok/script-data/genre-tagger.csv

0.3.2:
Genre information is now capitalized

0.3.1:
Fixed bug which caused script to exit if title contains illegal characters

Fixed bug which didn't allow the script to try fallback data on fail.


0.3.0:
Implemented a very basic blacklist functionality. Must be updated manually in lastfm_genre.rb on line 68

Script now defaults to title search with fallback on album, and artist. default search priority must be set in lines 43 - 48


0.2.0:
Don't crash if connection to last.fm fails

Possibility to select between artist,album and title for tag search. NOTE: No gui option yet. Change it manually on lines 45-47 in lastfm_genre.rb


0.1.1:
Fixed bug caused by spaces in URL


Ratings & Comments

20 Comments

cyreald69

hey there, do you think it's possible to tag not only songs you are playing, but all collection at once? maybe through command-line? because if i listen to one song from an album, i get it updated but the others are not... great script though! thanks!

Ark

Hey! First of all, GREAT SCRIPT! ^ ^ But I notice than the genre its added to the ID3tag, but not in the amarok database. The thing its than if I'm go to the song info, the genre it's changed. It show the new genre fetched by the script, but in the genre column in the track list, or in the inteligent track lists by genre....it's the same at before using it. I'm doing something grong? It's there some trick to update the all the info at once?

Nyarlathotep

Finally got this script to work on OpenSuse 10.3 after installing ruby-taglib and taglib-devel. Problem now is, that it seems to take just any tag from last.fm instead of the most popular one. For instance the band SOiL got the genre "Music that rocks a lot" while the top tag is "metal" (see: http://www.lastfm.de/music/SOiL )

Nyarlathotep

If I may post another case, some bands just get their names as genre. The band Earshot for example. http://www.lastfm.de/music/Earshot

oscarlevin

I too got the incorrect genre when the band's name was the most popular tag. I fixed this by changing the line in the "get_genre(artist,album,title)" procedure to read "if (not blacklisted(current) and current != artist) then" It was just a guess on my part (I know no ruby) but it seems to work.

Nyarlathotep

OK, must have to do with title-tagging. How do I change priority? Lines must have changed since 0.2.0, but I don't know any ruby. Could it be lines 56-58? Please make this configurable or at least comment the code accordingly.

DivineAnt

An earlier request made me default to title tag. It's only a matter of what order they are in on lines 56-58, ill make it an configurable option later. and perhaps start commenting my code, hehe. its my first release into "the wild" so commenting is not something im used to put to much effort into.

Nyarlathotep

Thanx for confirming my guess. *g* And many thanks for this cool script.

FinFin

hey, your appp sounds good, but I cant get it working here. I got opensuse 10.3 with KDE but I cant install the ruby-taglib. I had a look at the page, but Iḿ a noob, so I didnt understand the installation guide. Anybody willing to help me? THX Fin-Fin

abombm1

Hello! I really like your script, it's something I've been wanting for a while actually. One very minor change that could potentially be an option is to capitalize the genre tag. I'm pretty anal when it comes to tagging my music, and it would be useful to at least set that option. I hard coded it in for now, since I don't need lowercase tags ever, but perhaps for other users it would be helpful Thanks!

DivineAnt

Actually I was just thinking that last I checked what tags it had retrieved. It will be Capitalized in next release

oscarlevin

Yay. I can't wait.

orogor

Hello Yes some time after posting the comment, i installed that missing lib and the plugin could start, but, i still don't have any context option, and at some point i had some connection error which seemed to randomly pop up (gentoo here). Here's a suggestion of what you may use as genre list , listing all of them should be extensive enought in >90% of cases http://www.jamendo.com/en/albums (right side) http://www.last.fm/music/+tags/ http://verseguru.com/?music/list%7Cgenre The little issue i have with blacklists is that i have no idea how you could fill that (lot of manual filling ?). Maybe add "www" in the blacklist it should work in a lot of cases, even stuff like "listen" shouldn't be in a blacklist because of "easy listening". As for the match i'd suggest some fuzzy match, but something like no more than 2 characters to avoid something like "best _rock_ in the world".

orogor

Hello If i was you i d better try to find a place that list a lot of different tags/music genre, then use this as a whitelist, maybe do stuff like not be case sensitive or fuzzy match in case stuf is misstyped. But i can hardly imageine you can list all the bullshit peoples use as tag, whereas, there are something like 20-30 tags which must amount for >90% of genre tag. Btw i get an error when trying to run your script ... a bit too lazy to check why now, i guess i ll wait for the next update.

DivineAnt

My guess is that you are missing ruby-taglib (http://www.hakubi.us/ruby-taglib/), which in my case (arch linux) was the only library that didn't came with the ruby package. Almost all suggestions require me to figure out how to make a configuration dialog. So i think i'll implement a possibility for both white and blacklist.

DoM

You could use a blacklist, look here: http://www.kde-apps.org/content/show.php/synctags?content=49583

DivineAnt

Good idea, ill put i on my todo. Just need to find out a generic way of doing dialogs. kdialog is packaged deep inside some kde package, and im using gnome.

abo

I have a change for you: For me it's better using the top tag for the track, not for the artist. I have changed your script. Tell me if you want it. Maybe you can make your script configurable.

DivineAnt

My original plan was to use tags for albums, but i dropped the idea when I saw some albums with top tag like "got this album". I suspect that single track tags are even worse on that account. But im not against putting it as a posibillity in configuration

DivineAnt

and by the way, yes, i would like to see your changes

Pling
0 Affiliates
Details
license
version 0.3.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

Other Amarok 1.x Scripts:

Gnome Play Video in Totem
mwheatland
last update date: 19 years ago

Score 5.0

editLyrics-gnome
ZeeD
last update date: 19 years ago

Score 5.0

amarok Alarm
aroth
last update date: 16 years ago

Score 5.0

amaroK Web Collection V xmms
pti-jean
last update date: 16 years ago

Score 5.0

SongLogger
lucatnt
last update date: 17 years ago

Score 5.0

amaroK Web Collection
pti-jean
last update date: 16 years ago

Score 5.0



System Tags