IMPORTANT: This script is not built as an amarok script, it should be executed from the command line. This is because it's a one-run script which will have no benefit running in the background, and it is pretty CPU intensive. If you really want to integrate it as an amarok script, you should have very little trouble adapting the code.
This script fetches last.fm user tags (not global tags) and creates playlists based on your local files.
These playlists are then added to amarok.
The script assumes your amarok playlists are under ~/.kde/share/apps/amarok/playlists (change it if you are using another directory)
You can use this script by running it this way:
'python lastfm_playlists.py [last.fm user name]'
It will yield better results with your own tags, as you'll problaby have most of your tagged music.
Obtaining artists names, songs, etc, is done by parsing the html user tag page as there's not still a webservice which will give me the contents of a tag (i'm talking about user tags all the time)
Added support for amarok 1.4.2 (amarok track paths have been changed in the database to relative paths and the device mountpoint must be added to each path)
This version is a patch for avoiding encoding problems. The script now checks the retrieved names in different encodings, until finds one that does not throw an exception. This is a temporary fix so the script does not break. There must be a better way of doing this :P
- Check some character encodings
- Retrieve amarok's configured last.fm user as default
- Support for global tags
Check my last.fm account: