P2P::Transmission - Interface to the Transmission BitTorrent client
use P2P::Transmission; my $client = P2P::Transmission->new(socket => '/path/to/socket'); $client->add( file => 'freebsd6.2release.torrent', autostart => 0 ); $client->downlimit(512); $client->uplimit(128); ...
P2P::Transmission can be used to control the popular cross-platform Transmission BitTorrent client. The module supports both the common GUI-based client as well as the lesser-known transmission-daemon.
P2P::Transmission
Control of the client is achieved using a UNIX-socket provided by the client itself. The module supports the documented 1.00 command set.
new({ ... })
Constructs and returns a new P2P::Transmission object. Takes the following hash keys as parameters:
socket path to controlling UNIX socket (required) debug print network traffic to stdout (0|1, optional)
add({ ... })
Instruct Transmission to add a torrent to its active list. Returns 1 for success and undef on failure. Takes the following hash keys as parameters:
1
undef
data contents of torrent file (required *) file path to torrent file (required *) autostart begin downloading immediately (0|1, optional) directory directory to download into (optional) * data and file are mutually exclusive
automap(1|0)
Get or set the state of automatic port mapping via NAT-PMP and UPnP
autostart(1|0)
Get or set the preference to automatically start downloading new torrents when added.
directory()
Get or set the default directory used for saving new torrent data
downlimit()
Get or set the maximum total download speed in kilobytes per second
Note: pass -1 to remove all rate limiting
encryption()
Get or set the state of encryption use. Valid parameters are:
required require the use of encryption by peers preferred use encryption when available plaintext do not use encryption
lookup()
Takes a sha1 hash argument and returns the corresponding P2P::Transmission::Torrent object for the active torrent identified by that hash. If none exists, undef is returned
P2P::Transmission::Torrent
pex(1|0)
Get or set the global preference to use peer exchange.
port()
Get or set the port used to listen for incoming peer connections
shutdown
Instructs the Transmission program to quit
Note: any calls made after shutdown will case a fatal error
start_all
Starts all inactive torrents
Returns 1 for success or undef for failure
stop_all
Stops all active torrents
uplimit
Get or set the maximum total upload speed in kilobytes per second
pex()
This is a problem with the OSX IPC handler (see Transmission bug #588)
add()
This is a problem with the OSX IPC handler (see Transmission bug #600)
The 0.03 release of this module was only tested using the OSX version of Transmission 1.00. Further testing against transmission-daemon and the GTK version will be performed before the next module release.
Transmission (http://www.transmissionbt.com/)
Brandon Gilmore, <brandon@mg2.org>
Copyright (C) 2007 Brandon Gilmore
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install P2P::Transmission, copy and paste the appropriate command in to your terminal.
cpanm
cpanm P2P::Transmission
CPAN shell
perl -MCPAN -e shell install P2P::Transmission
For more information on module installation, please visit the detailed CPAN module installation guide.