Spelar via Spotify Spelar via YouTube
Hoppa till YouTube-video

Laddar spelare ...

Skrobbla från Spotify?

Anslut ditt Spotify-konto till ditt Last.fm-konto och skrobbla allt du lyssnar på från alla Spotify-appar på alla enheter eller plattformar.

Anslut till Spotify

Avvisa

Vill du inte se annonser? Uppgradera nu

Integrate LastFMProxy into Windows

As I wrote in my last journal entry, LastFMProxy allows you to listen to Last.fm radio in your favorite music player, Winamp in my case.

The downside to LastFMProxy is that it's somewhat cumbersome to use out of the box. You first have to load the main program before you can use it, and then if you want to listen to any new stations, you have to figure out the right URL to send it.

Well, that's no longer the case. I'll tell you how to integrate LastFMProxy into your system, so that it's virtually seemless. You'll then be able to click on any radio link, and it will automatically change channels and add the new channel to your channel history.

The following assumes that you already have LastFMProxy installed and working on your system. If not, I suggest you click on the link at the beginning of this blog and sort that out first.

Okay, the first thing you'll want to do is associate .py files with pythonw.exe (note the w). That will cause .py files to load in the background, without a command window.

The easiest way to do this on XP is to right-click on the main.py file in your LastFMProxy folder, select Open With and then Choose Program. When the dialog comes up, Browse to your Python directory and select pythonw.exe. Once back at the Open With dialog, make sure Always use the selected program… is enabled.

Next, you want to create a shortcut for main.py in your LastFMProxy folder. Drag the file to an empty part of your Explorer directory while holding down the Alt key. Let go of your mouse button and you should have a shortcut. Copy this shortcut to your startup folder.

Obviously, that means this program will be running all the time, but it uses virtually no CPU cycles and a trivial amount of memory, so it's worth it to gain the seemlessness we're after. It will always be there when you need it. And when you don't need it, it will have virtually no effect on your computer's other tasks.

Disclaimer: Although I believe the next part is completely safe, I take no responsibility for any problems incurred. If you're not comfortable editing the registry, find someone who is.

Next comes the fun part, editing the registry. But this is a very simple edit. Click on the Run key in the Start menu and enter regedit in the box and then Enter. First thing you should do in Regedit is right-click on My Computer and select Export. That will allow you to back up your registry, just in case something goes wrong.

Next, navigate to HKEY_CLASSES_ROOT\lastfm\shell\open\command. This is put there by the official Last.fm radio player. If you haven't installed it, you'll have to create this key manually, or just install the official player first, and let it do it for you.

Double-click on (Default) in the right pane, and in the Value Data box, enter the following, changing the paths to reflect those on your own system (it should all be on one line):

"C:\Python24\pythonw.exe" "D:\Sound Tools\LastFMProxy\changestation.py" "%1"

Click OK and then close the registry.

That's it!

Now assuming you have LastFMProxy open in your browser (http://localhost:1881/), you should be able to click on any radio link, and LastFMProxy will change to that station and add the station to your station history. Note that this could take several seconds or longer, depending on the speed of the Last.fm system at the time.

I've tested this with success in both in Maxthon (IE wrapper) and Firefox. I would imagine it works in other browsers too.

Any questions or comments, fire away! http://oink.me.uk/pic/smilies/music.gif

Vill du inte se annonser? Uppgradera nu

API Calls