tribler.core.libtorrent.torrentdef
Attributes
Classes
This object acts as a wrapper around some libtorrent metadata. |
Functions
|
Get the best bytes representation of available info hash material. |
Module Contents
- tribler.core.libtorrent.torrentdef.BLOCK_SIZE = 16384
- tribler.core.libtorrent.torrentdef.best_info_hash(info_hashes: libtorrent.info_hash_t, info_hash: libtorrent.sha1_hash) bytes
Get the best bytes representation of available info hash material.
- class tribler.core.libtorrent.torrentdef.TorrentDef(atp: libtorrent.add_torrent_params)
This object acts as a wrapper around some libtorrent metadata. It can be used to create new torrents, or analyze existing ones.
- atp
- property torrent_info: libtorrent.torrent_info | None
Get the libtorrent torrent info instance or load it from our metainfo.
- static _threaded_load_job(filepath: str) TorrentDef
Perform the actual loading of the torrent.
Called from a thread: don’t call this directly!
- static load(filepath: str) TorrentDef
- Async:
Create a TorrentDef object from a .torrent file.
- Parameters:
filepath – The path to the .torrent file
- static load_from_memory(bencoded_data: bytes) TorrentDef
Load some bencoded data into a TorrentDef.
- Parameters:
bencoded_data – The bencoded data to decode and use as metainfo
- _get_piece_range_from_file_idx(fstorage: libtorrent.file_storage, file_idx: int) collections.abc.Sequence[int]
Get the piece range from a file index.