2

I'm on a slow, unstable internet connection that often cuts out. I pay per megabyte transmitted.

Sometimes I have to download large files. The most unfortunate thing that happens is when I get to 70% and then the download fails. I know some hacks to try continuing the download through some browsers, but I often end up having to start all over again. Also, if I start a download before going to bed, I'm not going to be there to manually restart or even continue the download in the middle of the night. Due to this, I generally prefer to use the BitTorrent protocol to download things, as it never sees a download as "failed", it just keeps trying and continues where it left off.

However, many files are not available through BitTorrent, many of them have to be downloaded from a normal HTTP server online.

I'm looking for a program that will download files from normal websites, but behave like BitTorrent in the sense that it doesn't see downloads as "failed", even if the internet connection cuts out for a minute. It should just keep trying, and continue where it left off.

I prefer OS X, but any platform is alright. I can use a VM or whatever. The most important thing is that the tool should fit the description here. Even mobile apps would be alright, I have access to both iOS and Android devices.

6

Two of the most commonly used downloader for http urls on Unix systems are wget and curl. Of these curl has apparently been part of OS X in the past, and is presumably installable on any version. It has many options but the ones you need in particular are -C - to continue a partial failed download, and for example --retry 9 to do up to 9 retries. Note, the web server concerned needs to support restarting downloads with byte ranges to avoid restarting from offset 0. For example, to download this question to myfile (needs -L for redirect), create a file, say download, with the contents

#!/bin/bash
for try in {1..5}
do if curl -o myfile --retry 9 -C - -L http://softwarerecs.stackexchange.com/q/36717/16428
   then break
   else sleep 60
   fi
done

The external loop copes with the network being down by waiting 60 seconds if curl exits with a non-zero code (ie some error). Make the file executable with chmod a+rx, then you can run it with ./download. You can make a more generic script taking a url as parameter, eg

#!/bin/bash
for try in {1..5}
do if curl -O --retry 9 -C - -L "${1?}"
   then break
   else sleep 60
   fi
done

Here the -O option means name the output file with the basename (final part after the last /) of the url.

  • There are other options to consider too: --connect-timeout, --retry-delay. But for no network at all, as opposed to a server not replying, you will probably need to enclose the command in a loop testing for exit code 0 meaning ok. Provided you continue to use the same output file, a new command will still honour the -C -. – meuh Oct 9 '16 at 18:51
  • That's good. I had a quick look for a more friendly graphics interface to curl, but didn't see anything obvious. I updated my answer with a small bash script example for anyone else who might be interested. – meuh Oct 9 '16 at 19:03
  • 1
    You will get the message every time curl stops, but the for loop should make it try again. I added a sleep of 60 seconds between the tries, otherwise the 5 tries will soon be over! I see you also have another answer that looks good. – meuh Oct 9 '16 at 19:20
  • Hah, you're right! I just hadn't waited 60 seconds. I just checked the Terminal window and noticed that the download had already continued, lol :) – Revetahw Oct 9 '16 at 19:22
1

I've found that I can use this website to save large files from the web to cloud services like Dropbox, Google Drive, Box and Microsoft OneDrive.

Then, I can use the syncing clients of those services to sync the file to my computer's local storage. For example, Google Drive certainly doesn't give up on syncing just because it was deprived of Internet for a while. It keeps trying to sync. I assume the other services are similar.

1

I use Free Download Manager on Windows and I'm happy with it since years.

  • it's available for OS X as well
  • resumes broken downloads if possible (the server must support this)
  • it's free
  • also supports BitTorrent
  • +1, this worked splendidly. – Revetahw Oct 9 '16 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.