Last.Fm Genre Tagger

Amarok 1.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org

0
Score 50%
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:

10 years ago

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

cyreald69

10 years ago

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!

Report

Ark

10 years ago

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?

Report

Nyarlathotep

10 years ago

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 )

Report

Nyarlathotep

10 years ago

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.

Report

C

DivineAnt

10 years ago

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.

Report

Nyarlathotep

10 years ago

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

Report

Nyarlathotep

10 years ago

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

Report

oscarlevin

10 years ago

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.

Report

FinFin

10 years ago

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

Report

abombm1

10 years ago

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!

Report

C

DivineAnt

10 years ago

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

Report

oscarlevin

10 years ago

Yay. I can't wait.

Report

orogor

10 years ago

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".

Report

orogor

10 years ago

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.

Report

C

DivineAnt

10 years ago

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.

Report

DoM

10 years ago

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

Report

C

DivineAnt

10 years ago

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.

Report

abo

10 years ago

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.

Report

C

DivineAnt

10 years ago

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

Report

C

DivineAnt

10 years ago

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

Report

10 years ago

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

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
0.3.3
updated May 20 2008
added Apr 15 2008
downloads today
0
page views today 2
System Tags addon