bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] Can someone please help with wget log-in ? apparently I'm mis


From: Fernando Cassia
Subject: [Bug-wget] Can someone please help with wget log-in ? apparently I'm missing some Javascript?
Date: Wed, 6 Jun 2012 07:08:08 -0300

There is this site that has some files available for download.
http://ginga.lavid.ufpb.br/projects/openginga/files

For testing use
user:bugmenot
password:please

I am trying to automatize the download of one of the files via wget.
I' m using keep-session cookies along with --load-cookies and
--save-cookies before each request, yet what I'm getting back is
always the log-in form.

I think if you look at the source (log-in form) there' s a "session
token" there, apparently handled via Javascript.

Just to make sure the web server is not discriminating against wget, I
also used --user-agent matching that of Firefox 13 for Linux.

Here' s my script, and you'll see quickly that it doesn't work:.

/////
#!/bin/bash
# User-agent: for FF13 is "Mozilla/5.0 (X11; Linux i686; rv:13.0)
Gecko/20100101 Firefox/13.0"
#
# get the log-in screen
wget --unlink --user-agent="Mozilla/5.0 (X11; Linux i686; rv:13.0)
Gecko/20100101 Firefox/13.0" --load-cookies=cookies.txt
--save-cookies=cookies.txt --keep-session-cookies --http-user=bugmenot
-http-passwd=please
http://ginga.lavid.ufpb.br/login?back_url=http%3A%2F%2Fginga.lavid.ufpb.br%2Fprojects%2Fopenginga%2Ffiles
#
# post user and password
wget --unlink --user-agent="Mozilla/5.0 (X11; Linux i686; rv:13.0)
Gecko/20100101 Firefox/13.0" --load-cookies=cookies.txt
--save-cookies=cookies.txt --keep-session-cookies --http-user=bugmenot
-http-passwd=please --http-post
"http://ginga.lavid.ufpb.br/login?back_url=http%3A%2F%2Fginga.lavid.ufpb.br%2Fprojects%2Fopenginga%2Ffiles";
--post-date="username=bugmenot&password=please"
--referer="http://ginga.lavid.ufpb.br/login?back_url=http%3A%2F%2Fginga.lavid.ufpb.br%2Fprojects%2Fopenginga%2Ffiles";
#
# now I should have the log-in credentials, get the files list (just in case)
#
wget --unlink --user-agent="Mozilla/5.0 (X11; Linux i686; rv:13.0)
Gecko/20100101 Firefox/13.0" --load-cookies=cookies.txt
--save-cookies=cookies.txt --keep-session-cookies --http-user=bugmenot
-http-passwd=please
"http://ginga.lavid.ufpb.br/projects/openginga/files";
#
# now get the file I want
#
wget --unlink --user-agent="Mozilla/5.0 (X11; Linux i686; rv:13.0)
Gecko/20100101 Firefox/13.0" -c --load-cookies=cookies.txt
--save-cookies=cookies.txt --keep-session-cookies
"http://ginga.lavid.ufpb.br/attachments/download/475/deps-openginga-source-v0.4.3.tar.gz";
--output-document=deps-openginga-source-v0.4.3.tar.gz

////

Thanks in advance for any assistance you can provide.

FC

-- 
During times of Universal Deceit, telling the truth becomes a revolutionary act
Durante épocas de Engaño Universal, decir la verdad se convierte en un
Acto Revolucionario
- George Orwell



reply via email to

[Prev in Thread] Current Thread [Next in Thread]