Torrent

class transmission_rpc.torrent.Torrent(client, fields)[source]

Torrent is a class holding the data received from Transmission regarding a bittorrent transfer.

All fetched torrent fields are accessible through this class using attributes. This class has a few convenience properties using the torrent data.

property date_active

the attribute “activityDate” as datetime.datetime.

property date_added

the attribute “addedDate” as datetime.datetime.

property date_done

the attribute “doneDate” as datetime.datetime. returns None if “doneDate” is invalid.

property date_started

the attribute “startDate” as datetime.datetime.

property download_limit

The download limit.

Can be a number or None.

property eta

the “eta” as datetime.timedelta.

files()[source]

Get list of files for this torrent.

This function returns a dictionary with file information for each file. The file information is has following fields:

{
    <file id>: {
        'name': <file name>,
        'size': <file size in bytes>,
        'completed': <bytes completed>,
        'priority': <priority ('high'|'normal'|'low')>,
        'selected': <selected for download>
    }
    ...
}
format_eta()[source]

Returns the attribute eta formatted as a string.

  • If eta is -1 the result is ‘not available’

  • If eta is -2 the result is ‘unknown’

  • Otherwise eta is formatted as <days> <hours>:<minutes>:<seconds>.

locate_data(location, timeout=None)[source]

Locate torrent data at location.

move_data(location, timeout=None)[source]

Move torrent data to location.

property peer_limit

the peer limit.

property priority

Bandwidth priority as string. Can be one of ‘low’, ‘normal’, ‘high’. This is a mutator.

property progress

download progress in percent.

property queue_position

queue position for this torrent.

property ratio

upload/download ratio.

property seed_idle_limit

seed idle limit in minutes.

property seed_idle_mode

Seed idle mode as string. Can be one of ‘global’, ‘single’ or ‘unlimited’.

  • global, use session seed idle limit.

  • single, use torrent seed idle limit. See seed_idle_limit.

  • unlimited, no seed idle limit.

property seed_ratio_limit

Torrent seed ratio limit as float. Also see seed_ratio_mode. This is a mutator.

property seed_ratio_mode

Seed ratio mode as string. Can be one of ‘global’, ‘single’ or ‘unlimited’.

  • global, use session seed ratio limit.

  • single, use torrent seed ratio limit. See seed_ratio_limit.

  • unlimited, no seed ratio limit.

This is a mutator.

start(bypass_queue=False, timeout=None)[source]

Start the torrent.

property status

Returns the torrent status. Is either one of ‘check pending’, ‘checking’, ‘downloading’, ‘seeding’ or ‘stopped’. The first two is related to verification.

stop(timeout=None)[source]

Stop the torrent.

update(timeout=None)[source]

Update the torrent information.

property upload_limit

upload limit. Can be a number or None.