Torrent Model

Torrent

The Torrent class defines a single torrent. It is instantiated with a Torrent specific hash, and connection information similar to RTorrent.

class torrent.Torrent(target, _hash)[source]

Torrent class. This class contains most of the methods specific to a torrent, such as get_name, get_hash, is_complete, get_download_rate, etc.

close(*args)
Close a torrent.

Original libTorrent method: d.close

erase(*args)
Erase a torrent.

Original libTorrent method: d.erase

get_bytes_done(*args)
Returns the amount of bytes done.

Original libTorrent method: d.get_bytes_done

get_bytes_left(*args)
Returns the amounts of bytes left to download.

Original libTorrent method: d.get_left_bytes

get_download_rate(*args)
Returns the current download rate for Torrent.

Original libTorrent method: d.get_down_rate

get_download_total(*args)
Returns the total downloaded data for torrent.

Original libTorrent method: d.get_down_total

get_full_path(*args)
Returns the full path to the Torrent.

Original libTorrent method: d.get_base_path

get_hash(*args)
Returns the torrent hash. Very useful.

Original libTorrent method: d.get_hash

get_loaded_file(*args)
Returns absolute path to .torrent file.

Original libTorrent method: d.get_loaded_file

get_message(*args)
Returns the torrent message.

Original libTorrent method: d.get_message

get_name(*args)
Returns the name of the Torrent.

Original libTorrent method: d.get_name

get_ratio(*args)
Returns the ratio for this Torrent. (Download / Upload)

Original libTorrent method: d.get_ratio

get_size_bytes(*args)
Returns the size of the torrent in bytes.

Original libTorrent method: d.get_size_bytes

get_size_chucks(*args)
Returns the size of the torrent in chucks.

Original libTorrent method: d.get_size_chucks

get_size_files(*args)
Returns the size of the torrent in files.

Original libTorrent method: d.get_size_files

get_state(*args)
No clue as to what this returns yet. TODO

Original libTorrent method: d.get_state

get_upload_rate(*args)
Returns the current upload rate for Torrent.

Original libTorrent method: d.get_up_rate

get_upload_total(*args)
Returns the total uploaded data for torrent.

Original libTorrent method: d.get_up_total

get_views(*args)

Original libTorrent method: d.views

hashing_failed(*args)

Original libTorrent method: d.get_hashing_failed

is_active(*args)

Returns 1 if the torrent is active; 0 when it is not active.

XXX: As of yet we’re not completely sure what ``active’’ means.

Original libTorrent method: d.is_active

is_complete(*args)
Returns 1 if torrent is complete; 0 if it is not complete.

Original libTorrent method: d.get_complete

is_hash_checked(*args)
Returns 1 if the hash has been checked, 0 is otherwise.

Original libTorrent method: d.is_hash_checked

is_hash_checking(*args)
Returns 1 if the hash is currently being checked, 0 otherwise? TODO

Original libTorrent method: d.is_hash_checking

is_hashing(*args)

Original libTorrent method: d.get_hashing

is_open(*args)
Returns 1 if the torrent is open, 0 otherwise.

Original libTorrent method: d.is_open

open(*args)
Open a torrent.

Original libTorrent method: d.open

pause(*args)
Pause a torrent.

Original libTorrent method: d.pause

perform_hash_check(*args)
Performs a hash check. Returns 0 immediately.

Original libTorrent method: d.check_hash

query()[source]

Query returns a new TorrentQuery object with the host, port, url and hash(!) from the current Torrent object. The hash will be used as default argument in the TorrentQuery class. See TorrentQuery

resume(*args)
Resume a torrent.

Original libTorrent method: d.resume

start(*args)
Start a torrent.

Original libTorrent method: d.start

stop(*args)
Stop a torrent.

Original libTorrent method: d.stop

Table Of Contents

Previous topic

RTorrent

Next topic

Peer

This Page