help - resume curl automatically on MP3 stream fail?
Hello.
First the question, then some background (which is important) - how do I script a check to see if curl is ripping my mp3 stream and restart it if it fails?
I'm a recent switcher to Mac and have been playing with Darwin. Here's my scenario. There is a radio station that streams MP3 audio non-stop. I want to rip my favorite radio show at the same time, every weekday, for the same length of time. I used to use TotalRecorder on Windows to accomplish this but wanted to try my hand at the CLI. I know there are other solutions, but I want to exhaust the CLI possibilities (bash, perl, python, php - doesn't matter) first.
Here's how I rip the stream.
curl my.radiostation.com > myradiostation.mp3.
This works really well except for one thing. Sometimes the stream drops and needs to be restarted.
I know I can manually append the mp3 file by using a double arrow >>, but I am never around when the stream is being recorded.
So, my question is, how do I script this so that 1. I record the stream and 2. perform a check that will restart and append my mp3 file if the stream fails?
Thanks.
Last edited by webagogue; 05-29-2005 at 11:03 PM.
|