#!/usr/bin/perl -w # rapidshare.com fetcher - See perldoc for more info # $Id: rsget.pl,v 1.5 2009/06/17 19:00:40 mortenb Exp $ use strict; use Time::HiRes qw(time); use Getopt::Long; # show full output from wget my $debug = 1; # set to 1 if you like to remove .html at the end # some people just love to add .html to binaries # saves you a rename afterwards my $remove_html = 1; my $infile = undef; my $outdir = undef; my $test = undef; # 20090616 : rapidshare have changed the authentication cookie, this must be updated everytime you change password,account etc. my $cookie = undef; #my $cookie = "Cookie: enc=A_VERY_LONG_128BIT_HEX_YOU_FIND_IT_IN_YOUR_COOKIE_COLLECTION_IN_YOUR_BROWSER_AFTER_ONE_PREMIUM_DOWNLOAD"; # default Internet-Explorer v7.0 compatible my $useragent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"; GetOptions ( 'infile|in=s' => \$infile, 'outdir|out=s' => \$outdir, 'cookie=s' => \$cookie, 'debug=i' => \$debug, 'test' => \$test, 'remove_html' => \$remove_html, 'useragent|ua=s' => \$useragent, ); ## binaries we need: chomp(my $wget = `which wget`); die "Error: binary \$wget=$wget not executable or does not exist\n" if(! -x $wget); my $pwd = "/bin/pwd"; die "Error: binary \$pwd=$pwd not executable or does not exist\n" if(! -x $pwd); my $mkdir = "/bin/mkdir"; die "Error: binary \$mkdir=$mkdir not executable or does not exist\n" if(! -x $mkdir); # check mandatory parameter infile die "Error: --infile = not defined or does not exist\n" if(!defined $infile || ! -f $infile); die "Error: --cookie = must be set\n" if(!defined $cookie); # check if outdir is available if(! defined $outdir) { chomp($outdir = `$pwd`); } elsif(! -d $outdir) { system("$mkdir -p '$outdir'")==0 || die "Unable to create --outdir='$outdir'\n"; } # parse infile and create a list of all the urls we will load my @filelist = (); open(my $FP, "<$infile") || die "Error: unable to read --infile=$infile\n"; while(my $line = <$FP>) { chomp($line); next if($line =~ /^\s*#/); #ignore commented out lines if($line =~ /(http:\/\/\S+)\s*$/) { push(@filelist,$1); } } if($debug) { print "Found ",scalar(@filelist)," entries in --infile=$infile\n" } if($debug>=2) { for(my $i=0; $i Premium Zone login' Press 'Options' Check 'Direct-downloads' Choose a 'Preferred Mirror' Save and you're done You must also do a single download to get hold of the authentication cookie. Get hold of the cookie by wieving it and copy it into the cookie string. The Cookie should be on the form: enc= =head2 NOTES Rapidshare seem to change the format of the cookie from time to time, so expect this to change. =head1 AUTHOR morten_bjoernsvik@yahoo.no - FEB 2007 =cut