The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

P2P::Transmission - Interface to the Transmission BitTorrent client

SYNOPSIS

  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);
  ...

DESCRIPTION

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.

Control of the client is achieved using a UNIX-socket provided by the client itself. The module supports the documented 1.00 command set.

METHODS

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:

  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

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

Returns 1 for success or undef for failure

uplimit

Get or set the maximum total upload speed in kilobytes per second

  Note: pass -1 to remove all rate limiting

BUGS AND CAVEATS

pex() always returns undef with Transmission 1.00

This is a problem with the OSX IPC handler (see Transmission bug #588)

add() always returns undef with Transmission 1.00

This is a problem with the OSX IPC handler (see Transmission bug #600)

NOTE

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.

SEE ALSO

AUTHOR

Brandon Gilmore, <brandon@mg2.org>

COPYRIGHT AND LICENSE

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.