Solved

Downloading content using wget

Posted on 2004-08-12
6
4,808 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

688 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