×

Download Streamed media to a dumpfile

I was following this site: http://www.tomtaylor.co.uk/blog/2006/09/01/how-to-rip-bbc-radio-streams-to-mp3/ and I thought it would be a nice time to create a script to do this as I always forget the commands required.

So here it is:

#!/bin/bash
#Downloads Audio from BBC Radio Streams and Outputs it to a dump file
echo "What is the rtsp location of the stream? [ENTER]:"
read stream_loc
echo "What do you want the dump file to be called? [ENTER]:"
read dump_loc
mplayer -dumpstream -dumpfile $dump_loc "$stream_loc"
exit

Now to get hold of the rtsp location for the download you need to obtain the .rpm file and open it with cat or some document reader such as less, more or kate.

Inside that should be a url starting with rtsp.

Once you’ve gotten that file (its going to download it in realtime, so a 2 hour show will take 2 hours) you need to process the file, assuming the dump file is called file.dump

mplayer -ao pcm file.dump

This will output a likely large .wav file in the folder you ran it then do

lame -h -v -b 192 file.wav output.mp3

This will output a 192kbps mp3 file from the converted dump wav file to an mp3.

Job done.

Post Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.