OPERATING SYSTEMSOS Linux

Unix & Linux: How to download files with wget where the page makes you wait for download?

Unix & Linux: How to download files with wget where the page makes you wait for download?

The Question: I am trying to download a file from sourceforge using wget, but as we all know
we have to click on the download button and then wait for it to auto download.
how do you download this type of file using wget?
I am trying to download this: http://sourceforge.net/projects/bitcoin/files/
Bitcoin/bitcoin-0.8.1/bitcoin-0.8.1-linux.tar.gz/download
But doing a wget on that url link would not get me the file as the file is auto
loaded via the browser.

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

== This solution helped 54 people ==
I would suggest using curl to do this instead of wget. It can follow the
redirection using the switches -L, -J, and -O.
curl -O -J -L http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-
0.8.1/bitcoin-0.8.1-linux.tar.gz/download
**** switch definitions ****
-O/–remote-name
Write output to a local file named like the remote file we get.
(Only the file part of the remote file is used, the path is cut off.)

-L/–location
(HTTP/HTTPS) If the server reports that the requested page has moved
to a different location (indicated with a Location: header and a 3XX
response code), this option will make curl redo the request on the new
place. If used together with -i/–include or -I/–head, headers from
all requested pages will be shown. When authentication is used, curl only
sends its credentials to the initial host. If a redirect takes curl to a
different host, it won’t be able to intercept the user+password.
See also –location-trusted on how to change this. You can limit the
amount of redirects to follow by using the –max-redirs option.

-J/–remote-header-name
(HTTP) This option tells the -O/–remote-name option to use the
server-specified Content-Disposition filename instead of extracting a
filename from the URL.
See the http://curl.haxx.se/docs/manpage.html for more details.

== This solution helped 7 people ==
I’m unsure which version of wget or OS and any proxy’s exist between you and
sourceforge but wget downloaded the file when I removed the “/download” and
left it at the file extension.
I don’t want to flood the post or pastebin my entire session but I got the 302
then 200 status codes before the transfer began. What happens when you try
wget?
Resolving downloads.sourceforge.net… 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80… connected.
HTTP request sent, awaiting response… 302 Found

[snipped for brevity]

HTTP request sent, awaiting response… 200 OK
Length: 13432789 (13M) [application/x-gzip]
Saving to: `download’

With thanks & praise to God, and with thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free-music | Images: https://stocksnap.io/license & others | With thanks to user slm (https://unix.stackexchange.com/users/7453), user Patoshi ??? (https://unix.stackexchange.com/users/33183), user kenorb (https://unix.stackexchange.com/users/21471), user Karen3819x4 (https://unix.stackexchange.com/users/38319), and the Stack Exchange Network (http://unix.stackexchange.com/questions/74334). Trademarks are property of their respective owners. Disclaimer: All information is provided “AS IS” without warranty of any kind. You are responsible for your own actions. Please contact me if anything is amiss at Roel D.OT VandePaar A.T gmail.com.

source

by Roel Van de Paar

linux download

Leave a Reply

Your email address will not be published. Required fields are marked *