Skip to main content

LtAddTorrentParams

The LtAddTorrentParams is a pure Lua table - i.e it does not wrap a type.

The main reason for this is that wrapping it makes it quite hard to work with the different tables associated with the params, such as trackers, file priorities, etc.

This has the consequence that no actual type checking is done until the table is handed over to the C++ side and it is converted to a real object.

Factories​

from_path(path: string): LtAddTorrentParams | nil, PoError | nil​

v1.0

Loads a torrent file from a path and parses it into an LtAddTorrentParams.

Example​

local params, err = LtAddTorrentParams.from_path("/tmp/debian.torrent")

if err then
print("Failed to load torrent file: {}", err)
return
end

print("Loaded torrent {}", params.name)

Properties​

active_time: number​

v1.0

added_time: number​

v1.0

comment: string​

v1.0

completed_time: number​

v1.0

created_by: string​

v1.0

creation_date: number​

v1.0

download_limit: number​

v1.0

file_priorities: number[]​

v1.0

finished_time: number​

v1.0

flags: LtTorrentFlags​

v1.0

info_hash: LtInfoHash​

v1.0

last_download: number​

v1.0

last_seen_complete: number​

v1.0

last_upload: number​

v1.0

max_connections: number​

v1.0

max_uploads: number​

v1.0

name: string​

v1.0

num_complete: number​

v1.0

num_downloaded: number​

v1.0

num_incomplete: number​

v1.0

part_file_dir: string​

v1.0

root_certificate: string​

v1.0

save_path: string​

v1.0

seeding_time: number​

v1.0

storage_mode: string​

v1.0

ti: LtTorrentInfo​

v1.0

trackerid: string​

v1.0

tracker_tiers: number[]​

v1.0

trackers: string[]​

v1.0

total_downloaded: number​

v1.0

total_uploaded: number​

v1.0

upload_limit: number​

v1.0

url_seeds: string[]​

v1.0