LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Multiple fallback URLs for single file wget/curl/other ? (https://www.linuxquestions.org/questions/linux-software-2/multiple-fallback-urls-for-single-file-wget-curl-other-4175493198/)

TheLexx 01-30-2014 07:46 PM

Multiple fallback URLs for single file wget/curl/other ?
 
I created a small Python script to selectively download files from a list. Each list has multiple URLS where the file was mirrored. In the script that I tossed together quickly, I preformed the downloading by just calling wget within a system call.I would like to improve my script by automating the script to select a second mirror location if the file can't be download from the first location.

Any suggestions on what what would be the easiest way to accomplish this goal? I looked into wget and there does not seem to have a facility to retrieve from a second or third location if and only if the first location fails. I was thinking about using the CLI version of CURL, but I did not see a retry URL in that either. I suppose I could import libCURL into python and use try/catch loop until it succeeds or runs out of URLs. But to be honest, I really don't want to do that much work for a script that does what I want it to 99.9% of the time.

Any suggestions for a quick and dirty solution for a quick and dirty script?

unSpawn 02-01-2014 06:13 AM

Code:

aria2c http://someUrl http://anotherUrl http://someOtherUrl


All times are GMT -5. The time now is 04:08 PM.