torrentfile

package
v0.0.0-...-806d497 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Port uint16 = 6881

Port to listen on

Variables

This section is empty.

Functions

This section is empty.

Types

type Files

type Files struct {
	Lenght int      `bencode:"length"`
	Path   []string `bencode:"path"`
}

type MetaInfo

type MetaInfo struct {
	InfoBytes bencode2.Bytes `bencode:"info,omitempty"`
}

type TorrentFile

type TorrentFile struct {
	Announce     string
	AnnounceList []string
	InfoHash     [20]byte
	PieceHashes  [][20]byte
	PieceLength  int
	Length       int
	Name         string
	Files        []string
	FileLenght   map[string]int
}

TorrentFile encodes the metadata from a .torrent file

func Open

func Open(path string) (TorrentFile, error)

Open parses a torrent file

func (*TorrentFile) DownloadToFile

func (t *TorrentFile) DownloadToFile(path string) error

DownloadToFile downloads a torrent and writes it to a file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL