Statistics
| Branch: | Tag: | Revision:

dvbd / utils / streammusic @ 723fa73a

History | View | Annotate | Download (635 Bytes)

1
#!/bin/sh
2

    
3
#
4
# Requires music player daemon (mpd) and console (mpc), and mplayer
5
#
6

    
7
PATH=$PATH:/home/jak/bin
8

    
9
playlist=$1
10

    
11
trap "" TERM
12
killav >& /dev/null
13

    
14
cleanup()
15
{
16
    echo "Cleaning up..."
17
    kill %1
18
    exit 0
19
}
20
trap cleanup TERM
21
trap cleanup CHLD
22

    
23
case "$playlist" in 
24
   *.pls)
25
   	mpc clear
26
	lynx -source "$playlist" | grep File | sed -e 's/^File.*=//' | \
27
	while read url ; do 
28
	   mpc add "$url"
29
	done
30
	mpc play
31
	;;
32

    
33
   *.asx)
34
	lynx -source "$playlist" | grep href= | sed -e 's/^.*href="//' -e 's/".*$//' | \
35
	while read url ; do 
36
	   echo Playing $url
37
	   mplayer -cache 32 "$url" </dev/null &
38
	   wait %1
39
	done
40
	;;
41
esac