|
|
__init__(self,
input=None,
metainfo=None,
infohash=None)
Normal constructor for TorrentDef (The input, metainfo and infohash... |
|
|
|
|
add_content(self,
inpath,
outpath=None,
playtime=None)
Add a file or directory to this torrent definition. |
|
|
|
|
remove_content(self,
inpath)
Remove a file or directory from this torrent definition |
|
|
|
|
create_live(self,
name,
bitrate,
playtime='1:00:00',
authconfig=None)
Create a live streaming multimedia torrent with a specific bitrate. |
|
|
|
|
|
|
|
|
|
|
set_thumbnail(self,
thumbfilename)
Reads image from file and turns it into a torrent thumbnail
The file should contain an image in JPEG format, preferably 171x96. |
|
|
|
|
get_thumbnail(self)
Returns (MIME type,thumbnail data) if present or (None,None) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_dht_nodes(self,
nodes)
Sets the DHT nodes required by the mainline DHT support,... |
|
|
|
|
|
|
|
|
|
|
get_comment(self)
Returns the comment field of the def. |
|
|
|
|
|
|
|
|
|
|
set_httpseeds(self,
value)
Set list of HTTP seeds following the spec at... |
|
|
|
|
|
|
|
set_piece_length(self,
value)
Set the size of the pieces in which the content is traded. |
|
|
|
|
|
|
|
set_add_md5hash(self,
value)
Whether to add an end-to-end MD5 checksum to the def. |
|
|
|
|
get_add_md5hash(self)
Returns whether to add an MD5 checksum. |
|
|
|
|
set_add_crc32(self,
value)
Whether to add an end-to-end CRC32 checksum to the def. |
|
|
|
|
get_add_crc32(self)
Returns whether to add an end-to-end CRC32 checksum to the def. |
|
|
|
|
set_add_sha1hash(self,
value)
Whether to add end-to-end SHA1 checksum to the def. |
|
|
|
|
get_add_sha1hash(self)
Returns whether to add an end-to-end SHA1 checksum to the def. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_live(self)
Returns whether this definition is for a live torrent. |
|
|
|
|
|
|
|
get_live_pubkey(self)
Returns the public key used for authenticating packets from
the source. |
|
|
|
|
finalize(self,
userabortflag=None,
userprogresscallback=None)
Create BT torrent file by reading the files added with
add_content() and calculate the torrent file's infohash. |
|
|
|
|
is_finalized(self)
Returns whether the TorrentDef is finalized or not. |
|
|
|
|
|
|
|
get_metainfo(self)
Returns the torrent definition as a dictionary that follows the BT
spec for torrent files. |
|
|
|
|
get_name(self)
Returns the info['name'] field as raw string of bytes. |
|
|
|
|
set_name(self,
name)
Set the name of this torrent |
|
|
|
|
|
|
|
|
|
|
save(self,
filename)
Finalizes the torrent def and writes a torrent file i.e., bencoded dict
following BT spec) to the specified filename. |
|
|
|
|
get_bitrate(self,
file=None)
Returns the bitrate of the specified file. |
|
|
|
|
get_files(self,
exts=None)
The list of files in the finalized torrent def. |
|
|
|
|
get_length(self,
selectedfiles=None)
Returns the total size of the content in the torrent. |
|
|
|
|
|
|
|
| get_index_of_file_in_files(self,
file) |
|
|
|
|
copy(self)
Copies the instance. |
|
|