torrex v0.1.2 Torrex

Generate .torrent files for single files and directories.

Summary

Types

List of announce URLs (optional)

Include a free-form textual comment (optional)

Name of version of the program used to create the .torrent (optional)

Include the creation time of the torrent, in standard UNIX epoch format (optional). Defaults to true

Path to a directory of files

Encodable types

Path to a file

Include an md5 of all files in the torrent (optional). Defaults to false

Name of the output .torrent file. Defaults to provided file/directory name

Length of each file piece in the torrent. Defaults to 512 KiB

Is the torrent private (optional)? Defaults to false

Functions

Decodes a .torrent file

See decode/1, raises on errors

Encodes a file or directory to a .torrent file

Types

announce_list()
announce_list() :: {:announce_list, [String.t]}

List of announce URLs (optional).

comment()
comment() :: {:comment, String.t}

Include a free-form textual comment (optional).

created_by()
created_by() :: {:created_by, String.t}

Name of version of the program used to create the .torrent (optional).

creation_date()
creation_date() :: {:creation_date, boolean}

Include the creation time of the torrent, in standard UNIX epoch format (optional). Defaults to true.

directory()
directory() :: String.t

Path to a directory of files.

encodable()
encodable() :: file | directory

Encodable types.

file()
file() :: String.t

Path to a file.

md5sum()
md5sum() :: {:md5sum, boolean}

Include an md5 of all files in the torrent (optional). Defaults to false.

options()
options() :: [option]
output()
output() :: {:output, String.t}

Name of the output .torrent file. Defaults to provided file/directory name.

piece_length()
piece_length() :: {:piece_length, integer}

Length of each file piece in the torrent. Defaults to 512 KiB.

private()
private() :: {:private, boolean}

Is the torrent private (optional)? Defaults to false.

Functions

decode(path)
decode(file) :: {:ok, map} | {:error, term}

Decodes a .torrent file.

decode!(path)
decode!(String.t) :: map

See decode/1, raises on errors.

encode(path, announce, opts \\ [])

Encodes a file or directory to a .torrent file.