LastFmProxy 1.3b

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

LastFmProxy 1.3b

#1 Post by aragon »

Home: http://vidar.gimp.org/?page_id=50
LastFMProxy is a proxy server for the last.fm radio streams. It allows you to use your regular old audio player to listen to the last.fm streams. It does this by acting as a player itself, connecting to the server on your behalf, but instead of playing the stream, it simply relays it to whichever other application connecting to it.
In short: It takes the lastfm-stream and serves it as an mp3/m3u. If you have streamripper installed, you will also be able to record the stream.

Requirements:
Python: I used Python-2.4 from http://dotpups.de/dotpups/Programming/

Usage:
1. Read /usr/local/lastfmproxy-1.3b/README.txt
2. Setup /usr/local/lastfmproxy-1.3b/config.py for your system
3. run with start-lastfmproxy from console or from the multimedia-menu.
4. Open localhost:1881 in your browser and click "Start Radio". That's it. Your browsers normal dialogue to handle the media-stream will follow.
(5.) To record the stream with streamtuner/streamripper start streamtuner add the url localhost:1881/lastfm.mp3 and you will be able to use the normal functionalities of streamtuner/streamripper.

To stop lastfmproxy run the command start-lastfmproxy from console/menu again as the start-script has start/stop-feature (thanks to Hairy Will and MU).

Cheers
aragon
Attachments
lastfmproxy-1.3b.pet
(38.13 KiB) Downloaded 741 times

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#2 Post by HairyWill »

thank you
I only just got around to trying this out in puppy 4.00. I had two minor stumbling points.
1. When I ran start-lastfmproxy from the console I got an error about badtime I don't know if this was terminal but I fixed my timezone anyway.
2. Clicking on the play button in seamonkey launched gxine which couldn't cope with /tmp/lastfm.m3u. It gave an error about no demuxer. I opened up the m3u file and saw that the stream url was http://localhost:1881/lastfm.mp3 in gxine I did file-openMRL and used http://localhost:1881/lastfm.mp3 and it worked fine.

I also installed streamripper using (streamtuner_including_streamripper-repacked_by_EdB.pup) includes both streamripper and streamtuner. Streamtuner complains about missing libidn which I didn't bother to fix. I just started streamripper from the console

Code: Select all

streamripper http://localhost:1881/lastfm.mp3
voila I am recording mp3s cool
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#3 Post by aragon »

hi will,

as i remember right, i get that error with the time too, but it worked for me without setting anything.

seamonkey? sorry i didn't use that one. i like opera most but as i'm addicted to the DownThemAll-AddOn i stay with my No. 2 => firefox.

i had to confess that i'm not using lastfm-proxy on my new 4.00-puplet. i found out that i love to record LastFm (in Theory) but never did it.

so i decided to not install it as it needs python and i didn't need python for anything else at the moment.

which python-package did you use in dingo?

by the way: i will upload the newest version of shell-fm (0.5) in the next days... maybe your interested in that.

cheers
aragon

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#4 Post by HairyWill »

I just used the python 2.4 that you linked to.
I'm definitely interested in shell-fm-0.5.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#5 Post by jpeps »

HairyWill wrote: 2. Clicking on the play button in seamonkey launched gxine which couldn't cope with /tmp/lastfm.m3u. It gave an error about no demuxer. I opened up the m3u file and saw that the stream url was http://localhost:1881/lastfm.mp3 in gxine I did file-openMRL and used http://localhost:1881/lastfm.mp3 and it worked fine.
Install xine-ui with plugin; by default loads with m3u files.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#6 Post by HairyWill »

jpeps wrote:Install xine-ui with plugin; by default loads with m3u files.
thanks
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#7 Post by HairyWill »

here is a seamonkey protocol handler to rip streams automatically

Code: Select all

#!/bin/sh
#this script is used as a protocol handler in seamonkey for urls that have
# a protocol lastfm:
#before using it you should definitely change the BASE variable
#to add a seamonkey protocol handler see klhrevolutionists post
# http://www.murga-linux.com/puppy/viewtopic.php?p=76632#76632
#
#You will need to have installed 
#lastfm proxy (which needs python) this must be running
#and streamripper
#now you should be able to click on the lastfm "play in software" style links
#choose external player and start ripping the stream
#the play section at the bottom is not sophisticated and may play the same track twice
#I'm sure it is possible to play the stream at the same time as ripping but 
#this is good enough for me and does allow you to check the quality of the rip

gxmessage "about to start ripping from stream $@"
STREAM="$(echo $@ | sed 's/lastfm:\/\///')"
BASE="/mnt/hda5/music/ripper/"
mkdir -p "$BASE$STREAM"
rox "$BASE$STREAM"
killall streamripper
cd "$BASE$STREAM"
streamripper  "http://localhost:1881/$STREAM.mp3" -d "$BASE$STREAM" -s &
PID=$!
export MAIN_DIALOG='<vbox>
<button><label>Stop Streamripper</label>
<action>kill '$PID'</action>
</button>
<button><label>Stop Streamripper and Player</label>
<action>kill '$$'</action>
</button>
</vbox>'
gtkdialog3 &

while [ 1 ]; do
FILE=$(ls -rt *.mp3 | tail -1)
[ -z "$FILE" ] && sleep 30 && FILE=$(ls -rt incomplete/*.mp3 | tail -1)
rxvt -e madplay -v "$FILE"
done
for streamripper without streamtuner jpeps has posted here:http://www.murga-linux.com/puppy/viewtopic.php?t=31029
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

kuapao
Posts: 94
Joined: Tue 01 Jul 2008, 05:30

[SOLVED} "Unable to change station or get a playlist" AND

#8 Post by kuapao »

This is the first time I tried LastFmProxy 1.3b. It would not play and would spit out error messages similar to below:
[Thu Oct 8 15:51:20 2009]: Starting LastFMProxy 1.3b...
[Thu Oct 8 15:51:20 2009]: Connecting to last.fm server...
[Thu Oct 8 15:51:20 2009]: To tune in, point your browser to:
[Thu Oct 8 15:51:20 2009]: http://localhost:8080/
[Thu Oct 8 15:51:25 2009]: Starting LastFMProxy 1.3b...
[Thu Oct 8 15:51:42 2009]: Strangeness! No tracks in playlist? Sending station update...
[Thu Oct 8 15:51:42 2009]: Trying station lastfm://globaltags/pop
[Thu Oct 8 15:51:48 2009]: Unable to change station or get a playlist. Stopping.

I stumbled upon an updated main.py and lastfm.py, which allows me to listen now. Get them at http://voidstar.com/downloads.

Now, the Skip works. Have tried Love and Ban, but get an internal error:
(urk? ['<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'] )
(urk? ['<HTML><HEAD>'] )
(urk? ['<TITLE>404 Not Found</TITLE>'] )
(urk? ['</HEAD><BODY>'] )
(urk? ['<H1>Not Found</H1>'] )
(urk? ['The requested URL /radio/control.php was not found on this server.<P>'] )
Too many errors parsing response.
command love returned:{}
hmm? {}

Anyone have ideas?

UPDATE:

I was able to locate the thread that offers the new main.py and lastfm.py and it clearly explains why Love and Ban don't work anymore:
http://www.last.fm/group/LastFMProxy/fo ... 0/_/518227
Excerpt:
"I've been reading up on the new API. Basically lastfmproxy works now because bits of the old API are still working. But there's quite a lot of changes involved in API V2. When they properly turn off the old API, LastFMProxy will require fairly substantial changes to support it V2.

This is why ban, love and discovery mode don't work properly at the moment. /radio/control.php is not there any more."

So, no further action needed (unless you are up to the challenge!).

I guess I will go back to using shell-fm!

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#9 Post by aragon »

helpfull info!

i've not used lastfm-proxy for some time, as i'm more a fan of shell-fm. and i don't like python as a dependency.

if you are using lastfm-proxy to record your stream, you might want to look at the shell-fm option external-command (as posted in the shell-fm thread). I've not tested that, but if you use streamripper asa external command, recording may also work with shell-fm.

aragon

Post Reply