Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Version 2
Programming language was changed to be able to run Uploader on Windows. Since Cygwin
doesn't support PHP but does support Perl, I switched to Perl.
By the way, Irssi uses Perl for its scripts, and since Uploader uses Irssi, this made it even more
preferable.
Since it uses other language, it has different dependencies. Read more about it in setup guide.
1.1.2. Structure
A lot of things were optimized in 2nd version and the code is a lot cleaner now.
All upload and download functions (or "subroutines" as they are called in Perl) are moved to
include/ directory and there is one tracker per file. Upload tracker files also contain category
conversion functions that were previously located inside converters.php.
Irssi scripts and irssi autojoin scripts are moved to starters/ directory.
If you don't pass any extra arguments when using get/aget then torrent is marked for uploading
to the tracker specified in the config file. But you can also pass tracker code to mark it for uploading
to specified tracker.
Same idea works for upload/aupload. If you don't pass tracker code as final argument, it will try to
upload to every tracker the torrent was marked to upload. If you pass tracker code as the final
argument, it will upload only to the specified tracker.
At first, Windows version used rTorrent just like Linux version did, but after some testing it
turned out that it (rTorrent) used to crash often. Now I recommend setting it up using uTorrent.
With uTorrent auto removal feature or anything else related to XMLRPC won't work for the
moment. Theoretically it is possible to inplement auto removal feature in uTorrent using uTorrent
Web UI, but since I don't use uploader on Windows myself, it could take some time before I make
it.
2.1.1.1. Notepad++
Most of the uploader scripts use Linux line endings meaning that there could be problems
reading them in Notepad or other too primitive Windows text editor. I recommend installing and
using Noepad++:
http://download.tuxfamily.org/notepadplus/5.8.2/npp.5.8.2.Installer.exe
2.1.2.1. Cygwin
To run Uploader on Windows system you have to install Cygwin. You can get it from
http://www.cygwin.com/
Cygwin is Linux-like environment for Windows making it possible to port software running on
POSIX systems (such as Linux, BSD, and Unix systems) to Windows.
In the Cygwin setup you have to mark these extra packages for installation:
Possibly some of the following packages are not needed if you plan using uTorrent but it would
not hurt if you install them anyway.
✔ gcc
✔ gcc-g++
✔ gcc4
✔ gcc4-g++
✔ libgcc1
✔ libcurl-devel
✔ libncurses-devel
✔ libncursesw-devel
✔ ncurses
✔ ncursesw
✔ libtool
✔ make
✔ libopenssl
✔ openssl-devel
✔ patch
✔ subversion
✔ wget
✔ cppunit
✔ lynx
✔ gettext
✔ gettext-devel
✔ glib2.0
✔ glib2.0-devel
✔ perl
2.1.2.2. Libsigc++
(skip this step if using uTorrent instead of rTorrent)
wget http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.8.tar.gz
tar zxvf libsigc++-2.2.8.tar.gz
cd libsigc++-2.2.8.tar.gz
./configure
make
make install
cd ../
./configure --with-xmlrpc-c
make
make install
cd ../
I tested installation of these modules from CPAN on Windows Server 2008 and had no
problems. If you run into problems, go to CPAN, look up failing package and install it manually.
To use manual upload plugin or rTorrent Web UI with SCGI you will have to set up Apache with PHP.
If you only want to use manual upload plugin, any webserver with PHP support will do just fine
because all that upload_plugin.php script does is executing tuper.pl and passing arguments to it.
to the end of the file. Then save it and restart Apache service.
If you want to use WebUI or SCGI on Windows, you should set up SCGI module for Apache.
On Windows there is no SCGI module that comes with Apache 2, so you have to use 3rd party
module. I found one that worked for me with Apache 2.0.63.
Copy mod_scgi.so to Apache's modules/ directory and add this to Apache configuration
(httpd.conf).
LoadModule scgi_module modules/mod_scgi.so
SCGIMount /rt1 127.0.0.1:5000
SCGIMount /rt2 127.0.0.1:5001
This will mount SCGI from port 5000 to /rt1 and 5001 to /rt2.
Read about setting up Firefox plugin in section 2.3 on page 16 and using it in section 3.3 on
page 20.
2.2.1.2. Xmlrpc-c
svn co https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable/ xmlrpc-c-svn
cd xmlrpc-c-svn
./configure --disable-cplusplus
make
sudo make install
cd ../
Read about setting up Firefox plugin in section 2.3 on page 16 and using it in section 3.3 on
page 20.
This section explains client side setup. Server side setup of this plugin for Windows is described
in section 2.1.2.10 on page 12 and for Linux in section 2.2.1.5 on page 15.
Go to Tools > Add-ons. In Extensions tab find “Torrent auto uploader by Janhouse”.
Preferences window should open up with 3 input fields: “link to uploader script”, “upload tracker
codes” and “authorization key”.
In “Upload tracker codes” write your tracker code(s) used in uploader configuration. If you want to
list more then one tracker, separate them with commas. For example:
fano,inp,mega
If you ned to run script in the background as a different proces and exit it immediately, you can
use tex.pl. tex.pl will execute tuper.pl and pass parameters passed to it further.
To escape from other program freezing, you will want to call tex.pl instead of tuper.pl when
calling it from rTorrent/Irssi/other.
3.1.1. Downloading
To start downloading torrent, pass "get" or "aget" as parameter to tuper.pl followed by tracker
code, torrent id on specified tracker and if needed, tracker code for the tracker you want to upload
to. If no upload tracker code is specified after torrent id, Uploader will mark that torrent has to be
uploaded to the tracker specified in configuration.
For example, to upload torrent with id 123456 from SceneAccess to your default configured
tracker, you would use:
./tuper.pl get scc 123456
To upload the same torrent to other tracker from upload trackers list, for example "Fano bittorrent
tracker", you would use:
./tuper.pl get scc 123456 fano
3.1.2. Uploading
To upload torrent that has been downloaded, use tuper.pl with "upload" or "aupload" parameter
For example, to manually upload torrent, that failed uploading previously, to every tracker it was
marked to upload to, use:
./tuper.pl upload 2773d37d2a4e2b1f3448879d245d10b041588917
If you want to upload it to only one of the specified trackers from upload list, for example "Fano
bittorrent tracker", use:
./tuper.pl upload 2773d37d2a4e2b1f3448879d245d10b041588917 fano
Version 1 used XMLRP-C for removal but 2nd version does not. (At least not by default.)
To remove torrent the right way, you must execute eliminator script and pass torrent info hash to
it. It marks it as removed in the database and removes torrent from rTorrent. Files are removed
when all tied torrents are removed from rTorrent.
Best way to do this is to create rTorrent and Uploader configuration that sorts torrents in groups
and specify seeding goal rules that execute eliminator.pl when seeding goal is reached.
Select “Upload to ***” (replace *** with your upload tracker code).
✔ infohash - info hash of downloaded torrent (read from downloaded torrent file and added
when entry is created)
✔ name - name of the torrent (read upon scraping information from download tracker and
added when entry is created)
✔ file - file name of the torrent, nfo and txt (read upon scraping information from download
tracker and added when entry is created)
✔ category - category ID torrent will be uploaded to (found and added when entry is created)
✔ started - time when torrent started downloading (added when rTorrent sends command
that it has started downloading)
✔ downloaded - time when torrent was uploaded (added when torrent is uploaded)
✔ uploaded - time when torrent finished downloading (added when rTorrent sends
command that it has finished downloading)
✔ seeded - time when torrent started seeding uploaded torrent (added when rTorrent sends
command that it has started seeding)
✔ upload_infohash - info hash of uploaded torrent (added when torrent is uploaded)
✔ upload_id - torrent ID on the tracker it was uploaded to (scraped from tracker when torrent
is uploaded)
It will search for original .nfo file inside torrent download directory.
If you want to upload extracted torrents instead of usually rarred files, you can add the fillowing
line to the upload subroutine in the include/upload_*.pm, right after $torrent variable initialization.
$torrent=&rarextract($torrent, $subname, $defname);
It will search for rarred files, extract them in uploads directory specified by $upload_dir in
config.pm, copy over other files and make new torrent with mktorrent. So make sure that mktorrent
is installed if you want to use this.