in reply to perl script to capture streaming audio
While you can do it with perl, I swear by The Right Tool for The Right Job.
However, it's a bit unclear as to what you want to do. If you want to get a streamed file that's about one hour long, you can do this:
curl -f -r 0-58982400 -O "http://url"This will get the first 58982400 bytes of the file, which is roughly one hour of sound at 128kbps (ie 128*60*60*1024/8 - adjust as you see fit). If you want the transfer to run for one hour (or 3600 seconds), do this:
curl -f -m 3600 -O "http://url"cURL is most likely installed on your system. If not, it's freely available for most platforms at curl.haxx.se
The -f option makes sure that it doesn't write a file if there's an error (who wants empty files anyway?), and the -O option tells it to save the file with the same name as on the server. Alternately, you can use -o "filename.mp3" for a specific filename. In case the server wants a referer, use -e "http://server/". There are many more switches, so have a gander at the manpage... Good luck! And have a great yule! =)
Edit: Fixed idiotic error. Bits != bytes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: perl script to capture streaming audio
by Anonymous Monk on Dec 21, 2002 at 05:19 UTC | |
by carthag (Scribe) on Dec 21, 2002 at 13:42 UTC | |
by mce (Curate) on Dec 23, 2002 at 08:54 UTC |