Documentation ¶
Overview ¶
TorrentManager for work with difference torrent trackers.
The main module for work with torrent object.
Index ¶
- Constants
- type AuthData
- type Category
- type CommonSettings
- type KPData
- type SearchResult
- func (sr *SearchResult) GetCurrentPage() uint8
- func (sr *SearchResult) GetNextPage(m *TorrentManager) (*SearchResult, error)
- func (sr *SearchResult) GetOtherPages() map[uint8]string
- func (sr *SearchResult) GetPageByNumber(m *TorrentManager, pageNumber uint8) (*SearchResult, error)
- func (sr *SearchResult) GetTorrents() []*Torrent
- func (sr *SearchResult) GetTotalPages() uint8
- type Torrent
- func (t *Torrent) GetCategory() *Category
- func (t *Torrent) GetCleanedTitle() string
- func (t *Torrent) GetCommentsNumber() uint16
- func (t *Torrent) GetDownloadsNumber() uint16
- func (t *Torrent) GetIsDiscussed() bool
- func (t *Torrent) GetIsPopular() bool
- func (t *Torrent) GetKPRating() float64
- func (t *Torrent) GetKPTitle() string
- func (t *Torrent) GetKPURL() string
- func (t *Torrent) GetKPYear() uint16
- func (t *Torrent) GetMagnetLink() string
- func (t *Torrent) GetReleaseDate() time.Time
- func (t *Torrent) GetSize() string
- func (t *Torrent) GetTitle() string
- func (t *Torrent) GetTorrentFileLink() string
- func (t *Torrent) GetURL() string
- func (t *Torrent) GetUploadsNumber() uint16
- func (t *Torrent) GetYear() uint16
- func (t *Torrent) UpdateKPData(client *http.Client, userAgent string) (*KPData, error)
- type TorrentManager
- func (m *TorrentManager) FindOnRutrackerByNameAndCategory(query string, category *Category) (*SearchResult, error)
- func (m *TorrentManager) GetForeignFilms() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetLife() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorAnime() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorBooks() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorCartoons() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorForeignRelease() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorForeignSeries() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorGames() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorHumor() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorMusic() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorOther() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorRussianFilms() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorRussianSeries() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorSciFiFilms() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorSoft() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorSport() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorTV() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutorTop() (map[*Category][]*Torrent, error)
- func (m *TorrentManager) GetRutorTop24() (*Category, []*Torrent, error)
- func (m *TorrentManager) GetRutrackerCategories() (map[uint16]*Category, error)
- func (m *TorrentManager) RefreshCategoriesFromRutracker() (map[uint16]*Category, error)
- func (m *TorrentManager) RefreshRutorTOP() (*http.Response, error)
Constants ¶
const ( Anime = "anime" Books = "books" Cartoons = "cartoons" ForeignFilms = "foreign_films" ForeignReleases = "foreign_releases" ForeignSeries = "foreign_series" Games = "games" Humor = "humor" Life = "life" Music = "music" Other = "other" RussianFilms = "russian_films" RussianSeries = "russian_series" SciFiFilms = "sci_fi_films" Soft = "soft" Sport = "sport_and_health" TOP24 = "top_24" TV = "tv" Video = "video" Forum = "forum" News = "news" Study = "study" Series = "series" Documentary = "documentary" AutoMoto = "auto_moto" Apple = "apple" Mobile = "mobile" Audiobooks = "audiobooks" Block = "block" HiRes = "hi_res" Goods = "goods" )
Category names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct {
// contains filtered or unexported fields
}
Category of a torrent.
func (*Category) GetIsVideo ¶
GetIsVideo returns the isVideo property of the category.
func (*Category) GetSubCategories ¶ added in v0.1.1
GetSubCategories returns the isVideo property of the category.
func (*Category) GetSubCategoriesIDs ¶ added in v0.1.1
GetSubCategoriesIDs returns the isVideo property of the category.
type CommonSettings ¶ added in v0.1.1
OPTIONAL CommonSettings is setting to define Torrent. isDiscussed and Torrent. isPopular. If the value in Torrent more than value in the setting, the value in the torrent will be true.
type KPData ¶
type KPData struct {
// contains filtered or unexported fields
}
KPData is a struct with the KP rating and the link to KP.
type SearchResult ¶ added in v0.1.1
type SearchResult struct {
// contains filtered or unexported fields
}
SearchResult is a store with searched data.
func (*SearchResult) GetCurrentPage ¶ added in v0.1.1
func (sr *SearchResult) GetCurrentPage() uint8
func (*SearchResult) GetNextPage ¶ added in v0.1.1
func (sr *SearchResult) GetNextPage(m *TorrentManager) (*SearchResult, error)
GetNextPage returns next page of search data.
func (*SearchResult) GetOtherPages ¶ added in v0.1.1
func (sr *SearchResult) GetOtherPages() map[uint8]string
GetOtherPages returns other pages with result data.
func (*SearchResult) GetPageByNumber ¶ added in v0.1.1
func (sr *SearchResult) GetPageByNumber(m *TorrentManager, pageNumber uint8) (*SearchResult, error)
GetPageByNumber returns search page data by page number.
func (*SearchResult) GetTorrents ¶ added in v0.1.1
func (sr *SearchResult) GetTorrents() []*Torrent
GetTorrents return list of Torrent -s which were found.
func (*SearchResult) GetTotalPages ¶ added in v0.1.1
func (sr *SearchResult) GetTotalPages() uint8
GetTotalPages returns number of pages with result data.
type Torrent ¶
type Torrent struct {
// contains filtered or unexported fields
}
Torrent is an object with torrent data.
func (*Torrent) GetCategory ¶
GetCategory returns the Category from the Torrent object.
func (*Torrent) GetCleanedTitle ¶
GetCleanedTitle returns the Category from the Torrent object.
func (*Torrent) GetCommentsNumber ¶
GetCommentsNumber returns the comments number.
func (*Torrent) GetDownloadsNumber ¶
GetDownloadsNumber returns the downloads number.
func (*Torrent) GetIsDiscussed ¶
GetIsDiscussed returns true if the Torrent is discussed.
func (*Torrent) GetIsPopular ¶
GetIsPopular returns true if the Torrent is popular.
func (*Torrent) GetKPRating ¶
GetKPRating returns the rating from KP data.
func (*Torrent) GetKPTitle ¶
GetKPTitle returns the title from KP data.
func (*Torrent) GetMagnetLink ¶
GetMagnetLink returns the magnet link.
func (*Torrent) GetReleaseDate ¶
GetMagnetLink returns the release date.
func (*Torrent) GetTorrentFileLink ¶
GetTorrentFileLink returns the link to the torrent file.
func (*Torrent) GetUploadsNumber ¶
GetUploadsNumber returns the currently uploads number.
type TorrentManager ¶ added in v0.1.1
type TorrentManager struct {
// contains filtered or unexported fields
}
TorrentManager is the main struct for work with Torrent.
func New ¶
func New( rutorClient, rutrackerClient *http.Client, fs *CommonSettings, rutrackerAuthData *AuthData, ) (*TorrentManager, error)
Create a new TorrentManager. rutorClient is simple. Just http client with proxy if it the Rutor is blocked in your country. rutrackerClient should be with cookies. Also for rutracker integration requires login and password. See examples/rutracker.go
func (*TorrentManager) FindOnRutrackerByNameAndCategory ¶ added in v0.1.1
func (m *TorrentManager) FindOnRutrackerByNameAndCategory(query string, category *Category) (*SearchResult, error)
FindOnRutrackerByNameAndCategory is implementation of search by Rutracker.org. You can: - find by name in the forum - find name + category list, see examples for more information.
func (*TorrentManager) GetForeignFilms ¶ added in v0.1.1
func (m *TorrentManager) GetForeignFilms() (*Category, []*Torrent, error)
GetForeignFilms returns TOP foreign films.
func (*TorrentManager) GetLife ¶ added in v0.1.1
func (m *TorrentManager) GetLife() (*Category, []*Torrent, error)
GetLife returns TOP life torrents.
func (*TorrentManager) GetRutorAnime ¶ added in v0.1.1
func (m *TorrentManager) GetRutorAnime() (*Category, []*Torrent, error)
GetRutorAnime returns TOP anime.
func (*TorrentManager) GetRutorBooks ¶ added in v0.1.1
func (m *TorrentManager) GetRutorBooks() (*Category, []*Torrent, error)
GetRutorBooks returns TOP books.
func (*TorrentManager) GetRutorCartoons ¶ added in v0.1.1
func (m *TorrentManager) GetRutorCartoons() (*Category, []*Torrent, error)
GetRutorCartoons returns TOP cartoons.
func (*TorrentManager) GetRutorForeignRelease ¶ added in v0.1.1
func (m *TorrentManager) GetRutorForeignRelease() (*Category, []*Torrent, error)
GetRutorForeignRelease returns TOP foreign releases.
func (*TorrentManager) GetRutorForeignSeries ¶ added in v0.1.1
func (m *TorrentManager) GetRutorForeignSeries() (*Category, []*Torrent, error)
GetRutorForeignSeries returns TOP foreign series.
func (*TorrentManager) GetRutorGames ¶ added in v0.1.1
func (m *TorrentManager) GetRutorGames() (*Category, []*Torrent, error)
GetRutorGames returns TOP games.
func (*TorrentManager) GetRutorHumor ¶ added in v0.1.1
func (m *TorrentManager) GetRutorHumor() (*Category, []*Torrent, error)
GetRutorHumor returns TOP humor shows.
func (*TorrentManager) GetRutorMusic ¶ added in v0.1.1
func (m *TorrentManager) GetRutorMusic() (*Category, []*Torrent, error)
GetRutorMusic returns TOP music.
func (*TorrentManager) GetRutorOther ¶ added in v0.1.1
func (m *TorrentManager) GetRutorOther() (*Category, []*Torrent, error)
GetRutorOther returns TOP torrents in other categories.
func (*TorrentManager) GetRutorRussianFilms ¶ added in v0.1.1
func (m *TorrentManager) GetRutorRussianFilms() (*Category, []*Torrent, error)
GetRutorRussianFilms returns TOP russian films.
func (*TorrentManager) GetRutorRussianSeries ¶ added in v0.1.1
func (m *TorrentManager) GetRutorRussianSeries() (*Category, []*Torrent, error)
GetRutorRussianSeries returns TOP russian series.
func (*TorrentManager) GetRutorSciFiFilms ¶ added in v0.1.1
func (m *TorrentManager) GetRutorSciFiFilms() (*Category, []*Torrent, error)
GetRutorSciFiFilms returns TOP sci-fi films.
func (*TorrentManager) GetRutorSoft ¶ added in v0.1.1
func (m *TorrentManager) GetRutorSoft() (*Category, []*Torrent, error)
GetRutorSoft returns TOP soft.
func (*TorrentManager) GetRutorSport ¶ added in v0.1.1
func (m *TorrentManager) GetRutorSport() (*Category, []*Torrent, error)
GetRutorSport returns TOP sport shows.
func (*TorrentManager) GetRutorTV ¶ added in v0.1.1
func (m *TorrentManager) GetRutorTV() (*Category, []*Torrent, error)
GetRutorTV returns TOP TV shows.
func (*TorrentManager) GetRutorTop ¶ added in v0.1.1
func (m *TorrentManager) GetRutorTop() (map[*Category][]*Torrent, error)
GetRutorTop returns ALL torrents in map format where k is a Category and v is a Torrent list.
func (*TorrentManager) GetRutorTop24 ¶ added in v0.1.1
func (m *TorrentManager) GetRutorTop24() (*Category, []*Torrent, error)
GetRutorTop24 returns TOP torrents in the last 24 hours.
func (*TorrentManager) GetRutrackerCategories ¶ added in v0.1.1
func (m *TorrentManager) GetRutrackerCategories() (map[uint16]*Category, error)
Get list of Category -ies from the rutracker.
func (*TorrentManager) RefreshCategoriesFromRutracker ¶ added in v0.1.1
func (m *TorrentManager) RefreshCategoriesFromRutracker() (map[uint16]*Category, error)
RefreshCategoriesFromRutracker updates categories.
func (*TorrentManager) RefreshRutorTOP ¶ added in v0.1.1
func (m *TorrentManager) RefreshRutorTOP() (*http.Response, error)
RefreshRutorTOP torrents for your manager.