Solved

Downloading content using wget

Posted on 2004-08-12
6
4,796 Views
Last Modified: 2012-06-27
I subscribe to a monthly-pay multimedia content provider.  This site hosts a large collection of content I'd like to download, but tends to be very slow - manually downloading is a poor option.  I have attempted to use wget to download content, but I always get a 302 redirect instead of the content I'm trying to download.

here's the script I'm using -

wget --load-cookies="administrator@site[2].txt" --load-cookies="administrator@www.site[1].txt" --load-cookies="administrator@site.txt" -np -erobots=off -t10 -w2 --random-wait --waitretry=7 -U "Mozilla/4.03 [en] (X11; I; SunOS 5.5.1 sun4u)" -k --http-user=Mylogin --http-passwd=Mypassword --proxy-user=Mylogin --proxy-passwd=Mypassword -nv -A\*\.\* VideoName

The cookies were generated by logging in through IE.
The login and password work fine through IE/Opera.

Any suggestions on how to get this to work ?

Thanks.

- The site does not mind bots downloading content.





0
Comment
Question by:JaffaKREE
6 Comments
 
LVL 10

Expert Comment

by:frugle
ID: 11797402
looks interesting... I take it you have to login with cookie to get to the content.

are you specifying the full pathname to the cookie or have you copied it into the working directory?

I don't recognise (without the manpage) some of the options, are you -m mirroring the content?

Mike
0
 
LVL 6

Author Comment

by:JaffaKREE
ID: 11803360
Yes, I have copied the cookies over.  I wasn't using -m, I'm just trying to hit one file right now.

if I log in through IE I can bounce page-to-page until I close the browser.  Then I need to log in again.

I figured logging in to IE, copying the cookie, and using it in the wget script without closing IE would allow me to mimic the IE session.  I'm using the IE user-agent string now, but I'm still getting a 302 redirect.

Ideas ?

0
 
LVL 10

Accepted Solution

by:
frugle earned 500 total points
ID: 11803897
Looking a little deeper into it, which you probably have so stop me if I'm giving the old egg-sucking lessons...

--load-cookie seems to work best with netscape cookies - if you've exported your cookie using IE's import/export cookie routine it *may* work, or may not, but copying the cookie file in IE's native format probably won't. Getting the 302 adds weight to this.

What you CAN do as a workaround is manually add the cookie to wget using the following arguments:

wget --cookies=off --header "Cookie: name=value"


If you:

 --save-cookies file

it may give you a better idea of the format your cookie file needs to be in.

good luck,

Mike
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 3

Expert Comment

by:gnudiff
ID: 11892521
1. While you are testing with single file download, perhaps it'd be better to remove -A option.
2. Assuming that authentication works, the 301 response seems to indicate that the video file is accessed differently - perhaps not via its name but via page script that gets passed the name as a parameter.  If you turn off the quiet mode of wget, perhaps you can see where you are being redirected?
0
 
LVL 3

Expert Comment

by:gnudiff
ID: 11892536
Oops, misread the code.
302 means that actually the video IS under a different name probably, so you should see the Location: header you are getting?
0
 

Expert Comment

by:eucoders
ID: 13719889
There is an issue regarding the referer thing as well.

Usually the easiest and quickest way to block bots is to do a very good referer thing as many browsers today support referer url.

For example, if you are the webmaster, and you know that the videos are available as links on page1 and page2, you can do a filter in apache to allow downloading only from those pages, and not others.

Many bots forget to put the right url as referer, when downloading images, etc.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now