Play in mpd

Linux guide to Play streams in mpd
  1. Install Python, install and configure MPD, install mpc(optional)
  2. Download lastfmproxy
  3. Unpack it to /usr/local/bin/lastfmproxy
  4. edit /usr/local/bin/lastfmproxy/
    username and password are enought
  5. make file /etc/init.d/lastfmproxy:

    case "$1" in
            pkill -f "lastfmproxy/"
            /usr/local/bin/lastfmproxy/ 1,2>/dev/null &
            pkill -f "lastfmproxy/"
            pkill -f "lastfmproxy/"
            /usr/local/bin/lastfmproxy/ 1,2>/dev/null &
            echo "Usage: $N {start|stop|restart|status}" >&2
            exit 1

    exit 0
  6. add lastfmproxy to runlevels 2-5 (for example with help of sysv-rc-conf)
  7. Make file executable and run lastfmproxy:
    sudo chmod u+x /etc/init.d/lastfmproxy sudo /etc/init.d/lastfmproxy start
  8. You can now find interesting page with your browser "http://localhost:1881/"
  9. If you have mpc installed then find file and use it to add radio streams to mpd
    /path_to_file/ "url"
    You may need to make it executable:
    chmod +x /path_to_file/
    You can just use
    mpc add "url" mpc play
  10. Some usefull urls:
    Only one stream can be played at time
  11. 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 site
  12. 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 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/ и можно добавлять его в ранлевел