wget is returning an html page instead of original file
It seems redirection is disabled at your wget, try specifying
--max-redirect=2 or a higher number. You probably also want to specify
--trust-server-names to allow wget to update the file name after redirection, otherwise the downloaded files will still be called download.
Related videos on Youtube
Santosh Kumar less than a minute
In my case the problem is with SourceForge.net. Actually I was trying to download these files:
Something did not went good, so I logged wget, and the log file was:
--2012-08-21 09:52:17-- http://sourceforge.net/projects/wxpython/files/wxPython/188.8.131.52/wxPython-src-184.108.40.206.tar.bz2/download Resolving sourceforge.net... 220.127.116.11 Connecting to sourceforge.net|18.104.22.168|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 18846 (18K) [text/html] Saving to: `download' 0K .......... ........ 100% 6.30K=2.9s 2012-08-21 09:52:25 (6.30 KB/s) - `download' saved [18846/18846] --2012-08-21 09:52:25-- http://sourceforge.net/projects/wxpython/files/wxPython/22.214.171.124/wxPython-docs-126.96.36.199.tar.bz2/download Connecting to sourceforge.net|188.8.131.52|:80... connected. HTTP request sent, awaiting response... 200 OK The file is already fully retrieved; nothing to do. FINISHED --2012-08-21 09:52:28-- Downloaded: 1 files, 18K in 2.9s (6.30 KB/s)
As you can see in this log file, I end up in getting a single HTML file :(
This shows that wget doesn't waits on the page to let webpage to redirect it to another location, and it downloads the page itself.
I want those two files, with wget, how can I?
Santosh Kumar almost 10 yearsI set those two options, but still getting an HTML file.
scai almost 10 years@Santosh Interesting, it works here. Which wget version do you use?
Santosh Kumar almost 10 yearsGNU Wget 1.12 built on linux-gnu.
Santosh Kumar almost 10 yearsDo you find any error in my .wgetrc file?
scai almost 10 years@Santosh No, but have you tried it without?
Santosh Kumar almost 10 yearsHey, It is working! But I don't like passing those much argument everytime I download anything. What is wrong with my wget?
Santosh Kumar almost 10 yearsI'm quite sure something is wrong with my .wgetrc file. I need some research on it.
scai almost 10 yearsTry commenting out all configurations in your .wgetrc file. Then comment in one after the other and call the wget command from above. You should see which of your configurations leads to the strange behaviour.
Santosh Kumar over 9 yearsI found that
--user-agentwas creating the problem. I don't know why.
Freddy over 2 yearsNo, you don't need any cookies. Try
krishnakeshan over 2 yearsThat's the solution for this particular website. I was mentioning the more common one.