I try to use wget to download this but failed.
https://code.ros.org/trac/wg-ros-pkg/raw-attachment/ticket/5069/rein_cmakelists2.patch
sam@sam:/media/Data/code/ros/recognition/rein$ wget https://code.ros.org/trac/wg-ros-pkg/raw-attachment/ticket/5069/rein_cmakelists2.patch
--2012-10-04 16:29:30-- https://code.ros.org/trac/wg-ros-pkg/raw-attachment/ticket/5069/rein_cmakelists2.patch
Resolving code.ros.org (code.ros.org)... 157.22.19.21
Connecting to code.ros.org (code.ros.org)|157.22.19.21|:443... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.
--2012-10-04 16:29:32-- (try: 2) https://code.ros.org/trac/wg-ros-pkg/raw-attachment/ticket/5069/rein_cmakelists2.patch
sam@sam:/media/Data/code/ros/recognition/rein$
But I can use firefox to download.
How to download this kind of file in wget?
Thank you~
Some websites or servers block
wget
(and similar tools) in order to only allow downloads from a browser. You can trick the website into thinking that you are an actual browser. There are many examples available on google. Here is a particularly complete one taken from askapache. To find alternatives just googlewget pretend browser
.This is one command, though I put it on several lines to increase readability. You can make it an alias to make it easier to use.
This may due to the site use ticket along with cookies for downloading (some other methods too). So when using
wget
it's necessary to load cookies file as well as other option like user agent, etc.For example:
"wget" --trust-server-names -c -O jre-7u21-linux-x64.rpm --directory-prefix=/home/totti/Downloads --referer= http://java.com/en/download/linux_manual.jsp \?locale=en --load-cookies=/tmp/flashgot.7gavixy1.default/cookies --header=Cookie:s_vi=[CS]v1\|28BA8A90050109CA-6000011540153427[CE]\;\ --user-agent=Mozilla/5.0\ (X11\;\ Ubuntu\;\ Linux\ i686\;\ rv:16.0)\ Gecko/20100101\ Firefox/16.0 http://sdlc-esd.sun.com/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm \?AuthParam=1366627766_80a413ae29c4b4d2e12ac7e334d61847\&GroupName=JSC\&FilePath=/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm\&File=jre-7u21-linux-x64.rpm\&BHost=javadl.sun.com
This can be easily done using the firefox extension
Flashgot
. (pls some one a add link to it)