cURL / Mailing Lists / curl-users / Single Mail


Re: Using cURL to keep saving streams

From: Daniel Stenberg <>
Date: Sat, 16 Apr 2011 23:35:27 +0200 (CEST)

On Wed, 13 Apr 2011, Kristian Kjeldsen wrote:

> I'm finding a new use for cURL(MacOSX) recently and that is saving shoutcast
> streams with low resource load. The commandline i'm using is this: curl -L
> -C - -o session_MMDD.mp3 And it works great!
> However, at times the stream stops sending data, and sometimes does not
> recover from this condition.

AFAIR, these servers expect the client to notice that it runs out of data to
playback and then the client needs to reconnect and get more data again.

> My question is this: How to, preferably in a single line, have curl save its
> data to the same file and keep reconnecting when there is a problem?

What about something like...

$ while true; curl -C - -L -o session_MMDD.mp3 [URL] -y 100 -Y 10; done

The logic being that if the data stream turns out too slow during 10 seconds,
it'll give up and the shell loop will kick in and reconnect and do another

List admin:
Received on 2011-04-16