Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

wget is a very useful tool to download stuff on the internet quickly, but can I use it to download from hosting sites, like FreakShare, Depositfiles, Uploaded, Rapidshare? If so, how can I do that?

share|improve this question
Don't most of those sites tend use javascript and other barriers to eliminate linking directly to the files? – Tim Jul 13 '12 at 17:08
@Tim I think you are correct, because it's impossible to get a direct link from those sites. – Zignd Jul 14 '12 at 14:54
@swift Could you please translate it to english and post on pastebin or somewhere else – Zignd Jul 14 '12 at 18:20

3 Answers 3

up vote 8 down vote accepted

This kind of site tries to make it difficult not to use a graphical web browser, because if you use wget you'll be missing all these ads that pay for the bandwidth.

Some sites don't make advanced checks and can be tricked easily: tell wget to pretend that it's really Mozilla and that it's coming from the download site.

wget --user-agent='Mozilla/5.0 (Windows NT 6.0) Gecko/20100101 Firefox/14.0.1' \

Most sites that check let you get away with --user-agent=Mozilla and --referer set to the URL of the file you're downloading.

With some sites, you might need to export the web browser cookies and pass --load-cookies to wget; at this point using wget starts to be more work than a manual download. The ultimate method, which can work all the time but requires some coding for each site, is to use a browser automation framework such as Selenium or Watir.

See also Does anybody here have experience in automating some tasks in web applications using curl?

share|improve this answer
Awesome! Your answer helped me write this for Zippyshare Links: – Sheharyar Jan 13 '14 at 20:23

For Zippyshare:

This method builds up on Gilles' answer. Like he said, the trick is to make the server think that the request is being made from a browser and to make that happen, you need a couple of things:

  • The Download Link (The actual link to the file)
  • Link Referrer (The webpage with the download button)
  • Zippyshare Session ID (Found in Cookies)

Here's a screenshot explaining where you can get each item:

Download From Zippyshare

Now open up your terminal, and use the following command (replacing necessary items):

wget <download_link> \
--referer='<referrer>' \
--cookies=off --header "Cookie: JSESSIONID=<session_id>" \
--user-agent='Mozilla/5.0 (Windows NT 6.0) Gecko/20100101 Firefox/14.0.1'


wget \
--referer='' \
--cookies=off --header "Cookie: JSESSIONID=26458C0893BF69F88EB5743D74FE0F8C" \
--user-agent='Mozilla/5.0 (Windows NT 6.0) Gecko/20100101 Firefox/14.0.1'

Note: In the command, it is in fact referer not referrer

share|improve this answer
I'd just like to add that Sheharyar uses Firebug in this screenshot. This is to everybody (including me) who tried to do this in Inspector (which is unfortunately not possible). – syntaxerror Jun 8 at 16:11

I also would like to above perfect answers, I used following trick for downloading a child movie for my son from Turbobit:

Instead of SESSION_ID from above answer, you need to find "compid" from the cookie tab of FIREBUG:

enter image description here

After that, the command for my debian embedded system was soo easy:

wget --referer='http://' --cookies=off --header "Cookie: compid=c9255510c34624435292d8a0e7e405be66aa01f9%7ED01343F87AB53A2C38D957A564DA1D55" --user-agent='Mozilla/5.0 (Windows NT 6.0) Gecko/20100101 Firefox/14.0.1' &

I can shut down my computer now :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.