ParseTorrent v0.3.1 ParseTorrent View Source

A module for convenient .torrent parsing

Link to this section Summary

Functions

Parses a torrent binary and returns a map.

Parses a torrent binary and returns a map. Will raise if binary is invalid.

Link to this section Functions

Link to this function

parse(data) View Source
parse(binary()) :: {:ok, map()} | :error

Parses a torrent binary and returns a map.

## Example:

  data = File.read!("test/torrents/leaves.torrent")
  {:ok, torrent_map} = ParseTorrent.parse(data)

Parses a torrent binary and returns a map. Will raise if binary is invalid.

## Example:

  data = File.read!("test/torrents/leaves.torrent")
  torrent_map = ParseTorrent.parse!(data)