Play Last.fm in mpd
Linux guide to Play Last.fm streams in mpd
P.S. if you want scrobbling to last.fm you may install "lastmp - MPD client for lastfmsubmitd" (don't forget to configure it)
P.P.S. I recommend you to use xbindkeys to control MPD with mpc. Here is my ~/.xbindkeysrc:
P.P.P.S. If you are expiriencing lags you may increase buffer size for mpd(/etc/mpd.conf):
- Install Python, install and configure MPD, install mpc(optional)
- Download lastfmproxy
- Unpack it to /usr/local/bin/lastfmproxy
-
edit /usr/local/bin/lastfmproxy/config.py
username and password are enought -
make file /etc/init.d/lastfmproxy:
#!/bin/sh
case "$1" in
start)
pkill -f "lastfmproxy/main.py"
/usr/local/bin/lastfmproxy/main.py 1,2>/dev/null &
;;
stop)
pkill -f "lastfmproxy/main.py"
;;
restart)
pkill -f "lastfmproxy/main.py"
/usr/local/bin/lastfmproxy/main.py 1,2>/dev/null &
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0 - add lastfmproxy to runlevels 2-5 (for example with help of sysv-rc-conf)
-
Make file executable and run lastfmproxy:
sudo chmod u+x /etc/init.d/lastfmproxy sudo /etc/init.d/lastfmproxy start
- You can now find interesting page with your browser "http://localhost:1881/"
-
If you have mpc installed then find file m3u-handler.sh and use it to add radio streams to mpd
/path_to_file/m3u-handler.sh "url"You may need to make it executable:chmod +x /path_to_file/m3u-handler.shYou can just usempc add "url" mpc play
-
Some usefull urls:
http://localhost:1881/user/username/recommended.mp3
http://localhost:1881/user/username/personal.mp3
http://localhost:1881/globaltags/tag.mp3
Only one stream can be played at time -
Usefull info:
Read /usr/local/bin/lastfmproxy/README.txt because you can find there how to change your firefox settings for changing station on proxy while choosing them on last.fm site -
You may also install QMPDClient or sonata for Graphical frontedn to MPD
There exist other frontends too:ario - GTK+ client for the Music Player Daemon (MPD) gimmix - graphical music player daemon (MPD) client using GTK+2 glurp - gtk2.4+ frontend to the Music Player Daemon (MPD) gmpc - Gnome Music Player Client (graphical interface to MPD) pygmy - PyGTK client for the Music Player Daemon (MPD) pympd - Frontend for mpd in the style of rhythmbox and itunes sonata - GTK+ client for the Music Player Daemon (MPD) xfmpc - graphical GTK+ MPD client
P.S. if you want scrobbling to last.fm you may install "lastmp - MPD client for lastfmsubmitd" (don't forget to configure it)
P.P.S. I recommend you to use xbindkeys to control MPD with mpc. Here is my ~/.xbindkeysrc:
"mpc stop"
Control+Alt + Delete
"mpc toggle"
Control+Alt + Insert
"mpc toggle"
Control+Alt + Home
"mpc next"
Control+Alt + Next
"mpc prev"
Control+Alt + Prior
"qmpdclient"
Control+Alt + P
"mpc seek +00:00:02"
Control+Alt + Right
"mpc seek -00:00:02"
Control+Alt + Left
P.P.P.S. If you are expiriencing lags you may increase buffer size for mpd(/etc/mpd.conf):
http_buffer_size "1024"
http_prebuffer_size "256"
В Gentoo всё проще. Там просто надо размаскировать пакет lastfmproxy, поставить его, отредактировать /usr/share/lastfmproxy/config.py и можно добавлять его в ранлевел