









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] recording streaming media
Aaron Birenboim wrote:
> Does anybody know of a way to record streaming media?
> There are some radio news broadcasts (about the New Orleans floods)
> that I really want to be able to capture for the schools.
Here's my (very primitive) stream ripper:
--------------------------------- BEGIN
#!/bin/bash
# if the URL provided is to a ram container, extract ra or rm url
case "$1" in
*.ram) URL=`wget -O - $1 | head -n 1` ;;
*) URL=$1 ;;
esac
# strip the extension from known extensions
# so far, only ra and rm
case "$URL" in
*.rm) bname=`basename $1 .rm` ;;
*.ra) bname=`basename $1 .ra` ;;
*.ram) bname=`basename $1 .ram` ;;
*) bname=`basename $1` ;;
esac
# if $2 is defined, make it the name of the outfile
# otherwise, use the renamed basename
case "$2" in
[0-9a-zA-z]*) outfile="$2" ;;
*) outfile=downloads/$bname.mp3 ;;
esac
mkdir /tmp/$bname.$$
cd /tmp/$bname.$$
mplayer -nortc -nojoystick -nolirc -ao pcm -vc dummy -vo null "$URL"
cd $HOME
lame -h -a /tmp/$bname.$$/audiodump.wav "$outfile"
rm /tmp/$bname.$$ -rf
--------------------------------- END
There are a lot of things you could add. I just run it from the command
line.
j
--
http://www.RealizationSystems.com/ -- start communicating
http://www.GalacticSlacker.com/ -- read it and weep
http://www.NMPerspective.com/ -- a Southwest Perspective
|
|