RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Rapidshare wget direct download and Linux

Article Index
1. Set rapidshare direct download to ON
2. Create a rapidshare authentication cookie
3. Download from rapidshare using authentication cookie and wget
4. Rapidshare wget automated bash script
5. wget rapidshare download all in one

This article explains how to download files from a rapidshare using a linux wget command line tool. Note that RapidShare Premium account is required in order to use wget for a rapishare download .

Using a wget to download from a rapidshare allows you to download multiple files in a single session using simple bash script. It also can be said, that using a bash script and wget to download rapidshare files is somewhat a cheap replacement of jDownloader tool.

This article will start by guiding a user to set a rapidshare account to allow rapidshare direct downloads. In the next step we will create a rapidshare authentication cookie which will be used to authenticate a user when downloading by wget. In the last step we will create a simple bash script to automate the whole process.

1. Set rapidshare direct download to ON

Direct download from rapidshare requires to set rapdishare direct download to ON, so start up your browser, login to rapidshare and set Direct download to ON.

In your web rapidshare account navigate to:

My RapidShare->File Manager->Download Settings->Direct Downloads-> ON

Wget rapidshare direct download

 

2. Create a rapidshare authentication cookie

Rapdishare authentication works on a cookie basis. First run wget command to save a rapidshare authentication cookie to a ~/.rapidshare file.

 $ wget -q -O -  \
--post-data="sub=getaccountdetails_v1&withcookie=1&login=RAPIDSHARE-USER&password=RAPIDSHARE-PASS" \
https://api.rapidshare.com/cgi-bin/rsapi.cgi   \
 | grep cookie | cut -d= -f2  > ~/.rapidshare

If all went well your ~/.rapidshare file should contain a long string of characters and numbers.

 

3. Download from rapidshare using authentication cookie and wget

The hardest part is done and now we can easily revoke our rapidshare authentication cookie to download any file from rapidshare using wget tool.

wget --header="Cookie: enc=`cat ~/.rapidshare`" http://rapidshare.com/files/rapidshare-example-file.rar

4. Rapidshare wget automated bash script

Now with simple modifications we can create a simple bash script to download multiple files in a single session. Store a following bash script into your home directory and name it:

wget-rapidshare.sh:

#!/bin/bash 
 
for i in $( cat $1); do 
wget --header="Cookie: enc=`cat ~/.rapidshare` " $i 
done 

Execution:

$ chmod +x wget-rapidshare.sh
$ ./wget-rapidshare.sh rapidshare-links.txt

5. wget rapidshare download all in one

As a for a post summary we can put all steps together into a single bash script file. This script will accept three arguments:

  • rapidshare account username
  • rapidshare account password
  • text file with rapidshare links to download ( one link per line ! )

wget-rapidshare.sh:

#!/bin/bash 
 
rapidshare_cookie=`wget -q -O - \ 
--post-data="sub=getaccountdetails_v1&withcookie=1&login=$1&password=$2" \ 
https://api.rapidshare.com/cgi-bin/rsapi.cgi | grep cookie | cut -d= -f2` 
 
for i in $( cat $3); do 
wget --header="Cookie: enc=$rapidshare_cookie" $i 
done 

Execution:

$ chmod +x wget-rapidshare.sh
$ ./wget-rapidshare.sh rapidshare-username rapidshare-password rapidshare-links.txt

Share this linux post:

Submit Rapidshare wget direct download and Linux in Delicious Submit Rapidshare wget direct download and Linux in Digg Submit Rapidshare wget direct download and Linux in FaceBook Submit Rapidshare wget direct download and Linux in Google Bookmarks Submit Rapidshare wget direct download and Linux in Stumbleupon Submit Rapidshare wget direct download and Linux in Technorati Submit Rapidshare wget direct download and Linux in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download