scriptingautomationsourceforge

Downloading archives from sourceforge.net in a script


I am writing a script which installs something (for a user, not as the root; so no use of the package manager) involving an archive which is part of a SourceForge project. Now, SourceForge have HTML pages which auto-select a mirror for you and trigger the download with a delay; this won't work when you're trying to just:

wget --continue alfa.com/bravo.tar.gz

What should I / can I do?


Solution

  • This appears to work fine:

    q=downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2
    timeout 1 wget "$q"
    wget --continue "$q"
    

    Result:

    HTTP request sent, awaiting response... 206 Partial Content
    Length: 414352 (405K), 168838 (165K) remaining [application/octet-stream]
    Saving to: ‘expat-2.2.0.tar.bz2’
    
    expat-2.2.0.tar.bz2 100%[+++++++++++========>] 404.64K   235KB/s    in 0.7s
    
    2017-01-21 19:15:57 (235 KB/s) - ‘expat-2.2.0.tar.bz2’ saved [414352/414352]