Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rapidshare.com downloads using wget
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
beowu1f
n00b
n00b


Joined: 19 Apr 2005
Posts: 4

PostPosted: Sat Apr 21, 2007 9:25 pm    Post subject: rapidshare.com downloads using wget Reply with quote

! To fellow gentoo'ers out there !

This topic is a follow on from

http://www.markontech.com/2006/12/22/downloading-content-from-rapidsharecom-using-wget-and-bash/

that describes how to download links to files found on rapidshare.com

[b]environment:
1) Sitting behind my Dell M70 at mercedes bodyshop manufacturing facility
in south africa, Ease London (New C-Class Merc) thinking about how i
can improve the cycle time on my KUKA robot cell (B-Pillar) 8O

time: 1) 2 hrs... ok so im no guru globber, at least it works :)

Requirements: 1) An all spectacular standard gentoo/linux system (also works
on CYGWIN or any other linux box)
2) latest version of wget (beowu1f system= GNU Wget 1.10.2 )
3) An active rapidshare.com account with username and password
4) Direct Downloads option set to ON in rapidshare.com options menu
5) A never ending curiosity of how things work!

Changes: 1) Support for getopts is included [getopt(1) is now
deprecated]
2) This script also works in CYGWIN since CYGWIN does
not include getopt(1) at all!
3) GNU Wget 1.10.2 has a new --no-check-certificate option
that must be passed in order to gain access to rapidshare.com
and download the premiumzone.cgi page
4) Have Fun!

The Code: origionally written by Mark Sullivan ( thank you Mark )

1) first (main) BASH script
BashGet.sh

#!/bin/bash
# File Name: BashGet.sh
# Author: Mark Sullivan
# Edited by beowu1f: 1) Support for getopts is included [getopt(1) is now
# deprecated]
# 2) This script also works in CYGWIN since CYGWIN does
# not include getopt(1) at all!
# 3) GNU Wget 1.10.2 has a new --no-check-certificate option
# that must be passed in order to gain access to rapidshare.com
# and download the premiumzone.cgi page
# 4) Have Fun!

while getopts u:p:l: choice
do
case "$choice" in
u) user="$OPTARG";;
p) pass="$OPTARG";;
l) url="$OPTARG";;
[?]) echo; echo "Usage: $0 -u <username> -p <password> -l <URL> --> terminating..."; \
echo >&2; exit 1;;
esac
done

UserData=$(echo "-u " $user "-p " $pass "-u " $url)

#colour definitions
RED='\e[1;31m';CYAN='\e[1;36m';NC='\e[0m';BL='\e[1;34m';GR='\e[0;32m';YEL='\e[1;33m';DG='\e[1;30m'

echo
echo -e ${RED}
echo "****************************************************************************" >&2

echo "***Remember to turn on 'Direct Downloads' in rapidshare.com online setup!***" >&2
echo -e "****************************************************************************" >&2
echo -e ${NC}
echo
echo "<>-- your user data entered --<>"
echo $UserData
echo

echo -e ${CYAN}real URL:${NC}$url
fileName=`basename $url`
echo -e ${CYAN}Filename:${NC}$fileName
cookie=cookie

## LOGIN and save cookie ##
wget --save-cookies=$cookie -q --post-data="login=$user&password=$pass" \
https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi --no-check-certificate

echo

rm premiumzone.cgi

echo -e "${CYAN}downloading: ${BL}$fileName${NC} ..."
wget --load-cookies=$cookie -q $url -O ./downloads/$fileName --no-check-certificate

if [ $? == 0 ]
then
echo -e ${DG} "downloading complete! ${BL} [${GR} OK ${BL}]" >&2
else
echo -e ${RED} "wget did not complete. downloading failed!" ${NC} >&2; exit 1
fi
##############################################################################

My main reason for implementing getopts was for CYGWIN support. where ever i travel
i need to connect to my winblows machine at home and download various items.


2) then create this second script...RapDownload.sh

#!/bin/bash
# File Name: RapDownload.sh
# Author: Mark Sullivan
# Edited by beowu1f
# NOTE: change <username> to your rapidshare.com username
# change <password> to your rapidshare.com password

for url in `cat $1`
do
./BashGet.sh -u <username> -p <password> -l $url
done
##############################################################################

3) Be sure to change your username & password as indicated in the above script

4) Now make sure both scripts are executable by issueing:

$ chmod +x BashGet.sh RapDownload.sh

5) Next place all the links your interested in downloading from rapidshare.com
into any text file. (eg. vim files)
Mine looks something like this:

http://rapidshare.com/files/26270733/ItemOfInterest.pdf.html

6) make sure you have a downloads directory inside the current directory your
newly created scripts are in. Issue the command


$ mkdir downloads

7) You're now ready to try out your script. Issue the script command

$ ./RapDownload.sh files

and away you go! pretty colours and all!

Hope this has helped you on your journey to downloading from rapidshare.com
Once again thanks goes to Mark for all your support and good globbing!

beowu1f
[/b][/b][/post]
Back to top
View user's profile Send private message
fluxd
n00b
n00b


Joined: 29 Oct 2007
Posts: 1

PostPosted: Mon Oct 29, 2007 9:09 pm    Post subject: Reply with quote

Hi, Thankyou very much for this howto. Its working perfectly. Is it possible to show the speed it is downloading at also?
Back to top
View user's profile Send private message
klmann
n00b
n00b


Joined: 06 Sep 2004
Posts: 2

PostPosted: Tue Nov 13, 2007 10:08 am    Post subject: Reply with quote

What about this one:

Code:
$ wget --http-user "USERNAME" --http-passwd "PASSWORD" -i rapidshare_linklist.txt
Back to top
View user's profile Send private message
mattlinuxguy
n00b
n00b


Joined: 20 Feb 2008
Posts: 6

PostPosted: Thu Feb 21, 2008 11:22 pm    Post subject: Reply with quote

awesome i will check back this post later. i always download rapidshare stuff. i want a nice simple gui for it and the ability to add downloads to the gueue from another comp on my network
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum