Friday, November 03, 2006

LastFMproxy, Streamripper and Amarok

I have recently discovered Lastfm, the community radio. It is a great thing just give it the name of some artists you like and it will gather musics of this artists or similar artists... After that you can be a little more specific and say if you like the music or if you want to ban it! Most of the time the choices are excellent and they are becoming more and more relevant with the time and your selection. If you want to read the lastfm flux in one of your old player on linux, you should try lastfmproxy (you can find it here ), just uncompress the archive with this command:
tar -xvzf lastfmproxy-1.1.tar.gz
then go inside the directory you have just created, modify the config.py file with your username and password for Last.fm. That's it, now you can run the main script:
python main.py
you should see something like:
Starting LastFMProxy 1.1...
Connecting to last.fm server...
To tune in, point your browser to:
http://localhost:1881/
The last line stand to give you the url you can listen in your old player... So start it and open this url. That's working ;-) Great.
In all the previous part I said "old player", it is because with the great player of linux: Amarok, you can directly play Last.fm: you need to go in Settings and that's it! You can now choose open a Last.fm flux! Enjoy.
You probably wonder why I told you about LastFmproxy if you don't need it to play LastFM if you use Amarok... It is because there is a little trick: if you listen LastFM, you only listen it, when you shut down your computer, or when the music is finished, there is no way to listen it again! So let install streamripper to record all this music on your computer. First of all you should only record music with a copy left, otherwise you are out of law! Now start lastfmproxy as explained before. And type this little command:
streamripper http://localhost:1881/lastfm.mp3 -d /home/mynqme/mydirectory -r
you can notice 3 arguments:
the radio you want to listen and record
the directory in which you will save music
the last argument will let you listen the music you are recording.
Launch the command, go to Amarok and open the url http://localhost:8000
That's it you can listen and record music on LastFM