torrent

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewTorrents

func GetNewTorrents(client *indexer.Facade, fetchOptions *indexer.GenericSearchOptions) error

GetNewTorrents gets the latest torrents.

func ResolveTorrents

func ResolveTorrents(client *indexer.Facade, hours int)

Gets torrent information from a given tracker and updates the torrent db

Types

type Definition

type Definition struct {
	Announce     string     "announce"
	AnnounceList [][]string "announce-list"
	Comment      string     "comment"
	CreatedBy    string     "created by"
	CreationDate uint       "creation date"
	Encoding     string     "encoding"
	Info         DefinitionInfo
	Publisher    string "publisher"
	PublisherUrl string "publisher-url"
	InfoBuffer   []byte
	InfoHash     string
}

func ParseTorrent

func ParseTorrent(torrent string) (*Definition, error)

func ParseTorrentFromStream

func ParseTorrentFromStream(stream io.ReadCloser) (*Definition, error)

func ParseTorrentFromUrl

func ParseTorrentFromUrl(h *indexer.Facade, torrentUrl string) (*Definition, error)

func (*Definition) GetTotalFileSize

func (d *Definition) GetTotalFileSize() uint32

func (*Definition) ToMagnetUrl

func (d *Definition) ToMagnetUrl() string

type DefinitionFile

type DefinitionFile struct {
	Length uint64   "length"
	Path   []string "path"
}

type DefinitionInfo

type DefinitionInfo struct {
	FileDuration []int               "file-duration"
	FileMedia    []int               "file-media"
	Files        []DefinitionFile    "files"
	Name         string              "name"
	PieceLength  uint                "piece length"
	Pieces       string              "pieces"
	Profiles     []DefinitionProfile "profiles"
}

type DefinitionProfile

type DefinitionProfile struct {
	ACodec string "acodec"
	Height uint   "height"
	VCodec string "vcodec"
	Width  uint   "width"
}

type RawDefinition

type RawDefinition struct {
	Announce     string
	AnnounceList [][]string "announce-list"
	Comment      string
	CreatedBy    string "created by"
	CreationDate uint   "creation date"
	Encoding     string
	Info         DefinitionInfo
	Publisher    string
	PublisherUrl string "publisher-url"
}

Jump to

Keyboard shortcuts

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