Download Rapidshare files from Linux Shell Command Line

by Strider on April 30, 2009

in Tips 'n' Tricks

I was looking for a way to download files from Rapidshare in my Linux (CentOS) server. Since I have a Rapidshare premium account the tool should support it and it should work from Linux shell (it’s a server, so no GUI). So here is two tools I found in my search.

Just now I found out a few articles explaining the use of wget and CURL to download files as a Rapidshare Premium user. So here is an update.

Use Wget to download Rapidshare files

Even though it’s a command line tool, wget supports saving and loading cookies. As you know to download Rapidshare links directly, the premium user should log in at least once and the Direct Downloads must be enabled.

First of all create a directory to download the files and cd to that directory and create a directory named .cookies in that. Use the following command for saving the premium cookie in your linux box.

wget --save-cookies .cookies/rapidshare --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null

The USERNAME & PASSWORD are off course the rapidshare premium login credentials. A premium cookie will be set in the file rapidshare in our cookie jar folder .cookie.

Now use the following command to download the files:

wget -c --load-cookies .cookies/rapidshare http://rapidshare.com/files/123456789/myfile.zip

the argument -c enables the resume support.

Download from Rapidshare using Wget

Use CURL to download from Rapidshare

This is exactly same as the Wget method. So the commands are shown below:

To set the Rapidshare Premium cookie:

curl --cookie-jar .cookies/rapidshare --data "login=USERNAME&password=PASSWORD" https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null

If you get an SSL Certificate error as the one quoted below use the -k switch in the above command to disable certificate validation.

curl: (60) SSL certificate problem, verify that the CA cert is OK.

Now for downloading:

curl -L -O --cookie .cookies/rapidshare http://rapidshare.com/files/123456789/myfile.zip

Rapidshare download curl

gRapid

gRapid allows premium users of RapidShare to automate downloading of files without having to attend to them. It relies on Java and GNU Wget to process downloads from a file containing Rapidshare links, one on each line. It can perform simultaneous downloads of any number you may desire.

Few caveats with this release:

  • You must have JRE 1.5+ installed (in short, the java command should work)
  • gRapid should be able to find the Wget binary (this is included for Windows)
  • A default ‘Downloads’ directory (already created) must exist, as this is hard coded (!)
  • If you queue more than one download, Wget writes all it’s verbose output to a single output file, which (due to lack of file locking) can be quite messy
  • Doesn’t warn you if links provided in the input file are not present, i.e. not found on Rapidshare or deleted, etc.

Usage: java -jar gRapid.jar username password input_file simultaneous_downloads

In the above command line username & password means your Rapidshare premium account username and password, input_file is a text file with the rapidshare links one per line, simultaneous_downloads means the number of files to downlaod at a time.

e.g. java -jar gRapid.jar jade 6a%d*4s input.txt 8

It’s a good tool, the only problem is you need messy JRE installed in your Linux machine.

rapidshare-dl (Rapidshare Download)

rapidshare-dl (Rapidshare Download) is a program which helps downloading files from Rapidshare using a Premium Account. The files to download can be specified as parameters, or they can be retrieved from a local file, an URL or from the clipboard.

They have a compiled Debian package available or you can install it from the source.  A simple usage example is:

rapidshare-dl links.txt

This tool is a bit old and I haven’t tested it personally. So it may not work now.

And finally if you have a linux box with KDE or GENOME installed there is lot of graphical options. I prefer Flashgot plugin for firefox.

Related Articles:

  • Recursively change only directory permissions on Linux (Chmod)
  • Remove Unwanted Windows Shell Extensions using ShellExView
  • RS Downloader 2.1- Easy Downloading from Rapidshare
  • FTP2Share – Upload your files to File sharing sites Via FTP!
  • How to Remove / Delete .NET assemblies from GAC (Global Assembly Cache)
  • { 7 comments… read them below or add one }

    Ali June 21, 2009 at 6:16 am Thumb up 0 Thumb down 0

    You’re a life saver, thanks.

    Reply

    IzzY December 28, 2009 at 12:25 am Thumb up 0 Thumb down 0

    I was wondering how to do the same thing. I have mad a very simple script that will allow you to D/L from RS with very minimal effort:

    #!/bin/bash
    nano .wget-list;
    for i in `cat .wget-list` ;
    do wget -c –auth-no-challenge –http-user=**yoursername** –http-password=**Your password** $i ;
    done ;
    > .wget-list

    what this does is opens a file (.wget-list) and lets you add your links. it will then download each link with resume capability and after it is done, it will clear the list.

    if you cancel ( Ctrl+C ) you will not lose any of the links that you put into wget-list but when you re-run the script, it will pick up where it left off.

    you need to create the file .wget-list in the same dir as the scirpt and you must have premium UN and PW for rapidshare.

    hope this helps.

    **Thanks to NAS for the help**

    Reply

    Ammat Manka January 9, 2010 at 4:55 am Thumb up 0 Thumb down 0

    Tres useful. Handy for transferring files when FTP is unavailable.
    Anyone figured out a good way of grabbing the rapidshare links though?
    ATM we have to start downloading in firefox then right click on download window and select “copy download link” which is lalalalalonglongleelonglonglong!
    How can I do it a quicker way?

    Reply

    TZ March 7, 2010 at 4:19 am Thumb up 0 Thumb down 0

    Very useful tips. Another thing I do when you have a large list i use the split command on the text file so that you can download many simultaneously
    eg.

    split –lines=10 rsfiles # 10 is the number of simultaneous downloads
    ls -1 x* rsfiles > wget-list

    from Izzys script

    do wget -c –auth-no-challenge –http-user=**yoursername** –http-password=**Your password** $i & ; # added & puts wget in background

    Reply

    Anirban June 12, 2010 at 10:17 am Thumb up 0 Thumb down 0

    thanks for dos commands.

    Reply

    seospidy August 22, 2010 at 1:11 am Thumb up 0 Thumb down 0

    Awesome post very cool stuff you have done great job buddy thanks for helping me.

    Reply

    Grex September 3, 2010 at 2:55 pm Thumb up 0 Thumb down 0

    Not working for me, I tried wget, the gRapid and rapidshare-dl :(
    I use premium account, but the downloaded files have 54 KB always.

    Reply

    Leave a Comment

    Previous post:

    Next post: