Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
question regarding use of wget...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
talz13
Tux's lil' helper
Tux's lil' helper


Joined: 08 Oct 2004
Posts: 77

PostPosted: Wed Jan 04, 2006 7:21 pm    Post subject: question regarding use of wget... Reply with quote

Wasn't sure exactly where to put this, but networking looked like the best place.

I'm trying to use wget to download from a site. This site has a password login (login.php), and most likely uses cookies to store your login. The problem is, the downloads I want to get are not straight .zip or anything files, but rather php links. I've tried various options, using this as my last attempt at downloading it:

Code:

#! /bin/sh
wget --keep-session-cookies --save-cookies cookies.txt --post-data 'username=******&password=******&login=login' http://www.mangadownload.net/login.php?a=login
wget --load-cookies cookies.txt -r -l3 --no-parent http://www.mangadownload.net/manga.php


But it seems to not find the files that I was trying to download, but gets the rest of the site fine. I tried increasing the -l argument, but that just started running over other sites instead, following their links.

If I shouldn't be asking about this for any reason, feel free to delete this post :oops:
_________________
Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer
Back to top
View user's profile Send private message
koenderoo
Guru
Guru


Joined: 03 Jan 2004
Posts: 514
Location: Zwolle, The Netherlands

PostPosted: Thu Jan 05, 2006 2:58 pm    Post subject: Reply with quote

sorry for asking, but are you sure that file is at that location?
Otherwise the file restriction are set to good and your login don't have rights enough to perform the operation.
Back to top
View user's profile Send private message
talz13
Tux's lil' helper
Tux's lil' helper


Joined: 08 Oct 2004
Posts: 77

PostPosted: Thu Jan 05, 2006 3:50 pm    Post subject: Reply with quote

That's the issue, the links on the site are just php arguments. And the links are only active after login. Here's a sample link for a download that I just copied off of the site, that I just clicked and downloaded a file from:

http://www.mangadownload.net/manga.php?a=series&sid=124&sa=download&fid=2785

.... I found one problem with my attempt: When the save file dialog opened, it said from: http://fileserver2.mangadownload.net Could the site be using cookies stored from your login to allow access to the file, or could the links just be hardcoded to allow access, as you have to be logged in to access the link?

I don't want to run too many partially successful wgets on the site, cuz I'm not trying to steal all its bandwidth, I just want one good run :wink:
_________________
Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer
Back to top
View user's profile Send private message
koenderoo
Guru
Guru


Joined: 03 Jan 2004
Posts: 514
Location: Zwolle, The Netherlands

PostPosted: Fri Jan 06, 2006 7:42 am    Post subject: Reply with quote

First of all: I'm not a website programmer and know to little about it, but what I think is happening is that the website your trying to wget is just the portal to a database controlled by either your login settings, or controlled by the operators.
From my limited point of view I would say it's impossible to get the files you want because of this database.

I'm not into webbased databases so I can't help you any further, sorry!
Back to top
View user's profile Send private message
evan18h
Tux's lil' helper
Tux's lil' helper


Joined: 02 Dec 2004
Posts: 83

PostPosted: Fri Jan 06, 2006 9:39 am    Post subject: Reply with quote

Seems like they are using PHP to redirect the page to a database value containing the download, in turn using a PHP function like header("Location: filename.ext"); to initiate the download.

This is a simple way to track downloads or change the paths using a database.

The only way to have wget download the file, since PHP is server-side where the location is hidden until the download starts, is start the download....
then while it is downloading (if you are using firefox) you could right-click the download on the progress menu, hit properties and the 'From' text box
should contain the full download path... where you can now do a wget -c filename.ext to continue downloading the remaining file.
_________________
A day without sunshine is like night.
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Fri Jan 06, 2006 11:27 am    Post subject: Reply with quote

You could also try to use links2 or a different text-browser to download the files.
(I take it that you don't have X running and therefore have to resort to a non-graphical
programm to download those files. If you specifically need to use wget than just disregard my post.)
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
talz13
Tux's lil' helper
Tux's lil' helper


Joined: 08 Oct 2004
Posts: 77

PostPosted: Fri Jan 06, 2006 3:54 pm    Post subject: Reply with quote

Proteus wrote:
You could also try to use links2 or a different text-browser to download the files.
(I take it that you don't have X running and therefore have to resort to a non-graphical
programm to download those files. If you specifically need to use wget than just disregard my post.)


I am running gnome, but I was just familiar with wget from using it before. If there are any other apps that could get the job done I'd be happy to try them out :D
_________________
Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Fri Jan 06, 2006 4:03 pm    Post subject: Reply with quote

Doesn't gnome contain some sort ov webbrowser? That should be the easiest way, I think.
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
talz13
Tux's lil' helper
Tux's lil' helper


Joined: 08 Oct 2004
Posts: 77

PostPosted: Fri Jan 06, 2006 4:50 pm    Post subject: Reply with quote

Proteus wrote:
Doesn't gnome contain some sort ov webbrowser? That should be the easiest way, I think.


Haha, I'm fine just downloading the file individually, but since I was going to be downloading many files, I wanted to try getting them in a batch script. That's my problem.
_________________
Gentoo 2004.2 2.4.26-gentoo-r9 kernel
AXP 2100+
epox 8k5a3+
1024mb pc2100
120gb WD SE
GF4 TI4400
SBLive! x-gamer
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Fri Jan 06, 2006 6:18 pm    Post subject: Reply with quote

Damn, I really should read people's posts more carefully :oops:
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum