I am a very lazy person in general and if I can automate a manual process then it shall be automated. I have created a tiny script which gets all my downloads from hotfile and rapishare, but will focus on hotfile for now.

The script is not entirely my idea I just put together pieces that I found while scrapping through the internet and I hope it will help you.

Step 1:
NB: Please make sure you have a premium hotfile account otherwise you might as well stop reading.
we need to create a hotfile cookie for your server so please execute the following code in a command console.

wget –save-cookies /path/to/hotfilecookie –post-data “returnto=%2F&user=yourusername&pass=yourpass&=Login” -O – http://www.hotfile.com/login.php > /dev/null

The command we just executed allowed us to build a cookie file which we will load when doing are downloads and will allow of us to utilize our hotfile premium account.

Step 2:
 We need to create a file which will use to store our download list, Our server will read and download all the links stored on the file.

In your download server directory e.g /home/dl/ create a file by executing “touch .wget-hotfile-list and please check the permissions we have on the file since we need to able to execute , read and write to the file.
 
Step 3:
We now need to write the bash script that will take care of our download process, first thing  – lets create a bash script and give it a name e.g.  “touch wget_server_hotfile.sh  and open the file with your favourite editor and insert this code snippet.

#!/bin/sh
# .wget-hotfile-list: manage the list of downloaded files

# invoke wget-list without arguments

while [ `find .wget-hotfile-list -size +0` ]
 do
  url=`head -n1 .wget-hotfile-list`
   wget -c –load-cookies /path/to/hotfilecookie  $url
   sed -si 1d .wget-hotfile-list
 done

Please make sure you enter the path we used in Step 1 when we were creating the cookie file. and lastly make sure that your script is executable by running “chmod +x wget_server_hotfile.sh .

Step 4:
We are now almost done, just a couple of loose ends to tire up. Please login to your hot-file premium account and make sure that your enable the option direct downloads“. Once thats done you are now ready to run the server , first open the file we created in Step 2 .wget-hotfile-list and start pasting your download links inside e.g.

http://hotfile/download/96747859/myfile1.tar
http://hotfile/download/96747859/myfile2.tar
http://hotfile/download/96747859/myfile3.tar
http://hotfile/download/96747859/myfile4.tar

Save and close the file then run the bash script we created in Step 3 “./wget_server_hotfile.shthen your download should start. 

NB:
The bash script terminates once all the entries in  .wget-hotfile-list have been downloaded .
  
Here is a list of sites that helped me get this process working and all credit should go to those guys and not me.
http://www.g-loaded.eu/2007/09/15/use-wget-or-curl-to-download-from-rapidshare-premium/
http://lampbear.wordpress.com/2010/04/05/use-wget-to-download-from-hotfile-automated/
http://friendfeed.com/kris/c9a389b8/use-wget-to-download-from-hotfile-automated-web

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] none