= Introduction =

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

|| *Website* || *Download* || *Upload* || *Delete* || *List* ||
|| [http://www.115.com 115.com] || anonymous || -|| -|| -||
|| [http://www.2shared.com 2Shared] || anonymous || anonymous || yes || -||
|| [http://www.4shared.com 4Shared] || anonymous || -|| -|| yes ||
|| [http://www.badongo.com Badongo] || anonymous || -|| -|| -||
|| [http://www.data.hu Data.hu] || anonymous || -|| -|| -||
|| [http://www.depositfiles.com DepositFiles] || anonymous || -|| -|| yes ||
|| [http://www.divshare.com divShare] || anonymous || -|| -|| -||
|| [http://dl.free.fr dl.free.fr] || anonymous || -|| -|| -||
|| [http://www.humyo.com Humyo] || anonymous || -|| -|| -||
|| [http://www.mediafire.com Mediafire] || anonymous || anonymous || -|| yes ||
|| [http://www.megaupload.com Megaupload] || anonymous, free-membership and premium || anonymous, free-membership and premium (multifetch support) || yes || yes ||
|| [http://www.netload.in Netload.in] || anonymous || -|| -|| -||
|| [http://www.rapidshare.com Rapidshare] || anonymous, Premium-Zone || anonymous, Free-Zone, Premium-Zone || yes || -||
|| [http://www.sendspace.com Sendspace] || anonymous || -|| -|| yes ||
|| [http://www.uploading.com Uploading.com] || anonymous || -|| -|| -||
|| [http://www.usershare.net Usershare] || anonymous || -|| -|| -||
|| [http://www.x7.to x7.to] || anonymous, free account || -|| -|| -||
|| [http://www.zshare.net ZShare] || anonymous || anonymous || yes || -||

Note that websites update their pages from time to time, so this table is a just a reference. If you are experiencing problems with a stable version, check if it's been resolved in the [http://code.google.com/p/plowshare/source/list subversion repository].
	
= 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 ([http://code.google.com/p/plowshare/issues/detail?id=55 needs modifications])
    * Mac OSX (you need [http://mxcl.github.com/homebrew/ homebrew]
    * Windows/Cygwin (_recode_ is not available as a package but can be recompiled from [http://www.cygwin.com/ml/cygwin/2001-10/msg01602.html sources])
  * [http://www.gnu.org/software/bash/ bash]
  * [http://curl.haxx.se/ curl] (with SSL support, usually required for premium account)
  * [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] (with TIFF support; version 2.03 works, but 2.04 works better)
  * [http://www.mozilla.org/js/spidermonkey/ spidermonkey] or [http://www.mozilla.org/rhino/ rhino] : a compatible Javascript interpreter (used by badongo, mediafire and zshare modules)
  * [http://aa-project.sourceforge.net/aview/ aview] or [http://caca.zoy.org/ libcaca] (both optional)
  * [http://www.imagemagick.org/script/perl-magick.php PerlMagick] (used by badongo and netload.in modules)

Debian/Ubuntu users may try:

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

*Note*: Since Ubuntu 10.04 LTS (named _Lucid Lynx_), `spidermonkey-bin` package is not available anymore, install `rhino` instead.

= 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
}}}

  * Mac OSX: You need to install [http://wiki.github.com/mxcl/homebrew/installation homebrew]
  
{{{
$ brew install 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
}}}

  * [http://code.google.com/p/plowshare/downloads/list From repository]:

{{{
$ svn checkout http://plowshare.googlecode.com/svn/trunk/ plowshare
$ cd plowshare
$ sudo bash setup.sh install
}}}

= Usage examples =

All four scripts share the same verbose options: `-v0` (alias: `-q`),  `-v1` (errors only), `-v2` (infos message; default), `-v3` (show all messages), `-v4` (show all messages, HTML pages and cookies,
use this for bug report).

== 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` and `https_proxy` environment variables (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 (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 (note ':' is used to separate user from password):

{{{
$ 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
}}}

  * Avoid never-ending downloads: limited the number of tries (mainly for captchas) and wait delays for each link:

{{{
$ plowdown --max-retries=20 --timeout=3600 ...
}}}

== Upload ==

  * Upload a file to the Rapidshare collector zone

{{{
$ plowup --auth-freezone=myuser:mypassword /path/myfile.txt rapidshare
}}}

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

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

  * 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 bunch of files (anonymously to 2shared):

{{{
$ plowup /path/myphotos/* 2shared
}}}

Notice that only files will be sent, subdirectories will be ignored.

  * Upload a file to Zshare anonymously with a proxy.

{{{
$ export http_proxy=http://xxx.xxx.xxx.xxx:80
$ export https_proxy=http://xxx.xxx.xxx.xxx:80
$ plowup /path/myfile.txt zshare
}}}

Be aware that _curl_ is not capable of uploading files containing a comma (,) in their name, so make sure to rename them before using _plowup_.

== Delete ==

  * Delete a file from megaupload (a premium account may be required):

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

== List ==

  * List links contained in a shared-folder link and download them all safely:

{{{
$ plowlist http://www.mediafire.com/?sharekey=79ac821ea0110 > links.txt
$ plowdown -m links.txt
}}}


= 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.
