Hi David, On 11/17/19 11:49 PM, Zana Dávid wrote: > I'm using wget to download online streamed media (Icecast ogg stream), and it > is crucial to have every download in separate files, therefore, > I've set up wget to create a new file whenever a download is started. > However, when there is a connection loss, and when it's restored, wget seems > to continue the same file, it never creates a new one automacitally > not matter how much time has passed. This way, during a one hour connection > loss, a one hour gap will be created in the download (ogg audio), > and there's no way to tell when it had happened. > My question is, is there a way or a combination of command parameters to > force wget NOT to continue writing the old file, but to creatie a new one > every time a disrupted net connection is restored? > What I'd need is basically make wget to start downloading (and creating a new > output file) again after a timeout. Is this possible?
It depends a bit on the options you use. But in general, use --tries=1, so that wget returns on error. Then restart wget (best after a pause like 10s or 1min). If you don't use -O/--output-document, nor -c nor -nc, a new file will be created. If you use -O, you have to adjust the file name by yourself. In bash it would be like while true; do wget ... sleep 10 done If you are a bit into the C programming language, this might be interesting for you: https://gitlab.com/gnuwget/wget2/blob/master/examples/getstream.c That libwget example also understands streaming meta file (.m3u, .ram, .wax, .asx, .pls, .xspf) and prints title information to stderr (while the audio stream goes to stdout). With some small changes, you could restart on error with output to custom file names. Regards, Tim
signature.asc
Description: OpenPGP digital signature
