tracker

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EPUBFormat        = "15"
	ErrorUploadFailed = "upload failed"
)
View Source
const (
	FormatFLAC = "FLAC"
	FormatMP3  = "MP3"
	FormatAAC  = "AAC"
	FormatAC3  = "AC3"
	FormatDTS  = "DTS"

	SourceCD         = "CD"
	SourceWEB        = "WEB"
	SourceDVD        = "DVD"
	SourceVinyl      = "Vinyl"
	SourceSoundboard = "Soundboard"
	SourceDAT        = "DAT"
	SourceCassette   = "Cassette"
	SourceBluRay     = "Blu-Ray"
	SourceSACD       = "SACD"

	Quality192           = "192"
	Quality256           = "256"
	Quality320           = "320"
	QualityAPS           = "APS (VBR)"
	QualityAPX           = "APX (VBR)"
	QualityV2            = "V2 (VBR)"
	QualityV1            = "V1 (VBR)"
	QualityV0            = "V0 (VBR)"
	QualityLossless      = "Lossless"
	Quality24bitLossless = "24bit Lossless"

	ReleaseAlbum       = "Album"
	ReleaseSoundtrack  = "Soundtrack"
	ReleaseEP          = "EP"
	ReleaseAnthology   = "Anthology"
	ReleaseCompilation = "Compilation"
	ReleaseSingle      = "Single"
	ReleaseLive        = "Live album"
	ReleaseRemix       = "Remix"
	ReleaseBootleg     = "Bootleg"
	ReleaseInterview   = "Interview"
	ReleaseMixtape     = "Mixtape"
	ReleaseDemo        = "Demo"
	ReleaseConcert     = "Concert Recording"
	ReleaseDJMix       = "DJ Mix"
	ReleaseUnknown     = "Unknown"

	RoleMain      = "Main"
	RoleGuest     = "Guest"
	RoleComposer  = "Composer"
	RoleConductor = "Conductor"
	RoleDJ        = "DJ / Compiler"
	RoleRemixer   = "Remixer"
	RoleProducer  = "Producer"

	TrackPattern   = `(.*[.flac|.FLAC|.mp3|.MP3]){{{(\d*)}}}`
	VariousArtists = "Various Artists"
)

Variables

Functions

func CheckErrors

func CheckErrors(errs ...error) error

CheckErrors and return the first non-nil one.

func GazelleArtistRole added in v0.5.0

func GazelleArtistRole(value int) string

func GazelleArtistRoleByLabel added in v0.5.0

func GazelleArtistRoleByLabel(value string) int

func GazelleReleaseType added in v0.3.0

func GazelleReleaseType(value int) string

func GazelleReleaseTypeByLabel added in v0.5.0

func GazelleReleaseTypeByLabel(value string) int

func ShortEdition added in v0.2.0

func ShortEdition(edition string) string

func ShortEncoding added in v0.2.0

func ShortEncoding(encoding string) string

Types

type BibUploadForm

type BibUploadForm struct {
	TorrentFileField  string
	TitleField        string
	EditorsField      string
	ContributorsField string
	TranslatorsField  string
	PublishersField   string
	PagesField        string
	AuthorsField      string
	FormatField       string // EPUB == "15"
	IsbnField         string
	TagsField         string
	DescriptionField  string
	RetailField       string // retail == "1"
	NotifyField       string // default "1"
	LanguageField     string // english == "1"
	YearField         string
	ImageField        string
	AnonymousField    string // default "0"
	SupplementsField  string // default "0"
}

BibUploadForm tracks all of the upload form fields.

func NewDefaultBibUploadForm

func NewDefaultBibUploadForm() *BibUploadForm

func (*BibUploadForm) ShowInfo

func (uf *BibUploadForm) ShowInfo() string

ShowInfo returns a table with relevant information about a book.

type Bibliotik added in v0.3.0

type Bibliotik struct {
	Tracker
}

func NewBibliotik added in v0.3.0

func NewBibliotik(domain, user, password, cookieValue, userAgent string) (*Bibliotik, error)

func (*Bibliotik) Login added in v0.3.0

func (t *Bibliotik) Login() error

func (*Bibliotik) Search added in v0.3.0

func (t *Bibliotik) Search(args ...string) ([]string, error)

func (*Bibliotik) Upload added in v0.3.0

func (t *Bibliotik) Upload(uf *BibUploadForm) error

type Gazelle added in v0.3.0

type Gazelle struct {
	Tracker
	// contains filtered or unexported fields
}

Gazelle allows querying the Gazelle JSON API.

func NewGazelle added in v0.2.0

func NewGazelle(name, domain, user, password, cookieID, cookieValue, userAgent string) (*Gazelle, error)

func (*Gazelle) AddGroupTags added in v0.7.0

func (t *Gazelle) AddGroupTags(torrentGroupID int, tags []string) error

func (*Gazelle) CopyTagsFromRequest added in v0.7.0

func (t *Gazelle) CopyTagsFromRequest(requestID, torrentGroupID int) error

CopyTagsFromRequest without doing any checks on whether the two are related.

func (*Gazelle) DownloadTorrent added in v0.3.0

func (t *Gazelle) DownloadTorrent(torrentURL, torrentFile, destinationFolder string) error

DownloadTorrent using its download URL.

func (*Gazelle) DownloadTorrentFromID added in v0.3.0

func (t *Gazelle) DownloadTorrentFromID(torrentID string, destinationFolder string, useFLToken bool) error

DownloadTorrentFromID using its ID instead.

func (*Gazelle) EditTorrentDescription added in v0.5.0

func (t *Gazelle) EditTorrentDescription(torrentID int, description string) error

func (*Gazelle) EditTorrentGroupDescription added in v0.5.0

func (t *Gazelle) EditTorrentGroupDescription(torrentGroupID int, description, coverURL string) error

func (*Gazelle) FillRequest added in v0.5.0

func (t *Gazelle) FillRequest(requestID, torrentID int) error

func (*Gazelle) GetArtist added in v0.3.0

func (t *Gazelle) GetArtist(artistID int) (*GazelleArtist, error)

func (*Gazelle) GetLogScore added in v0.3.0

func (t *Gazelle) GetLogScore(logPath string) (string, error)

func (*Gazelle) GetLoggedUserStats added in v0.3.0

func (t *Gazelle) GetLoggedUserStats() (*GazelleUserStats, error)

func (*Gazelle) GetRequest added in v0.5.0

func (t *Gazelle) GetRequest(requestID int) (*Request, error)

GetRequest information from the API

func (*Gazelle) GetTorrent added in v0.3.0

func (t *Gazelle) GetTorrent(torrentID int) (*GazelleTorrent, error)

func (*Gazelle) GetTorrentGroup added in v0.3.0

func (t *Gazelle) GetTorrentGroup(torrentGroupID int) (*GazelleTorrentGroup, error)

func (*Gazelle) GetUserStats added in v0.3.0

func (t *Gazelle) GetUserStats(userID int) (*GazelleUserStats, error)

func (*Gazelle) IsTorrentDeleted added in v0.3.0

func (t *Gazelle) IsTorrentDeleted(torrentID int) (bool, string, error)

func (*Gazelle) Login added in v0.3.0

func (t *Gazelle) Login() error

func (*Gazelle) Search added in v0.5.0

func (t *Gazelle) Search(artist, title string) (*Search, error)

Search for releases from the API

func (*Gazelle) SearchRequest added in v0.5.0

func (t *Gazelle) SearchRequest(artist, title string) (*RequestSearch, error)

SearchRequest information from the API

func (*Gazelle) UploadMusic added in v0.5.0

func (t *Gazelle) UploadMusic(torrentPath string, logFiles []string, metadata *GazelleTorrent) (int, error)

func (*Gazelle) UploadMusicToExistingGroup added in v0.5.0

func (t *Gazelle) UploadMusicToExistingGroup(torrentGroupID int, torrentPath string, logFiles []string, metadata *GazelleTorrent) (int, error)

type GazelleArtist added in v0.2.0

type GazelleArtist struct {
	Response struct {
		Body                 string `json:"body"`
		HasBookmarked        bool   `json:"hasBookmarked"`
		ID                   int    `json:"id"`
		Image                string `json:"image"`
		Name                 string `json:"name"`
		NotificationsEnabled bool   `json:"notificationsEnabled"`
		Requests             []struct {
			Bounty     int    `json:"bounty"`
			CategoryID int    `json:"categoryId"`
			RequestID  int    `json:"requestId"`
			TimeAdded  string `json:"timeAdded"`
			Title      string `json:"title"`
			Votes      int    `json:"votes"`
			Year       int    `json:"year"`
		} `json:"requests"`
		SimilarArtists []struct {
			ArtistID  int    `json:"artistId"`
			Name      string `json:"name"`
			Score     int    `json:"score"`
			SimilarID int    `json:"similarId"`
		} `json:"similarArtists"`
		Statistics struct {
			NumGroups   int `json:"numGroups"`
			NumLeechers int `json:"numLeechers"`
			NumSeeders  int `json:"numSeeders"`
			NumSnatches int `json:"numSnatches"`
			NumTorrents int `json:"numTorrents"`
		} `json:"statistics"`
		Tags []struct {
			Count int    `json:"count"`
			Name  string `json:"name"`
		} `json:"tags"`
		Torrentgroup []struct {
			Artists []struct {
				Aliasid int    `json:"aliasid"`
				ID      int    `json:"id"`
				Name    string `json:"name"`
			} `json:"artists"`
			ExtendedArtists struct {
				One []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"1"`
				Two []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"2"`
				Three []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"3"`
				Four []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"4"`
				Five []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"5"`
				Six []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"6"`
				Seven []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"7"`
			} `json:"extendedArtists"`
			GroupCatalogueNumber string   `json:"groupCatalogueNumber"`
			GroupCategoryID      string   `json:"groupCategoryID"`
			GroupID              int      `json:"groupId"`
			GroupName            string   `json:"groupName"`
			GroupRecordLabel     string   `json:"groupRecordLabel"`
			GroupVanityHouse     bool     `json:"groupVanityHouse"`
			GroupYear            int      `json:"groupYear"`
			HasBookmarked        bool     `json:"hasBookmarked"`
			ReleaseType          int      `json:"releaseType"`
			Tags                 []string `json:"tags"`
			Torrent              []struct {
				Encoding            string `json:"encoding"`
				FileCount           int    `json:"fileCount"`
				Format              string `json:"format"`
				FreeTorrent         bool   `json:"freeTorrent"`
				GroupID             int    `json:"groupId"`
				HasCue              bool   `json:"hasCue"`
				HasFile             int    `json:"hasFile"`
				HasLog              bool   `json:"hasLog"`
				ID                  int    `json:"id"`
				Leechers            int    `json:"leechers"`
				LogScore            int    `json:"logScore"`
				Media               string `json:"media"`
				RemasterRecordLabel string `json:"remasterRecordLabel"`
				RemasterTitle       string `json:"remasterTitle"`
				RemasterYear        int    `json:"remasterYear"`
				Remastered          bool   `json:"remastered"`
				Scene               bool   `json:"scene"`
				Seeders             int    `json:"seeders"`
				Size                int    `json:"size"`
				Snatched            int    `json:"snatched"`
				Time                string `json:"time"`
			} `json:"torrent"`
			WikiImage string `json:"wikiImage"`
		} `json:"torrentgroup"`
		VanityHouse bool `json:"vanityHouse"`
	} `json:"response"`
	Status string `json:"status"`
}

type GazelleGenericResponse added in v0.2.0

type GazelleGenericResponse struct {
	Response interface{} `json:"response"`
	Status   string      `json:"status"`
	Error    string      `json:"error"`
}

type GazelleIndex added in v0.2.0

type GazelleIndex struct {
	Response struct {
		Authkey       string `json:"authkey"`
		ID            int    `json:"id"`
		Notifications struct {
			Messages         int  `json:"messages"`
			NewAnnouncement  bool `json:"newAnnouncement"`
			NewBlog          bool `json:"newBlog"`
			NewSubscriptions bool `json:"newSubscriptions"`
			Notifications    int  `json:"notifications"`
		} `json:"notifications"`
		Passkey   string `json:"passkey"`
		Username  string `json:"username"`
		UserStats struct {
			Class         string  `json:"class"`
			Downloaded    int     `json:"downloaded"`
			Ratio         float64 `json:"ratio"`
			RequiredRatio float64 `json:"requiredratio"`
			Uploaded      int     `json:"uploaded"`
		} `json:"userstats"`
	} `json:"response"`
	Status string `json:"status"`
}

type GazelleTorrent added in v0.2.0

type GazelleTorrent struct {
	Response struct {
		Group struct {
			CatalogueNumber string `json:"catalogueNumber"`
			CategoryID      int    `json:"categoryId"`
			CategoryName    string `json:"categoryName"`
			ID              int    `json:"id"`
			IsBookmarked    bool   `json:"isBookmarked"`
			MusicInfo       struct {
				Artists []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"artists"`
				Composers []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"composers"`
				Conductor []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"conductor"`
				Dj []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"dj"`
				Producer []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"producer"`
				RemixedBy []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"remixedBy"`
				With []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"with"`
			} `json:"musicInfo"`
			Name        string   `json:"name"`
			RecordLabel string   `json:"recordLabel"`
			ReleaseType int      `json:"releaseType"`
			Tags        []string `json:"tags"`
			Time        string   `json:"time"`
			VanityHouse bool     `json:"vanityHouse"`
			WikiBody    string   `json:"wikiBody"`
			WikiImage   string   `json:"wikiImage"`
			Year        int      `json:"year"`
		} `json:"group"`
		Torrent struct {
			Description             string `json:"description"`
			DynamicRange            string `json:"dynamicrange"`
			Encoding                string `json:"encoding"`
			FileCount               int    `json:"fileCount"`
			FileList                string `json:"fileList"`
			FilePath                string `json:"filePath"`
			Format                  string `json:"format"`
			FreeTorrent             bool   `json:"freeTorrent"`
			Grade                   string `json:"grade"`
			HasCue                  bool   `json:"hasCue"`
			HasLog                  bool   `json:"hasLog"`
			ID                      int    `json:"id"`
			InfoHash                string `json:"infoHash"`
			Leechers                int    `json:"leechers"`
			Lineage                 string `json:"lineage"`
			LogScore                int    `json:"logScore"`
			Matrixorrunout          string `json:"matrixorrunout"`
			Media                   string `json:"media"`
			RemasterCatalogueNumber string `json:"remasterCatalogueNumber"`
			RemasterRecordLabel     string `json:"remasterRecordLabel"`
			RemasterTitle           string `json:"remasterTitle"`
			RemasterYear            int    `json:"remasterYear"`
			Remastered              bool   `json:"remastered"`
			Reported                bool   `json:"reported"`
			SampleRate              string `json:"samplerate"`
			Scene                   bool   `json:"scene"`
			Seeders                 int    `json:"seeders"`
			Size                    int    `json:"size"`
			Snatched                int    `json:"snatched"`
			Time                    string `json:"time"`
			UserID                  int    `json:"userId"`
			Username                string `json:"username"`
		} `json:"torrent"`
	} `json:"response"`
	Status string `json:"status"`
}

type GazelleTorrentGroup added in v0.2.0

type GazelleTorrentGroup struct {
	Response struct {
		Group struct {
			CatalogueNumber string `json:"catalogueNumber"`
			CategoryID      int    `json:"categoryId"`
			CategoryName    string `json:"categoryName"`
			ID              int    `json:"id"`
			IsBookmarked    bool   `json:"isBookmarked"`
			MusicInfo       struct {
				Artists []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"artists"`
				Composers []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"composers"`
				Conductor []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"conductor"`
				Dj []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"dj"`
				Producer []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"producer"`
				RemixedBy []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"remixedBy"`
				With []struct {
					ID   int    `json:"id"`
					Name string `json:"name"`
				} `json:"with"`
			} `json:"musicInfo"`
			Name        string   `json:"name"`
			RecordLabel string   `json:"recordLabel"`
			ReleaseType int      `json:"releaseType"`
			Tags        []string `json:"tags"`
			Time        string   `json:"time"`
			VanityHouse bool     `json:"vanityHouse"`
			WikiBody    string   `json:"wikiBody"`
			WikiImage   string   `json:"wikiImage"`
			Year        int      `json:"year"`
		} `json:"group"`
		Torrents []struct {
			Description             string `json:"description"`
			Encoding                string `json:"encoding"`
			FileCount               int    `json:"fileCount"`
			FileList                string `json:"fileList"`
			FilePath                string `json:"filePath"`
			Format                  string `json:"format"`
			FreeTorrent             bool   `json:"freeTorrent"`
			HasCue                  bool   `json:"hasCue"`
			HasLog                  bool   `json:"hasLog"`
			ID                      int    `json:"id"`
			Leechers                int    `json:"leechers"`
			LogScore                int    `json:"logScore"`
			Media                   string `json:"media"`
			RemasterCatalogueNumber string `json:"remasterCatalogueNumber"`
			RemasterRecordLabel     string `json:"remasterRecordLabel"`
			RemasterTitle           string `json:"remasterTitle"`
			RemasterYear            int    `json:"remasterYear"`
			Remastered              bool   `json:"remastered"`
			Reported                bool   `json:"reported"`
			Scene                   bool   `json:"scene"`
			Seeders                 int    `json:"seeders"`
			Size                    int    `json:"size"`
			Snatched                int    `json:"snatched"`
			Time                    string `json:"time"`
			UserID                  int    `json:"userId"`
			Username                string `json:"username"`
		} `json:"torrents"`
	} `json:"response"`
	Status string `json:"status"`
}

type GazelleUserStats added in v0.2.0

type GazelleUserStats struct {
	Response struct {
		Avatar    string `json:"avatar"`
		Community struct {
			ArtistsAdded    int   `json:"artistsAdded"`
			ArtistComments  int   `json:"artistComments"`
			BountyEarned    int   `json:"bountyEarned"`
			BountySpent     int64 `json:"bountySpent"`
			CollageComments int   `json:"collageComments"`
			CollagesContrib int   `json:"collagesContrib"`
			CollagesStarted int   `json:"collagesStarted"`
			Groups          int   `json:"groups"`
			GroupVotes      int   `json:"groupVotes"`
			Invited         int   `json:"invited"`
			Leeching        int   `json:"leeching"`
			PerfectFlacs    int   `json:"perfectFlacs"`
			Posts           int   `json:"posts"`
			RequestComments int   `json:"requestComments"`
			RequestsFilled  int   `json:"requestsFilled"`
			RequestsVoted   int   `json:"requestsVoted"`
			Seeding         int   `json:"seeding"`
			Snatched        int   `json:"snatched"`
			TorrentComments int   `json:"torrentComments"`
			Uploaded        int   `json:"uploaded"`
		} `json:"community"`
		IsFriend bool `json:"isFriend"`
		Personal struct {
			Class        string `json:"class"`
			Donor        bool   `json:"donor"`
			Enabled      bool   `json:"enabled"`
			Paranoia     int    `json:"paranoia"`
			ParanoiaText string `json:"paranoiaText"`
			Passkey      string `json:"passkey"`
			Warned       bool   `json:"warned"`
		} `json:"personal"`
		ProfileText string `json:"profileText"`
		Ranks       struct {
			Artists    int         `json:"artists"`
			Bounty     int         `json:"bounty"`
			Downloaded int         `json:"downloaded"`
			Overall    interface{} `json:"overall"`
			Posts      int         `json:"posts"`
			Requests   int         `json:"requests"`
			Uploaded   int         `json:"uploaded"`
			Uploads    int         `json:"uploads"`
		} `json:"ranks"`
		Stats struct {
			Buffer        int64   `json:"buffer"`
			Downloaded    uint64  `json:"downloaded"`
			JoinedDate    string  `json:"joinedDate"`
			LastAccess    string  `json:"lastAccess"`
			Ratio         string  `json:"ratio"`
			RequiredRatio float64 `json:"requiredRatio"`
			Uploaded      uint64  `json:"uploaded"`
		} `json:"stats"`
		Username string `json:"username"`
	} `json:"response"`
	Status string `json:"status"`
}

type Request added in v0.5.0

type Request struct {
	Response struct {
		BbDescription   string   `json:"bbDescription"`
		BitrateList     []string `json:"bitrateList"`
		CanEdit         bool     `json:"canEdit"`
		CanVote         bool     `json:"canVote"`
		CatalogueNumber string   `json:"catalogueNumber"`
		CategoryID      int      `json:"categoryId"`
		CategoryName    string   `json:"categoryName"`
		CommentPage     int      `json:"commentPage"`
		CommentPages    int      `json:"commentPages"`
		Comments        []struct {
			AddedTime      string `json:"addedTime"`
			AuthorID       int    `json:"authorId"`
			Avatar         string `json:"avatar"`
			Class          string `json:"class"`
			Comment        string `json:"comment"`
			Donor          bool   `json:"donor"`
			EditedTime     string `json:"editedTime"`
			EditedUserID   int    `json:"editedUserId"`
			EditedUsername string `json:"editedUsername"`
			Enabled        bool   `json:"enabled"`
			Name           string `json:"name"`
			PostID         int    `json:"postId"`
			Warned         bool   `json:"warned"`
		} `json:"comments"`
		Description  string   `json:"description"`
		FillerID     int      `json:"fillerId"`
		FillerName   string   `json:"fillerName"`
		FormatList   []string `json:"formatList"`
		Image        string   `json:"image"`
		IsBookmarked bool     `json:"isBookmarked"`
		IsFilled     bool     `json:"isFilled"`
		LastVote     string   `json:"lastVote"`
		LogCue       string   `json:"logCue"`
		MediaList    []string `json:"mediaList"`
		MinimumVote  int      `json:"minimumVote"`
		MusicInfo    struct {
			Artists []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"artists"`
			Composers []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"composers"`
			Conductor []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"conductor"`
			Dj []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"dj"`
			Producer []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"producer"`
			RemixedBy []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"remixedBy"`
			With []struct {
				ID   int    `json:"id"`
				Name string `json:"name"`
			} `json:"with"`
		} `json:"musicInfo"`
		Oclc            string   `json:"oclc"`
		RecordLabel     string   `json:"recordLabel"`
		ReleaseName     string   `json:"releaseName"`
		ReleaseType     int      `json:"releaseType"`
		RequestID       int      `json:"requestId"`
		RequestorID     int      `json:"requestorId"`
		RequestorName   string   `json:"requestorName"`
		Tags            []string `json:"tags"`
		TimeAdded       string   `json:"timeAdded"`
		TimeFilled      string   `json:"timeFilled"`
		Title           string   `json:"title"`
		TopContributors []struct {
			Bounty   int    `json:"bounty"`
			UserID   int    `json:"userId"`
			UserName string `json:"userName"`
		} `json:"topContributors"`
		TorrentID   int `json:"torrentId"`
		TotalBounty int `json:"totalBounty"`
		VoteCount   int `json:"voteCount"`
		Year        int `json:"year"`
	} `json:"response"`
	Status string `json:"status"`
}

type RequestSearch added in v0.5.0

type RequestSearch struct {
	Response struct {
		CurrentPage int                   `json:"currentPage"`
		Pages       int                   `json:"pages"`
		Results     []RequestSearchResult `json:"results"`
	} `json:"response"`
	Status string `json:"status"`
}

type RequestSearchResult added in v0.5.0

type RequestSearchResult struct {
	Artists [][]struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"artists"`
	BitrateList     string `json:"bitrateList"`
	Bounty          int    `json:"bounty"`
	CatalogueNumber string `json:"catalogueNumber"`
	CategoryID      int    `json:"categoryId"`
	CategoryName    string `json:"categoryName"`
	Description     string `json:"description"`
	FillerID        int    `json:"fillerId"`
	FillerName      string `json:"fillerName"`
	FormatList      string `json:"formatList"`
	Image           string `json:"image"`
	IsFilled        bool   `json:"isFilled"`
	LastVote        string `json:"lastVote"`
	LogCue          string `json:"logCue"`
	MediaList       string `json:"mediaList"`
	RecordLabel     string `json:"recordLabel"`
	ReleaseType     string `json:"releaseType"`
	RequestID       int    `json:"requestId"`
	RequestorID     int    `json:"requestorId"`
	RequestorName   string `json:"requestorName"`
	TimeAdded       string `json:"timeAdded"`
	TimeFilled      string `json:"timeFilled"`
	Title           string `json:"title"`
	TorrentID       int    `json:"torrentId"`
	VoteCount       int    `json:"voteCount"`
	Year            int    `json:"year"`
}

func (*RequestSearchResult) IsWebLosslessFLAC added in v0.5.0

func (rsr *RequestSearchResult) IsWebLosslessFLAC() bool
type Search struct {
	Response struct {
		CurrentPage int `json:"currentPage"`
		Pages       int `json:"pages"`
		Results     []struct {
			Artist      string   `json:"artist"`
			Bookmarked  bool     `json:"bookmarked"`
			Cover       string   `json:"cover"`
			GroupID     int      `json:"groupId"`
			GroupName   string   `json:"groupName"`
			GroupTime   string   `json:"groupTime"`
			GroupYear   int      `json:"groupYear"`
			MaxSize     int      `json:"maxSize"`
			ReleaseType string   `json:"releaseType"`
			Tags        []string `json:"tags"`
			Torrents    []struct {
				Artists []struct {
					Aliasid int    `json:"aliasid"`
					ID      int    `json:"id"`
					Name    string `json:"name"`
				} `json:"artists"`
				CanUseToken             bool   `json:"canUseToken"`
				EditionID               int    `json:"editionId"`
				Encoding                string `json:"encoding"`
				FileCount               int    `json:"fileCount"`
				Format                  string `json:"format"`
				HasCue                  bool   `json:"hasCue"`
				HasLog                  bool   `json:"hasLog"`
				HasSnatched             bool   `json:"hasSnatched"`
				IsFreeleech             bool   `json:"isFreeleech"`
				IsNeutralLeech          bool   `json:"isNeutralLeech"`
				IsPersonalFreeleech     bool   `json:"isPersonalFreeleech"`
				Leechers                int    `json:"leechers"`
				LogScore                int    `json:"logScore"`
				Media                   string `json:"media"`
				RemasterCatalogueNumber string `json:"remasterCatalogueNumber"`
				RemasterTitle           string `json:"remasterTitle"`
				RemasterYear            int    `json:"remasterYear"`
				Remastered              bool   `json:"remastered"`
				Scene                   bool   `json:"scene"`
				Seeders                 int    `json:"seeders"`
				Size                    int    `json:"size"`
				Snatches                int    `json:"snatches"`
				Time                    string `json:"time"`
				TorrentID               int    `json:"torrentId"`
				VanityHouse             bool   `json:"vanityHouse"`
			} `json:"torrents"`
			TotalLeechers int  `json:"totalLeechers"`
			TotalSeeders  int  `json:"totalSeeders"`
			TotalSnatched int  `json:"totalSnatched"`
			VanityHouse   bool `json:"vanityHouse"`
		} `json:"results"`
	} `json:"response"`
	Status string `json:"status"`
}

type Tracker

type Tracker struct {
	sync.Mutex
	Name          string
	DomainURL     string
	User          string
	Password      string
	SessionCookie *http.Cookie
	Client        *http.Client

	UserAgent           string // "name/version"
	Passkey             string
	PasskeyRetrievalURL string
	PasseKeyPattern     string
	LoginURL            string
	AuthKey             string
	// contains filtered or unexported fields
}

Tracker to do things with trackers.

func (*Tracker) GetAnnounceURL

func (t *Tracker) GetAnnounceURL() error

func (*Tracker) Init

func (t *Tracker) Init(name, domain, user, password, cookieID, cookieValue, cookieDomain, userAgent, passkeyRetrievalURL, passKeyPattern, loginURL string, rateLimited bool) error

func (*Tracker) RateLimiter

func (t *Tracker) RateLimiter()

Jump to

Keyboard shortcuts

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