= Introduction =

_Plowshare_ is a command-line downloader and uploader for some of the most popular file-sharing websites. It currently supports:

|| *Website* || *Download* || *Upload* ||
|| [http://www.2shared.com 2Shared] || anonymous || anonymous ||
|| [http://www.4shared.com 4Shared] || anonymous || no ||
|| [http://www.badongo.com Badongo] || anonymous || no ||
|| [http://www.depositfiles.com DepositFiles] || anonymous || no ||
|| [http://www.divshare.com divShare] || anonymous || no ||
|| [http://dl.free.fr dl.free.fr] || anonymous || no ||
|| [http://www.freakshare.net] Freakshare.net] || anonymous || no ||
|| [http://www.loadfiles.in] Loadfiles.in] || anonymous || no ||
|| [http://www.mediafire.com Mediafire] || anonymous || no ||
|| [http://www.megaupload.com Megaupload] || anonymous, free-membership and premium || anonymous, free-membership and premium (multifetch support) ||
|| [http://www.netload.in Netload.in] || anonymous || no ||
|| [http://www.rapidshare.com Rapidshare] || anonymous || anonymous and free zone ||
|| [http://www.sendspace.com Sendspace] || anonymous || no ||
|| [http://www.storage.to Storage.to] || anonymous || no ||
|| [http://www.uploaded.to Uploaded.to] || anonymous || no ||
|| [http://www.uploading.com Uploading.com] || anonymous || no ||
|| [http://www.usershare.net Usershare] || anonymous || no ||
|| [http://www.x7.to x7.to] || anonymous || no ||
|| [http://www.zshare.net ZShare] || anonymous || anonymous ||

= Dependencies =

To run _plowshare_ and all its modules you will need:

  * A [http://en.wikipedia.org/wiki/POSIX POSIX]-compliant operating system: 
    * GNU/Linux (Debian/Ubuntu/Fedora/Gentoo/Archlinux/...): [http://www.gnu.org/software/coreutils/ coreutils], [http://www.gnu.org/software/sed/ sed].
    * BSD (untested)
    * OSX (needs some [http://code.google.com/p/plowshare/issues/detail?id=8&can=1 patches]), 
    * Windows/Cygwin (is [http://cygwin.com/cgi-bin2/package-grep.cgi?grep=recode recode] available?).
  * [http://www.gnu.org/software/bash/ bash]
  * [http://curl.haxx.se/ curl]
  * [http://www.gnu.org/software/recode/ recode]
  * [http://www.imagemagick.org imagemagick] (with GIF and TIFF support)
  * [http://code.google.com/p/tesseract-ocr tesseract-ocr] (2.03 works, but 2.04 works better)
  * [http://www.mozilla.org/js/spidermonkey/ spidermonkey] (or a compatible Javascript interpreter)
  * [http://aa-project.sourceforge.net/aview/ aview] (optional)
  * [http://www.imagemagick.org/script/perl-magick.php] PerlMagick] (used by Netload.in and Loadfiles.in modules)

Debian/Ubuntu users may try:

{{{
$ sudo apt-get install curl recode imagemagick tesseract-ocr-eng spidermonkey-bin aview perlmagick
}}}

= Download & Install =

  * [http://aur.archlinux.org/packages.php?ID=24601 Archlinux]:

{{{
$ yaourt -Sy plowshare
}}}

  * [http://packages.gentoo.org/package/net-misc/plowshare Gentoo]:

{{{
$ emerge -av plowshare
}}}

  * [http://code.google.com/p/plowshare/downloads/list From sources] (default installation path is `/usr/local`):

{{{
$ wget http://plowshare.googlecode.com/files/plowshare-VERSION.tgz
$ tar xvzf plowshare-VERSION.tgz
$ cd plowshare-VERSION
$ sudo bash setup.sh install
}}}

  * [http://code.google.com/p/plowshare/downloads/list From sources as non-root]:

{{{
$ wget http://plowshare.googlecode.com/files/plowshare-VERSION.tgz
$ tar xvzf plowshare-VERSION.tgz
$ cd plowshare-VERSION
$ bash PREFIX=/home/$USER setup.sh install
}}}

= Usage examples =

== Download ==

  * Download a file from rapidshare:

{{{
$ plowdown http://www.rapidshare.com/files/86545320/Tux-Trainer_25-01-2008.rar
}}}

  * Download a file from rapidshare with a proxy. _curl_ supports `http_proxy` environment variable (notice that 3128 is the default port).

{{{
$ export http_proxy=http://xxx.xxx.xxx.xxx:80
$ plowdown http://www.rapidshare.com/files/86545320/Tux-Trainer_25-01-2008.rar
}}}

  * Download a list of links (one link per line):

{{{
$ plowdown file_with_links.txt
}}}

  * Download a list of links (one link per line) commenting out (with #) those successfully downloaded:
{{{
$ plowdown -m file_with_links.txt
}}}

  * Limit the download rate to give your bandwidth a break (you can use _curl_ rates: K=Kbps, M=Mbps, G=Gbps):

{{{
$ plowdown -r 50K http://www.rapidshare.com/files/86545320/Tux-Trainer_25-01-2008.rar
}}}

  * Download a file from megaupload using a free membership account:

{{{
$ plowdown -a myuser:mypassword http://www.megaupload.com/?d=132348234
}}}

  * Download a password-protected file from megaupload:

{{{
$ plowdown -p somepassword http://www.megaupload.com/?d=ieo1g52v
}}}

  * Use a different web retriever for the last file download. File URL, file name and cookies are available through interpolations. Let's say you want to use _wget_:

{{{
$ plowdown --run-download='wget -O "%filename" --load-cookies "%cookies" "%url"' http://www.2shared.com/file/4446939/c9fd70d6/Test.html
}}}

  * Filter alive links in a text file

{{{
$ plowdown -c file_with_links.txt > file_with_active_links.txt
}}}

== Upload ==

  * Upload a file to megaupload with a free membership account:

{{{
$ plowup -a myuser:mypassword -d "My description" /path/myfile.txt megaupload
}}}

  * Upload a file to megaupload with a premium account and multifetch upload:

{{{
$ plowup -a myuser:mypassword -d "My description" --multifetch http://www.somewherefarbeyond.com/somefile megaupload
}}}

  * Upload a file to rapidshare anonymously changing uploaded file name:

{{{
$ plowup /path/myfile.txt rapidshare:anothername.txt
}}}

== Delete ==

  * Delete a file from megaupload (a free or premium account is required):

{{{
$ plowdel -a myuser:mypassword http://www.megaupload.com/?d=132348234
}}}


= Implement your own modules =

_Plowshare_ is designed with modularity in mind, so it sh ould be easy to create new  modules. Study the code of any of the existing modules (for example, [http://code.google.com/p/plowshare/source/browse/tags/RELEASE-LAST/src/modules/2shared.sh 2shared]) and create you own. New modules will be added to _plowshare_ as long as they are released under a GNU GPL compatible license.

= Feedback =

If you find a bug in plowshare or want to propose an enhancement open a new [http://code.google.com/p/plowshare/issues/ issue]. For other comments, suggestions, whatever, you can email me: tokland AT gmail.com.

== Request for new modules ==

Plowshare has reached a pretty mature state, and I am fairly satisfied with what it currently does. However, there are dozens of file-sharing websites out there, and naturally users ask for their favorite to be implemented. As you can easily understand, I don't have the time to add support for every one of these websites, so I've decided to establish a quid-pro-quo agreement with plowshare users: if you send me a book/comic -- any language, second hand, something you liked, please ;-) -- I will implement (download only) your favorite website. If you cannot afford to send a book, a postcard would be also ok. Contact me for further information.
