bittorrent

package
v0.0.0-...-a6eb964 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResolutionUnknown ...
	ResolutionUnknown = iota
	// Resolution240p ...
	Resolution240p
	// Resolution480p ...
	Resolution480p
	// Resolution720p ...
	Resolution720p
	// Resolution1080p ...
	Resolution1080p
	// Resolution2K ...
	Resolution2K
	// Resolution4k ...
	Resolution4k
)
View Source
const (
	// RipUnknown ...
	RipUnknown = iota
	// RipCam ...
	RipCam
	// RipTS ...
	RipTS
	// RipTC ...
	RipTC
	// RipScr ...
	RipScr
	// RipDVDScr ...
	RipDVDScr
	// RipDVD ...
	RipDVD
	// RipHDTV ...
	RipHDTV
	// RipWeb ...
	RipWeb
	// RipBluRay ...
	RipBluRay
)
View Source
const (
	// RatingUnkown ...
	RatingUnkown = iota
	// RatingProper ...
	RatingProper
	// RatingNuked ...
	RatingNuked
)
View Source
const (
	// CodecUnknown ...
	CodecUnknown = iota

	// CodecXVid ...
	CodecXVid
	// CodecH264 ...
	CodecH264
	// CodecH265 ...
	CodecH265

	// CodecMp3 ...
	CodecMp3
	// CodecAAC ...
	CodecAAC
	// CodecAC3 ...
	CodecAC3
	// CodecDTS ...
	CodecDTS
	// CodecDTSHD ...
	CodecDTSHD
	// CodecDTSHDMA ...
	CodecDTSHDMA
)
View Source
const (
	// StorageFile ...
	StorageFile int = iota
	// StorageMemory ...
	StorageMemory
)
View Source
const (
	// StatusQueued ...
	StatusQueued = iota
	// StatusChecking ...
	StatusChecking
	// StatusFinding ...
	StatusFinding
	// StatusDownloading ...
	StatusDownloading
	// StatusFinished ...
	StatusFinished
	// StatusSeeding ...
	StatusSeeding
	// StatusAllocating ...
	StatusAllocating
	// StatusStalled ...
	StatusStalled
	// StatusPaused ...
	StatusPaused
	// StatusBuffering ...
	StatusBuffering
	// StatusPlaying ...
	StatusPlaying
)
View Source
const (
	// Remove ...
	Remove = iota
	// Active ...
	Active
)
View Source
const (
	// ProxyTypeNone ...
	ProxyTypeNone = iota
	// ProxyTypeSocks4 ...
	ProxyTypeSocks4
	// ProxyTypeSocks5 ...
	ProxyTypeSocks5
	// ProxyTypeSocks5Password ...
	ProxyTypeSocks5Password
	// ProxyTypeSocksHTTP ...
	ProxyTypeSocksHTTP
	// ProxyTypeSocksHTTPPassword ...
	ProxyTypeSocksHTTPPassword
	// ProxyTypeI2PSAM ...
	ProxyTypeI2PSAM
)
View Source
const (
	// EndBufferSize ...
	EndBufferSize int64 = 5400276 // ~5.5mb

)

Variables

View Source
var (

	// Resolutions ...
	Resolutions = []string{"", "240p", "480p", "720p", "1080p", "2K", "4K"}
	// Colors ...
	Colors = []string{"", "FFFC3401", "FFA56F01", "FF539A02", "FF0166FC", "FFF15052", "FF6BB9EC"}
)
View Source
var (

	// Codecs ...
	Codecs = []string{"", "Xvid", "H.264", "H.265", "MP3", "AAC", "AC3", "DTS", "DTS HD", "DTS HD MA"}
)
View Source
var DefaultTrackers = []string{
	"http://bt4.t-ru.org/ann?magnet",
	"http://retracker.mgts.by:80/announce",
	"http://tracker.city9x.com:2710/announce",
	"http://tracker.electro-torrent.pl:80/announce",
	"http://tracker.internetwarriors.net:1337/announce",
	"http://bt.svao-ix.ru/announce",

	"udp://tracker.opentrackr.org:1337/announce",
	"udp://tracker.coppersurfer.tk:6969/announce",
	"udp://tracker.leechers-paradise.org:6969/announce",
	"udp://tracker.openbittorrent.com:80/announce",
	"udp://public.popcorn-tracker.org:6969/announce",
	"udp://explodie.org:6969",
	"udp://46.148.18.250:2710",
	"udp://opentor.org:2710",
}

DefaultTrackers ...

View Source
var (

	// Rips ...
	Rips = []string{"", "Cam", "TeleSync", "TeleCine", "Screener", "DVD Screener", "DVDRip", "HDTV", "WebDL", "Blu-Ray"}
)
View Source
var StatusStrings = []string{
	"Queued",
	"Checking",
	"Finding",
	"Downloading",
	"Finished",
	"Seeding",
	"Allocating",
	"Stalled",
	"Paused",
	"Buffering",
	"Playing",
}

StatusStrings ...

View Source
var (
	// Storages ...
	Storages = []string{
		"File",
		"Memory",
	}
)

Functions

func DebugAll

func DebugAll(s *Service) http.Handler

DebugAll ...

func DebugBundle

func DebugBundle(s *Service) http.Handler

DebugBundle ...

Types

type Action

type Action int32

Action ...

const (
	// ActionConnect ...
	ActionConnect Action = iota
	// ActionAnnounce ...
	ActionAnnounce
	// ActionScrape ...
	ActionScrape
	// ActionError ...
	ActionError = 50331648 // it's LittleEndian(3), in BigEndian, don't ask
)

type Alert

type Alert struct {
	Type     int
	Category int
	What     string
	Message  string
	Pointer  uintptr
	Name     string
	Entry    lt.Entry
	InfoHash string
}

Alert ...

type AnnounceRequest

type AnnounceRequest struct {
	InfoHash   [20]byte
	PeerID     [20]byte
	Downloaded int64
	Left       int64
	Uploaded   int64
	Event      int32
	IPAddress  int32
	Key        int32
	NumWant    int32
	Port       int16
}

AnnounceRequest ...

type AnnounceResponse

type AnnounceResponse struct {
	Interval int32
	Leechers int32
	Seeders  int32
}

AnnounceResponse ...

type Bitfield

type Bitfield []byte

Bitfield ...

func (Bitfield) GetBit

func (b Bitfield) GetBit(idx int) bool

GetBit ...

func (Bitfield) SetBit

func (b Bitfield) SetBit(idx int, value bool)

SetBit ...

func (Bitfield) String

func (b Bitfield) String() string

String ...

type ConnectionResponse

type ConnectionResponse struct {
	ConnectionID int64
}

ConnectionResponse ...

type File

type File struct {
	Selected   bool
	Index      int
	Name       string
	Size       int64
	Path       string
	Offset     int64
	PieceStart int
	PieceEnd   int
}

File ...

type MemoryFile

type MemoryFile struct {
	// contains filtered or unexported fields
}

MemoryFile ...

func NewMemoryFile

func NewMemoryFile(tf *TorrentFS, storage lt.MemoryStorage, file *File, path string) *MemoryFile

NewMemoryFile ...

func (*MemoryFile) Close

func (mf *MemoryFile) Close() (err error)

Close ...

func (*MemoryFile) IsDir

func (mf *MemoryFile) IsDir() bool

IsDir ...

func (*MemoryFile) ModTime

func (mf *MemoryFile) ModTime() time.Time

ModTime ...

func (*MemoryFile) Mode

func (mf *MemoryFile) Mode() os.FileMode

Mode ...

func (*MemoryFile) Name

func (mf *MemoryFile) Name() string

Name ...

func (*MemoryFile) Read

func (mf *MemoryFile) Read(b []byte) (n int, err error)

Read ...

func (*MemoryFile) ReadPiece

func (mf *MemoryFile) ReadPiece(b []byte, piece int, pieceOffset int) (n int, err error)

ReadPiece ...

func (*MemoryFile) Readdir

func (mf *MemoryFile) Readdir(count int) (ret []os.FileInfo, err error)

Readdir ...

func (*MemoryFile) Seek

func (mf *MemoryFile) Seek(off int64, whence int) (ret int64, err error)

Seek ...

func (*MemoryFile) Size

func (mf *MemoryFile) Size() int64

Size ...

func (*MemoryFile) Stat

func (mf *MemoryFile) Stat() (ret os.FileInfo, err error)

Stat ...

func (*MemoryFile) Sys

func (mf *MemoryFile) Sys() interface{}

Sys ...

type NextEpisode

type NextEpisode struct {
	// contains filtered or unexported fields
}

NextEpisode ...

type Peer

type Peer struct {
	IPAddress int32
	Port      int16
}

Peer ...

type PieceRange

type PieceRange struct {
	Begin, End int
}

PieceRange ...

type Player

type Player struct {
	// contains filtered or unexported fields
}

Player ...

func NewPlayer

func NewPlayer(bts *Service, params PlayerParams) *Player

NewPlayer ...

func (*Player) Buffer

func (btp *Player) Buffer() error

Buffer ...

func (*Player) Close

func (btp *Player) Close()

Close ...

func (*Player) FetchStoredResume

func (btp *Player) FetchStoredResume()

FetchStoredResume ...

func (*Player) GetIdent

func (btp *Player) GetIdent()

GetIdent tries to find playing item in Kodi library

func (*Player) GetTorrent

func (btp *Player) GetTorrent() *Torrent

GetTorrent ...

func (*Player) HasChosenFile

func (btp *Player) HasChosenFile() bool

HasChosenFile ...

func (*Player) IsWatched

func (btp *Player) IsWatched() bool

IsWatched ...

func (*Player) Params

func (btp *Player) Params() *PlayerParams

Params returns Params for external use

func (*Player) PlayURL

func (btp *Player) PlayURL() string

PlayURL ...

func (*Player) SaveStoredResume

func (btp *Player) SaveStoredResume()

SaveStoredResume ...

func (*Player) SetTorrent

func (btp *Player) SetTorrent(t *Torrent)

SetTorrent ...

func (*Player) UpdateWatched

func (btp *Player) UpdateWatched()

UpdateWatched is updating watched progress is Kodi

type PlayerParams

type PlayerParams struct {
	Playing         bool
	Paused          bool
	Seeked          bool
	WasPlaying      bool
	WasSeeked       bool
	KodiPosition    int
	WatchedProgress int
	WatchedTime     float64
	VideoDuration   float64
	URI             string
	FileIndex       int
	ResumeToken     string
	ResumeHash      string
	ResumePlayback  bool
	ContentType     string
	KodiID          int
	TMDBId          int
	ShowID          int
	Season          int
	Episode         int
	Query           string
	UIDs            *library.UniqueIDs
	Resume          *library.Resume
	StoredResume    *library.Resume
}

PlayerParams ...

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue represents list of torrents inside of a session

func NewQueue

func NewQueue(s *Service) *Queue

NewQueue contructor for empty Queue

func (*Queue) Add

func (q *Queue) Add(t *Torrent) bool

Add torrent to the queue

func (*Queue) All

func (q *Queue) All() []*Torrent

All returns all queue

func (*Queue) Clean

func (q *Queue) Clean()

Clean would cleanup torrents list, should be used in case of a service reload

func (*Queue) Delete

func (q *Queue) Delete(t *Torrent) bool

Delete removes torrent from the queue

func (*Queue) FindByHash

func (q *Queue) FindByHash(hash string) *Torrent

FindByHash checks if torrent with infohash is in the queue

type ScrapeResponseEntry

type ScrapeResponseEntry struct {
	Seeders   int32
	Completed int32
	Leechers  int32
}

ScrapeResponseEntry ...

type Service

type Service struct {
	Session      lt.Session
	PackSettings lt.SettingsPack

	InternalProxy *http.Server

	Players      map[string]*Player
	SpaceChecked map[string]bool

	UserAgent   string
	PeerID      string
	ListenIP    string
	ListenIPv6  string
	ListenPort  int
	DisableIPv6 bool

	MarkedToMove string

	Closer util.Event
	// contains filtered or unexported fields
}

Service ...

func NewService

func NewService() *Service

NewService ...

func (*Service) AddTorrent

func (s *Service) AddTorrent(uri string, paused bool) (*Torrent, error)

AddTorrent ...

func (*Service) Alerts

func (s *Service) Alerts() (<-chan *Alert, chan<- interface{})

Alerts ...

func (*Service) AttachPlayer

func (s *Service) AttachPlayer(p *Player)

AttachPlayer adds Player instance to service

func (*Service) ClientInfo

func (s *Service) ClientInfo(_w io.Writer)

ClientInfo ...

func (*Service) Close

func (s *Service) Close(isShutdown bool)

Close ...

func (*Service) CloseSession

func (s *Service) CloseSession()

CloseSession tries to close libtorrent session with a timeout, because it takes too much to close and Kodi hangs.

func (*Service) DetachPlayer

func (s *Service) DetachPlayer(p *Player)

DetachPlayer removes Player instance

func (*Service) GetActivePlayer

func (s *Service) GetActivePlayer() *Player

GetActivePlayer searches for player that is Playing anything

func (*Service) GetBufferSize

func (s *Service) GetBufferSize() int64

GetBufferSize ...

func (*Service) GetListenIP

func (s *Service) GetListenIP(network string) string

GetListenIP returns calculated IP for TCP/TCP6

func (*Service) GetMemorySize

func (s *Service) GetMemorySize() int64

GetMemorySize ...

func (*Service) GetMemoryStats

func (s *Service) GetMemoryStats() (int64, int64)

GetMemoryStats returns total and free memory sizes for this OS

func (*Service) GetPlayer

func (s *Service) GetPlayer(kodiID int, tmdbID int) *Player

GetPlayer searches for player with desired TMDB id

func (*Service) GetSeedTime

func (s *Service) GetSeedTime() int64

GetSeedTime ...

func (*Service) GetStorageType

func (s *Service) GetStorageType() int

GetStorageType ...

func (*Service) GetTorrentByFakeID

func (s *Service) GetTorrentByFakeID(query string) *Torrent

GetTorrentByFakeID checks whether there is active torrent with fake id

func (*Service) GetTorrentByHash

func (s *Service) GetTorrentByHash(hash string) *Torrent

GetTorrentByHash ...

func (*Service) GetTorrents

func (s *Service) GetTorrents() []*Torrent

GetTorrents return all active torrents

func (*Service) HasTorrentByEpisode

func (s *Service) HasTorrentByEpisode(tmdbID int, season, episode int) (string, bool)

HasTorrentByEpisode checks whether there is active torrent for queried episode

func (*Service) HasTorrentByID

func (s *Service) HasTorrentByID(tmdbID int) string

HasTorrentByID checks whether there is active torrent for queried tmdb id

func (*Service) HasTorrentByName

func (s *Service) HasTorrentByName(query string) string

HasTorrentByName checks whether there is active torrent for queried name

func (*Service) HasTorrentByQuery

func (s *Service) HasTorrentByQuery(query string) string

HasTorrentByQuery checks whether there is active torrent with searches query

func (*Service) HasTorrentBySeason

func (s *Service) HasTorrentBySeason(tmdbID int, season int) string

HasTorrentBySeason checks whether there is active torrent for queried season

func (*Service) IsMemoryStorage

func (s *Service) IsMemoryStorage() bool

IsMemoryStorage is a shortcut for checking whether we run memory storage

func (*Service) PlayerSeek

func (s *Service) PlayerSeek()

PlayerSeek ...

func (*Service) PlayerStop

func (s *Service) PlayerStop()

PlayerStop ...

func (*Service) Reconfigure

func (s *Service) Reconfigure()

Reconfigure fired every time addon configuration has changed and Kodi sent a notification about that. Should reassemble Service configuration and restart everything. For non-memory storage it should also load old torrent files.

func (*Service) RemoveTorrent

func (s *Service) RemoveTorrent(torrent *Torrent, removeFiles bool) bool

RemoveTorrent ...

func (*Service) RestoreLimits

func (s *Service) RestoreLimits()

RestoreLimits ...

func (*Service) SetBufferingLimits

func (s *Service) SetBufferingLimits()

SetBufferingLimits ...

func (*Service) SetDownloadLimit

func (s *Service) SetDownloadLimit(i int)

SetDownloadLimit ...

func (*Service) SetUploadLimit

func (s *Service) SetUploadLimit(i int)

SetUploadLimit ...

type Torrent

type Torrent struct {
	ChosenFiles []*File
	TorrentPath string

	Service *Service

	BufferLength           int64
	BufferProgress         float64
	BufferProgressPrevious float64
	BufferPiecesLength     int64
	BufferPiecesProgress   map[int]float64
	BufferEndPieces        []int
	MemorySize             int64

	IsPlaying           bool
	IsPaused            bool
	IsBuffering         bool
	IsBufferingFinished bool
	IsSeeding           bool
	IsRarArchive        bool
	IsNextEpisode       bool

	DBItem *database.BTItem

	Closer util.Event
	// contains filtered or unexported fields
}

Torrent ...

func NewTorrent

func NewTorrent(service *Service, handle lt.TorrentHandle, info lt.TorrentInfo, path string) *Torrent

NewTorrent ...

func (*Torrent) AdjustMemorySize

func (t *Torrent) AdjustMemorySize(ms int64)

AdjustMemorySize ...

func (*Torrent) Buffer

func (t *Torrent) Buffer(file *File)

Buffer defines buffer pieces for downloading prior to sending file to Kodi. Kodi sends two requests, one for onecoming file read handler, another for a piece of file from the end (probably to get codec descriptors and so on) We set it as post-buffer and include in required buffer pieces array.

func (*Torrent) CloseReaders

func (t *Torrent) CloseReaders()

CloseReaders ...

func (*Torrent) DownloadAllFiles

func (t *Torrent) DownloadAllFiles()

DownloadAllFiles ...

func (*Torrent) DownloadFile

func (t *Torrent) DownloadFile(addFile *File)

DownloadFile ...

func (*Torrent) Drop

func (t *Torrent) Drop(removeFiles bool)

Drop ...

func (*Torrent) FetchDBItem

func (t *Torrent) FetchDBItem() *database.BTItem

FetchDBItem ...

func (*Torrent) GetAddedTime

func (t *Torrent) GetAddedTime() time.Time

GetAddedTime ...

func (*Torrent) GetBufferProgress

func (t *Torrent) GetBufferProgress() float64

GetBufferProgress ...

func (*Torrent) GetConnections

func (t *Torrent) GetConnections() (int, int, int, int)

GetConnections returns connected and overall number of peers

func (*Torrent) GetDBItem

func (t *Torrent) GetDBItem() *database.BTItem

GetDBItem ...

func (*Torrent) GetFileByIndex

func (t *Torrent) GetFileByIndex(q int) *File

GetFileByIndex ...

func (*Torrent) GetFileByPath

func (t *Torrent) GetFileByPath(q string) *File

GetFileByPath ...

func (*Torrent) GetFilePieces

func (t *Torrent) GetFilePieces(files lt.FileStorage, idx int) (ret PieceRange)

GetFilePieces ...

func (*Torrent) GetHandle

func (t *Torrent) GetHandle() lt.TorrentHandle

GetHandle ...

func (*Torrent) GetHumanizedSpeeds

func (t *Torrent) GetHumanizedSpeeds() (down, up string)

GetHumanizedSpeeds returns humanize download and upload speeds

func (*Torrent) GetMetadata

func (t *Torrent) GetMetadata() []byte

GetMetadata ...

func (*Torrent) GetNextEpisodeFile

func (t *Torrent) GetNextEpisodeFile(season, episode int) *File

GetNextEpisodeFile ...

func (*Torrent) GetPaused

func (t *Torrent) GetPaused() bool

GetPaused ...

func (*Torrent) GetProgress

func (t *Torrent) GetProgress() float64

GetProgress ...

func (*Torrent) GetReadaheadSize

func (t *Torrent) GetReadaheadSize() (ret int64)

GetReadaheadSize ...

func (*Torrent) GetSpeeds

func (t *Torrent) GetSpeeds() (down, up int)

GetSpeeds returns download and upload speeds

func (*Torrent) GetState

func (t *Torrent) GetState() int

GetState ...

func (*Torrent) GetStateString

func (t *Torrent) GetStateString() string

GetStateString ...

func (*Torrent) GetStatus

func (t *Torrent) GetStatus() lt.TorrentStatus

GetStatus ...

func (*Torrent) GotInfo

func (t *Torrent) GotInfo() <-chan struct{}

GotInfo ...

func (*Torrent) HasAvailableFiles

func (t *Torrent) HasAvailableFiles() bool

HasAvailableFiles ...

func (*Torrent) HasMetadata

func (t *Torrent) HasMetadata() bool

HasMetadata ...

func (*Torrent) InfoHash

func (t *Torrent) InfoHash() string

InfoHash ...

func (*Torrent) Length

func (t *Torrent) Length() int64

Length ...

func (*Torrent) MakeFiles

func (t *Torrent) MakeFiles()

MakeFiles ...

func (*Torrent) Name

func (t *Torrent) Name() string

Name ...

func (*Torrent) Pause

func (t *Torrent) Pause()

Pause ...

func (*Torrent) PrioritizePiece

func (t *Torrent) PrioritizePiece(piece int)

PrioritizePiece ...

func (*Torrent) PrioritizePieces

func (t *Torrent) PrioritizePieces()

PrioritizePieces ...

func (*Torrent) ResetReaders

func (t *Torrent) ResetReaders()

ResetReaders ...

func (*Torrent) Resume

func (t *Torrent) Resume()

Resume ...

func (*Torrent) SaveMetainfo

func (t *Torrent) SaveMetainfo(path string) error

SaveMetainfo ...

func (*Torrent) Storage

func (t *Torrent) Storage() lt.StorageInterface

Storage ...

func (*Torrent) UnDownloadAllFiles

func (t *Torrent) UnDownloadAllFiles()

UnDownloadAllFiles ...

func (*Torrent) UnDownloadFile

func (t *Torrent) UnDownloadFile(addFile *File) bool

UnDownloadFile ...

func (*Torrent) Watch

func (t *Torrent) Watch()

Watch ...

type TorrentFS

type TorrentFS struct {
	http.Dir
	// contains filtered or unexported fields
}

TorrentFS ...

func NewTorrentFS

func NewTorrentFS(service *Service) *TorrentFS

NewTorrentFS ...

func (*TorrentFS) Open

func (tfs *TorrentFS) Open(uname string) (http.File, error)

Open ...

type TorrentFSEntry

type TorrentFSEntry struct {
	http.File
	// contains filtered or unexported fields
}

TorrentFSEntry ...

func NewTorrentFSEntry

func NewTorrentFSEntry(file http.File, tfs *TorrentFS, t *Torrent, f *File, name string) (*TorrentFSEntry, error)

NewTorrentFSEntry ...

func (*TorrentFSEntry) Close

func (tf *TorrentFSEntry) Close() error

Close ...

func (*TorrentFSEntry) IsActive

func (tf *TorrentFSEntry) IsActive() bool

IsActive ...

func (*TorrentFSEntry) IsIdle

func (tf *TorrentFSEntry) IsIdle() bool

IsIdle ...

func (*TorrentFSEntry) Read

func (tf *TorrentFSEntry) Read(data []byte) (n int, err error)

Read ...

func (*TorrentFSEntry) ReaderPiecesRange

func (tf *TorrentFSEntry) ReaderPiecesRange() (ret PieceRange)

ReaderPiecesRange ...

func (*TorrentFSEntry) Seek

func (tf *TorrentFSEntry) Seek(offset int64, whence int) (int64, error)

Seek ...

func (*TorrentFSEntry) SetActive

func (tf *TorrentFSEntry) SetActive(is bool)

SetActive ...

type TorrentFile

type TorrentFile struct {
	URI        string   `json:"uri"`
	InfoHash   string   `json:"info_hash"`
	Title      string   `json:"title"`
	Name       string   `json:"name"`
	Trackers   []string `json:"trackers"`
	Size       string   `json:"size"`
	SizeParsed uint64   `jsin:"-"`
	Seeds      int64    `json:"seeds"`
	Peers      int64    `json:"peers"`
	IsPrivate  bool     `json:"is_private"`
	Provider   string   `json:"provider"`
	Icon       string   `json:"icon"`
	Multi      bool

	Resolution  int    `json:"resolution"`
	VideoCodec  int    `json:"video_codec"`
	AudioCodec  int    `json:"audio_codec"`
	Language    string `json:"language"`
	RipType     int    `json:"rip_type"`
	SceneRating int    `json:"scene_rating"`
	// contains filtered or unexported fields
}

TorrentFile represents a physical torrent file

func NewTorrentFile

func NewTorrentFile(uri string) *TorrentFile

NewTorrentFile ...

func (*TorrentFile) IsMagnet

func (t *TorrentFile) IsMagnet() bool

IsMagnet ...

func (*TorrentFile) IsValidMagnet

func (t *TorrentFile) IsValidMagnet() (err error)

IsValidMagnet Taken from anacrolix/torrent

func (*TorrentFile) LoadFromBytes

func (t *TorrentFile) LoadFromBytes(in []byte) error

LoadFromBytes ...

func (*TorrentFile) Magnet

func (t *TorrentFile) Magnet()

Magnet ...

func (*TorrentFile) MarshalJSON

func (t *TorrentFile) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*TorrentFile) Resolve

func (t *TorrentFile) Resolve() error

Resolve ...

func (*TorrentFile) StreamInfo

func (t *TorrentFile) StreamInfo() *xbmc.StreamInfo

StreamInfo ...

func (*TorrentFile) UnmarshalJSON

func (t *TorrentFile) UnmarshalJSON(b []byte) error

UnmarshalJSON ...

type TorrentFileRaw

type TorrentFileRaw struct {
	Title        string                 `bencode:"title"`
	Announce     string                 `bencode:"announce"`
	AnnounceList [][]string             `bencode:"announce-list"`
	Info         map[string]interface{} `bencode:"info"`
}

TorrentFileRaw ...

type Tracker

type Tracker struct {
	URL *url.URL
	// contains filtered or unexported fields
}

Tracker ...

func NewTracker

func NewTracker(trackerURL string) (tracker *Tracker, err error)

NewTracker ...

func (*Tracker) Connect

func (tracker *Tracker) Connect() error

Connect ...

func (*Tracker) Scrape

func (tracker *Tracker) Scrape(torrents []*TorrentFile) []ScrapeResponseEntry

Scrape ...

func (*Tracker) String

func (tracker *Tracker) String() string

type TrackerRequest

type TrackerRequest struct {
	ConnectionID  int64
	Action        Action
	TransactionID int32
}

TrackerRequest ...

type TrackerResponse

type TrackerResponse struct {
	Action        Action
	TransactionID int32
}

TrackerResponse ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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