Monday, March 2, 2009

Rapidshare automatic download script for free users

Recently, rapidshare has removed captcha protection from their website and this makes it much easier to automate downloads from rapidshare.

Here is a little script i've cooked up which is available for Windows and Linux(for the Windows script it uses UnxUtils which is a win32 port for some essential linux apps, don't worry i've included the necessary binaries in the package).

Here's a Windows screenshot:



Linux screenshot ;) :



Links Updated! 3 July 2010
Version 1.5 released!
Premium support added 

(Thanks to all those who contributed, especially Tavva Capoblud)

Occasionally, rapidshare may change the way their website works and this script might stop working, but for now it works without problem!
No longer works...

Installing:
Linux
For linux users, this is just a simple bash script. Just do the following to set it up:
unzip rsdown_linux.zip
chmod +x ./rsdown_linux/rsdown.sh

Note that you need to have the following tools installed(which are installed by default most of the time): cat,cut,gawk,grep,sleep,wc,wget

Windows
For Windows users, extract the package, and navigate to the rsdown_win folder. then:
1. right-click on rsdown.sh
2. choose Open with -> Browse to the rsdown_win\bin\ folder
3. choose sh.exe, and press ok

Running:
Now, you can add your rapidshare downloads to the dllist.txt file and do:

Linux
cd ./rsdown_linux/
./rsdown.sh

Windows
double click on rsdown.sh (inside rsdown_win folder)

Downloads will be stored in the dls/ folder.

The script will automatically start the downloads in the list, and even if the DOWNLOAD LIMIT has been exceeded, it will wait and retry until it can download the other files.

If any problem occurs or you like it or have any suggestion, don't hesitate to post a message! Hope you enjoy it.

Changelog:
Version 1.5
3-JUL-2010
sniper11:
- Tiny bugfix, added the -c switch to wget when using premium account to resume downloads
Version 1.4                                                                                  
23-JUN-2010
sniper11:
- Rapidshare premium support added - account details are stored in premium.conf
- comments allowed in dllist.txt: lines starting with #
- PATH configured automatically on Windows, no need to change via System->Environment variables
- Added $OS variable, for compatibility with both Windows and Linux in a single script
- Some bugfixes/more meaningful variable names
Version 1.3
12-APR-2010
Tavvva:
- reworked to prevent fast looping / out of order downloading when any problems appear ...
- 3 min delay added between the particular retries to prevent overloading of the server with unsuccessfull download requests
13-APR-2010
Tavvva:
- download status checking to prevent failures of the script execution when the main wget fails (the consequent changedir is not skipped and the script can retry the download)
- link counter fix
22-APR-2010
Tavvva:
- number of wget internal tries set to 1 (fixes "download session expired" states when the download is interrupted in the middle)
- tools presence checking (as suggested by "Anonymous")

76 comments:

  1. Good idea but if RS block your IP can't download it.

    ReplyDelete
  2. Yea you're right, the script is just simulating a user browsing the rapidshare website, so if RS blocks you, you won't be able to download.

    Anyway Thanks for testing, please report any bug!

    //sniper11

    ReplyDelete
  3. Could you put the Linux script on different source please ?
    I need to download something from rapidshare and for that I need to download the scriupt from rapidshare - undefinite loop ?

    Thanks

    ReplyDelete
  4. Yeps, it's an infinite loop. Of course you can modify the script to do something when every link has been downloaded.

    Here's a direct link :) Enjoy XD

    http://0x1337.netne.net/rsdown_linux.zip

    Thanks for trying it out. Please report any bug!

    ReplyDelete
  5. that file doesn't work...
    it's not nicely uploaded

    ReplyDelete
  6. When you don't know how to use it, doesn't mean it doesn't work..

    ReplyDelete
  7. http://ox1337... works but you have to unzip it with unzip tool:)

    nice script sniper11

    ReplyDelete
  8. nop! You're right!

    Bad CRC while downloading from this url - sniper11 reupload it please.

    From RS is OK.

    ReplyDelete
  9. ook, it's my fault, sorry for my harsh words, didn't even check the 0x1337 link :(

    ReplyDelete
  10. Working now : http://0x1337.netne.net/rsdown_linux.zip

    ReplyDelete
  11. Hello

    could you please let me know if this can ru n reconnect script .bat file so that i can change my pc's ip address and download next rapidshare file without waiting for period

    thank you

    ReplyDelete
  12. Do you mean that you've got the .bat file which reconnects and you want to put it in the program?
    If yes, then you can just open rsdown.sh then just below "Download limit exceeded,will..." put down the name of the batch file, e.g "reconnect.bat"

    Else you can just use JDownloader, which is an excellent tool.
    Hope that helps.
    //sniper11

    ReplyDelete
  13. What about the waitting time ...
    After downloading a 200MB file it will ask 15 min delay time after that i will show count down time arount 140 sec After that only we can download the file ....


    is it possible to download the file using this script...

    ReplyDelete
  14. Yeps it's possible. Actually the script has been designed for this, i.e it will work only for free users, not for premium accounts.

    ReplyDelete
  15. Thanks, this is a cool script....

    ReplyDelete
  16. Hello sniper 11

    I need your help

    I'm using windows 7 as OS

    Could you please let me know on how to use this
    software in steps

    so that I can make use of your software

    thanks for your help

    ReplyDelete
  17. Sorry friend, I don't have Windows 7, I can't give you exact details.

    However the basic steps should be the same:
    1. Add the "rsdown\bin" folder in the PATH variable (Try finding Environment variables in Control Panel->System)

    2. Open rsdown.sh with sh.exe (which is in the bin folder)

    If anyone has got it working with windows 7 please post here. Thx.

    ReplyDelete
  18. Holy cow, exactly what I've been looking for ages! Thanks a million man!

    ReplyDelete
  19. Lol, no problem, and what's even cooler is that you can do it in only 3kb XD

    ReplyDelete
  20. Download limit time out is 15 minutes so if you set it to that, it need retry only once. Abe

    ReplyDelete
  21. Yeps, u're right, you can set it to 15mins so it doesn't have to retry unneccessarily. I'll update it soon when i have time.

    Thanks

    ReplyDelete
  22. Congratulations. Nice tool.

    It would be nice to add these code in the start of your Linux script

    for tool in cat cut gawk grep sleep wc wget; do
    if ! type $tool >/dev/null 2>&1; then
    echo "Critical ERROR : \"$tool\" not found in your system."
    exit 2
    fi
    done

    These way when someone doesn't have all the prerequisites it wont start the script showing the respective message.

    ReplyDelete
  23. Thanks, excellent suggestion!
    I'll add this soon a new version :)

    ReplyDelete
  24. Tried it out last night. It worked wonderfully on my FC3 installation. Congratulations ! Abe

    ReplyDelete
  25. How do you append the path in Environment folder if I have the main folder sitting on my desktop. thanks

    1. Add the "rsdown\bin" folder in the PATH variable (Try finding Environment variables in Control Panel->System)

    ReplyDelete
  26. Whe nI go to Environment Variables of XP and VIsta I founf to variables USer and System variables. now where do I add this and what should i put in "Varialble" and what to put in "Value"

    Pl. forgive my ignorence and advise so.

    Thanks

    ReplyDelete
  27. can i make the code stop and close completely after each download?

    ReplyDelete
  28. Hi there. In the "User Variables" section, there should be a Variable named "PATH", if not create it. Then the VALUE of the variable should be something like that(if it's on ur desktop):
    "C:\Documents and Settings\Your_User_Name\Desktop\rsdown\bin\"

    Replace Your_User_Name with your user name(Browse the Documents and Settings folder to get it)

    Hope u get it working.

    ReplyDelete
  29. Yea, you can make the code stop, but you'll need to modify the code.

    You could add a variable named "dcount" which increments only when a file is being downloaded(not skipped). Then at the bottom before "Waiting for 5 mins...", just do a check, if dcount=0, then break.

    ReplyDelete
  30. Thanks sir. it is working without any problem after I created path in my "User Variables".

    Thanks a lot..

    ReplyDelete
  31. i am using windows 7,

    this is not working..... please fix this in windows 7. please dear

    ReplyDelete
  32. Wonderful work thank very much

    In Windows 7 can use with the portable ubuntu.

    With the script for linux

    http://portableubuntu.demonccc.com.ar/en/project

    The password for the pubuntu user is 123456. It is useful know it when you need to use sudo or gksu applications (Administrative/System tools).

    ReplyDelete
  33. In Windows 7 use with the portable ubuntu.

    http://img138.imageshack.us/img138/8762/captura2.png

    ReplyDelete
  34. Hello sir,

    please update the program to work directly in windows xp and 7.

    ReplyDelete
  35. ====================RAPIDSHARE MASS DOWNLOADER===================
    =========================by $n!p3r11=============================
    -Add any file to be downloaded to the dllist file
    LINK NO #1 :http://rapidshare.com/files/xxxxxxx.rar

    abnormal program termination
    I:\Downloads\rsdown\rsdown_win\rsdown.sh: fork failed: no error [10]
    I:\Downloads\rsdown\rsdown_win\rsdown.sh: parse error: condition expected: -ne [
    10]
    Skipping, already downloaded...

    LINK NO #2 :http://rapidshare.com/files/XXXXXxxxxxxxxxx.rar

    abnormal program termination

    ReplyDelete
  36. Rapidshare appear to have changed something in the new year, this script (which I've been using for a month or two - thanks BTW, it's awesome) now only appears to download files that are 7KB 'big'. If I use a browser the problem doesn't exist, though if I try the script on the same file it will download a very small file instead of the intended file.

    I've been playing around with specifying headers and user agents with Wget but haven't found the fix. Have you happened to stumble across it?

    ReplyDelete
  37. Great work man... u're the best :P

    Roshan

    ReplyDelete
  38. I'm constantly getting an error that either "Too many users are downloading..." or that "an error has occured" - is there something that has been changed by rapidshare and which has to be updated ?

    ReplyDelete
  39. This is very nice, thank you so much. So awesome, too, that I went from thinking "I ought to figure out how to put together a script to download this list of files from rapidshare" to thinking "I bet someone's already done it" to hitting google and finding it, all within maybe two minutes.

    ReplyDelete
  40. Might be just me, but on my FreeBSD system the scripts fails to work with newer versions of WGET. Went back to WGet 1.10.2 and all problems that I used to have with newer releases dissapeared. Odd...

    Also I modified RSDOWN.SH to let WGET use IE's useragent string (maybe I'm too paranoid, but I think RS might ocasionally cause the download to fail when non-interactive programs are used), added a check for "removed from the server" text (which is in some situations given instead of "file not found" text) and let the link which has been deleted add to a textfile (so there wouldn't be any surprises as to why some file is missing).

    Anyway, great tool which seems to be the only one that works on a GUI-less PC under FreeBSD (slimrat is another that I tried and that gave only errors). Thanks for developing it!

    ReplyDelete
  41. @CyberRax and others: Please post your enhancements/hacks somewhere so that we can all benefit! Cheers

    ReplyDelete
  42. Hello guys ...

    I reworked the script a bit in order to prevent some problems with retries and added a changelog ...

    Thanks sniper11!!! It's a nice and useful tool!!!

    LINK:
    http://tavvva.net/files/rsdown_linux_tavvva.zip

    CHANGELOG:
    ============
    - reworked to prevent fast looping / out of order downloading when any problems appear ... 3 min delay added between the particular retries to prevent overloading of the server with unsuccessfull download requests
    - download status checking to prevent failures of the script execution when the main wget fails (the consequent changedir is not skipped and the script can retry the download)

    ReplyDelete
  43. Hello guys, thanks for your thanks :P

    Sorry, really busy lately and didn't have time to update the scripts :(

    Good job Tavvva Capoblud for the updated script, i'll check it out ;)
    Any other updates from all of you are welcome!

    ReplyDelete
  44. Actually I somehow forget to reimplement the link counter ... It's just a cosmetic detail, but I will do that soon ...

    ReplyDelete
  45. Nice script :) gz

    Can you make 1 for storage.to?

    ReplyDelete
  46. New fixes introduced in v1.3

    http://tavvva.net/files/rsdown_linux_tavvva.zip

    - number of wget internal tries set to 1 (fixes "download session expired" states when the download is interrupted in the middle)
    - tools presence checking (as suggested by "Anonymous")

    ReplyDelete
  47. Good job friends.
    Tavvva, why do you implement the CyberRax suggestion?
    Let WGET use IE's useragent string or other string like mozilla, etc.... to improbe the script.
    What do you think?

    ReplyDelete
  48. hiii ..
    whn i m using sh.exe its showing some prob..
    its showing tht " abnormal program termination ...
    nd one window is open and its showing tht sh.exe has stoped working ..
    check online for a solution and close the program...

    ReplyDelete
  49. hiii ..
    whn i m using sh.exe its showing some prob..
    its showing tht " abnormal program termination ...
    nd one window is open and its showing tht sh.exe has stoped working ..
    check online for a solution and close the program...

    ReplyDelete
  50. Well ... I thought that guys could change the script by themselves and put their nicks and descriptions of changes made in the changelog ... Maybe I am too affected by so called "Open Source Community" :D Let's build the great thing together!

    ReplyDelete
  51. Cool :P Let's do it then :)

    ++=urgent
    +=less urgent

    Some things that can be done:
    ++Add premium support (is that really needed?) (via swithes: --username= --password=)
    ++Choose better windows binaries(the windows binaries for the linux tools are not stable, especially sh.exe)
    ++Support for windows 7,vista.(this will depend on the windows binaries chosen for the equivalent to linux tools)
    ++Configure path variable automatically, no need to modify environment variables on Windows.
    +Use better regexs to anticipate changes that could make the script stop working if there are changes to the rapidshare website
    +An update system which wgets a new version of the program & replaces rsdown.sh by new one?
    +Allow comments(starting with #) in the dllist file (to remember the passwords of the download file)

    Any other suggestions?
    All this can be done within one week. Let's get to work. :)
    Post your code snippets here itself, or zip it, i'll integrate with the main version.

    ReplyDelete
  52. DONE: Configure path variable automatically, no need to modify environment variables on Windows.
    OK, NOT NECESSARY:Use better regexs to anticipate changes that could make the script stop working if there are changes to the rapidshare website
    DONE:Allow comments(starting with #) in the dllist file (to remember the passwords of the download file)

    ReplyDelete
  53. DONE: premium support added

    Well some hours were enough to integrate these changes :)

    TODO:
    +Automatic Update system
    +Support for windows vista/7 (i don't know yet why it's not working, don't have a 7/vista system)

    Will upload the updated version soon.

    ReplyDelete
  54. New version 1.4 released :) Thanks Tavvva for boosting my adrenaline & give me courage to update the script :P

    ReplyDelete
  55. Fantastic work!!! You changed my life. Many many thanks.

    ReplyDelete
  56. lol no problem :D I'm happy you like it :)

    Actually there's a tiny bug when resuming downloads using a premium account. You can fix it by adding the "-c" switch to rsdown.sh(open it using notepad) at line 171 like this:
    wget -c -t 3 $final_link --load-cookies ../premium.cookies --keep-session-cookies

    I'll update the script soon, it's just a minor change..

    ReplyDelete
  57. This comment has been removed by the author.

    ReplyDelete
  58. hey guys, i was wondering if we could modify the script so instead of waiting 3minz it could telnet to my router and reboot, (dynamic ip).... the script that i have is pretty simple.

    #!/usr/bin/expect -f
    spawn telnet 192.168.1.254
    expect -re "Username :"
    send "Administrator\r"
    expect -re "Password"
    send "password here\r"
    expect -- ""
    send "system\r"
    expect -- ""
    send "reboot\r"
    interact

    ReplyDelete
  59. Hello :)
    You can easily do this:
    Copy your script to another file,e.g reset.exp
    Then copy this file to the same folder where rsdown.sh is found.
    Then run this command from the terminal:
    "chmod +x ./reset.exp"

    Then at line 103 in rsdown.sh(on the line after "retry=1"), just add this line of code:

    ./reset.exp

    Now every time it will try another link, your router will be reset :)
    Hope this helps!

    ReplyDelete
  60. awesome thanks for the reply. lol i achieved it with some help of a mate, lol did exactly what u did. lol only if i the post was up early. lol alg , but thanks anyway friend

    ReplyDelete
  61. Not using the latest version (made some adjustments for my system and have been too lazy to port those into the latest), but it as of today ain't working anymore. RS has redesigned their website completelly, hence the program ain't finding the strings it's looking for in the downloaded HTML...

    ReplyDelete
  62. Hi CyberRax,
    Thanks for your feedback!
    I'll redesign the script as soon as possible :)

    ReplyDelete
  63. Damn rapidshare change the page desighn :(

    ReplyDelete
  64. This script was awesome, we need it working back again!!

    ReplyDelete
  65. If somebody have working script with changed RS please show link for download. Thanks

    ReplyDelete
  66. Is anybody working on a new version?

    ReplyDelete
  67. Linux users can try Plowshare
    http://code.google.com/p/plowshare/wiki/Readme

    ReplyDelete
  68. Plowshare works and it's great.
    Help for installation:
    "plowshare 0.9.3 does not work with Rapidshare, they recently changed the login process, you need to use the repository source (subversion). See this page:
    http://code.google.com/p/plowshare/source/checkout
    $ svn checkout http://plowshare.googlecode.com/svn/trunk/ plowshare
    $ cd plowshare
    $ sudo bash setup.sh install
    "

    ReplyDelete
  69. Nice stuff ,Great review as always thanks for sharing information .

    ReplyDelete
  70. You can also give a try to : http://code.google.com/p/slimrat/

    ReplyDelete
  71. Aww come on! No fair announcing this before we can actually use it!

    ReplyDelete