ACPI administration advocacy advocacy advocacy opinion alsa amarok apache apple apt aptitude audio audo authentication automount avi awk bash BIOS boot business cache calendar calibre cdr cdrecord censorship commandline computerscience console convert cron cut database date debian degree design desktop development disk dpkg dvd economics education emacs email europe exim faad ffmpeg file files firefox firewall flash foss freedom ftp fun fuse git gnumeric graphics grep growisofs grub gtkpod hardware hardware html idiocy image imagemagick images installation ip iphone ipod iptables iso itunes ivman kde kernel keyboard knoppix lame laptop latex linux locale lockin longlines m4a microsoft mimetypes minitab mount mp3 mp4 mplayer multimedia music mysql network nfs nfs4 nmap openbox openoffice opinion opinion partition pdf perl php politics postgresql printing privacy programming rant remote rhythmbox rss rsync rxvt scp screengrab screenshot script scripting scsi security sed server shell siteadmin sitenews sitesoftware skype skype slackware sound sox spam spreadsheet ssh statistics subversion sudo svk swap t23 t43 terminal text thinkpad thunderbird time timezone ubuntu udev upgrade usb usbmount users uuid versioncontrol vfat video vnc windows wine wordpress wordprocessing X40 xwindows xwindows youtube
Update: new versions of xmms can play pls files, so the script below should be modified to show this.
Many Linux mp3 players don't correctly undestandling .pls playlist files, at the moment. This problem flummoxes many GNU/Linux users, but the solution is a simple bash script.
Firstly, some browsers such as firefox and lynx use the ~/.mailcap file to see how they should handle various file types. So, put this line, or something similar, in your mailcap:
audio/x-scpls; /home/user/bin/plshandle.sh %s
/home/user/bin/plshandle.sh is the path to a bash script that actually parses the pls file and sends the result to your listener, change it to suit your particular set up.
The code for plshandle.sh should be something like this:
#!/bin/bash
### a little script to help handle shoutcast pls files
if [ -n "$DISPLAY" ]; then
PLAYER=xmms
else
PLAYER=mpg123
fi
cat $1 | grep -e '^File1' | cut -f 2 -d = | xargs $PLAYER
New version of script for xmms players that can handle pls files:
#!/bin/bash
### a little script to help handle shoutcast pls files
if [ -n "$DISPLAY" ]; then
xmms $1 &
exit 0
else
PLAYER=mpg123
fi
cat $1 | grep -e '^File1' | cut -f 2 -d = | xargs $PLAYER
Don't forget to use [chmod] +x to make the script executable. This script first checks whether $DISPLAY is set, if it is it means that we can run xmms, otherwise we run a command line program, in this instance mpg123.
The final line does the real work. The contents of the pls file are sent to grep, which takes one line (the one that starts with 'File1' and discards the rest of the file. The result is then passed to 'cut' which splits the data in two and passes everything after '=' to the player.
When you click on a .pls file in your browser, tell it to open the file with plshandle.sh and hey presto! you're listening to pls