torrent

package
v0.0.0-...-288be38 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TorrentDownloadsKey = "td"
	ThePirateBayKey     = "tpb"
	OttsKey             = "otts"
)

Variables

View Source
var (
	Regex   = regexp.MustCompile("[[:^ascii:]]")
	Timeout = time.Duration(15000 * 1000 * 1000)

	Transmission, _ = transmissionrpc.New(
		os.Getenv("FLIXCTL_HOST"),
		strings.Split(os.Getenv("TR_AUTH"), ":")[0],
		strings.Split(os.Getenv("TR_AUTH"), ":")[1],
		&transmissionrpc.AdvancedConfig{
			HTTPS: true,
			Port:  uint16(port),
		})

	Sources = map[string]string{
		TorrentDownloadsKey: "Torrent Downloads",
		ThePirateBayKey:     "The Pirate Bay",
		OttsKey:             "1337x",
	}

	TdTorListCh     = make(chan []Result)
	TpbTorListCh    = make(chan []Result)
	OttsTorListCh   = make(chan []Result)
	TdSearchErrCh   = make(chan error)
	TpbSearchErrCh  = make(chan error)
	OttsSearchErrCh = make(chan error)
)

Functions

func Merge

func Merge(search *Search) [3]error

func SearchTorrents

func SearchTorrents(search *Search)

func Status

func Status() []transmissionrpc.Torrent

func TriggerDownload

func TriggerDownload(magnetLink string, downloadDir string) *transmissionrpc.Torrent

Types

type Result

type Result struct {
	FileURL    string
	Magnet     string
	DescURL    string
	Name       string
	Size       string
	Quality    string
	Seeders    int
	Leechers   int
	UploadDate string
	Source     string
	FilePath   string
}
type Search struct {
	In              string
	Out             []Result
	SourcesToLookup []string
}

Jump to

Keyboard shortcuts

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