Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In my case the problem is with SourceForge.net. Actually I was trying to download these files:

http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2/download
http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-docs-2.9.4.0.tar.bz2/download

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/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2/download
Resolving sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|: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/2.9.4.0/wxPython-docs-2.9.4.0.tar.bz2/download
Connecting to sourceforge.net|216.34.181.60|: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.

Question:

I want those two files, with wget, how can I?

share|improve this question
add comment

3 Answers

Your Case is redirect , But when you redirect just for your cookies, FireFox has two extension that one export a txt file from your cookie with wget format, and second import it. Then you use :

wget --load-cookies your_cookies_file.txt your_URL
share|improve this answer
add comment

http://garr.dl.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2

http://garr.dl.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-docs-2.9.4.0.tar.bz2

share|improve this answer
    
I am quite sure that's not what he wanted. –  scai Aug 21 '12 at 10:20
1  
This answers the specific problem of what to do to get things from sourceforge, but not the general question about wget and redirects. –  mattdm Aug 21 '12 at 14:33
add comment

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.

share|improve this answer
    
I set those two options, but still getting an HTML file. –  Santosh Kumar Aug 21 '12 at 6:05
    
@Santosh Interesting, it works here. Which wget version do you use? –  scai Aug 21 '12 at 6:06
    
GNU Wget 1.12 built on linux-gnu. –  Santosh Kumar Aug 21 '12 at 6:14
1  
Try 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. –  scai Aug 21 '12 at 13:42
1  
I found that --user-agent was creating the problem. I don't know why. –  Santosh Kumar Mar 1 '13 at 8:04
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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