Using wget or curl command to download from dynamic urls
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Using wget or curl command to download from dynamic urls
Dear all,
I want to use two of the fantastic commands available in linux e.g. wget and curl which help me download files with direct and straightforward links right from the command prompt without going into any gui browser!
But unfortunately, I am not being able to download the files which would be linked with dynamic urls (urls containing "?" in them which is probably used for redirection).
The link to all the the IEEE papers also fall in this category...Eg. http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=5173739&isnumber=5173690
Also some times some of the useful software also come in this format E.g. "http://www.mozilla.com/products/download.html?product=firefox-3.5.1&os=win&lang=en-US"
While using wget to download files like this I get the error...(I am attaching the complete log...)
--04:33:52-- http://www.mozilla.com/products/down...win&lang=en-US
=> `download.html?product=firefox-3.5.1&os=win&lang=en-US'
Resolving iiscproxy.serc.iisc.ernet.in... aa.bb.cc.dd, aa.bb.cc.ee, aa.bb.cc.fe, ...
Connecting to iiscproxy.serc.iisc.ernet.in|aa.bb.cc.dd|:3128... connected.
Proxy request sent, awaiting response... 302 Moved Temporarily
Location: http://www.mozilla.com/en-US/product...win&lang=en-US [following]
--04:33:53-- http://www.mozilla.com/en-US/product...win&lang=en-US
=> `download.html?product=firefox-3.5.1&os=win&lang=en-US'
Connecting to iiscproxy.serc.iisc.ernet.in|aa.bb.cc.dd|:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
download.html?product=firefox-3.5.1&os=win&lang=en-US: File name too long
Cannot write to `download.html?product=firefox-3.5.1&os=win&lang=en-US' (File name too long).
Command: user@machine:~> wget "http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=5173739&isnumber=5173690"
--04:58:39-- http://ieeexplore.ieee.org/stamp/sta...number=5173690
=> `stamp.jsp?tp=&arnumber=5173739&isnumber=5173690'
Resolving iiscproxy.serc.iisc.ernet.in... aa.bb.cc.dd, 10.66.70.81, 10.16.40.12, ...
Connecting to iiscproxy.serc.iisc.ernet.in|aa.bb.cc.dd|:3128... connected.
Proxy request sent, awaiting response... 302 Moved Temporarily
Location: http://ieeexplore.ieee.org/stamp/sta...number=5173690 [following]
--04:58:40-- http://ieeexplore.ieee.org/stamp/sta...number=5173690
=> `stamp.jsp?tp=&arnumber=5173739&isnumber=5173690'
Connecting to iiscproxy.serc.iisc.ernet.in|aa.bb.cc.dd|:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 612 [text/html]
stamp.jsp?tp=&arnumber=5173739&isnumber=5173690: File name too long
Cannot write to `stamp.jsp?tp=&arnumber=5173739&isnumber=5173690' (File name too long).
Can anybody suggest any workaround for these type of links?
I think you mean the -O option, from the wget man page:
Quote:
-o logfile
--output-file=logfile
Log all messages to logfile. The messages are normally reported to standard error.
-O file
--output-document=file
The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If - is used as file, documents will be printed to standard output, disabling link conversion. (Use ./- to print to a file literally named -.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.