Documentation
¶
Index ¶
- Constants
- Variables
- func IsFeed(raw json.RawMessage) bool
- type AppPreferences
- type BuildInfo
- type Category
- type Client
- func (c *Client) AddPeersForTorrents(hashes, peers []string) error
- func (c *Client) AddPeersForTorrentsCtx(ctx context.Context, hashes, peers []string) error
- func (c *Client) AddRSSFeed(url, path string) error
- func (c *Client) AddRSSFeedCtx(ctx context.Context, url, path string) error
- func (c *Client) AddRSSFolder(path string) error
- func (c *Client) AddRSSFolderCtx(ctx context.Context, path string) error
- func (c *Client) AddTags(hashes []string, tags string) error
- func (c *Client) AddTagsCtx(ctx context.Context, hashes []string, tags string) error
- func (c *Client) AddTorrentFromFile(filePath string, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentFromFileCtx(ctx context.Context, filePath string, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentFromMemory(buf []byte, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentFromMemoryCtx(ctx context.Context, buf []byte, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentFromUrl(url string, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentFromUrlCtx(ctx context.Context, url string, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentsFromMemory(files [][]byte, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentsFromMemoryCtx(ctx context.Context, files [][]byte, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTorrentsFromUrlsCtx(ctx context.Context, urls []string, options map[string]string) (*TorrentAddResponse, error)
- func (c *Client) AddTrackers(hash string, urls string) error
- func (c *Client) AddTrackersCtx(ctx context.Context, hash string, urls string) error
- func (c *Client) BanPeers(peers []string) error
- func (c *Client) BanPeersCtx(ctx context.Context, peers []string) error
- func (c *Client) CreateCategory(category string, path string) error
- func (c *Client) CreateCategoryCtx(ctx context.Context, category string, path string) error
- func (c *Client) CreateTags(tags []string) error
- func (c *Client) CreateTagsCtx(ctx context.Context, tags []string) error
- func (c *Client) CreateTorrent(params TorrentCreationParams) (*TorrentCreationTaskResponse, error)
- func (c *Client) CreateTorrentCtx(ctx context.Context, params TorrentCreationParams) (*TorrentCreationTaskResponse, error)
- func (c *Client) DecreasePriority(hashes []string) error
- func (c *Client) DecreasePriorityCtx(ctx context.Context, hashes []string) error
- func (c *Client) DeleteTags(tags []string) error
- func (c *Client) DeleteTagsCtx(ctx context.Context, tags []string) error
- func (c *Client) DeleteTorrentCreationTask(taskID string) error
- func (c *Client) DeleteTorrentCreationTaskCtx(ctx context.Context, taskID string) error
- func (c *Client) DeleteTorrents(hashes []string, deleteFiles bool) error
- func (c *Client) DeleteTorrentsCtx(ctx context.Context, hashes []string, deleteFiles bool) error
- func (c *Client) EditCategory(category string, path string) error
- func (c *Client) EditCategoryCtx(ctx context.Context, category string, path string) error
- func (c *Client) EditTracker(hash string, old, new string) error
- func (c *Client) EditTrackerCtx(ctx context.Context, hash string, old, new string) error
- func (c *Client) ExportTorrent(hash string) ([]byte, error)
- func (c *Client) ExportTorrentCtx(ctx context.Context, hash string) ([]byte, error)
- func (c *Client) GetAlternativeSpeedLimitsMode() (bool, error)
- func (c *Client) GetAlternativeSpeedLimitsModeCtx(ctx context.Context) (bool, error)
- func (c *Client) GetAppCookies() ([]Cookie, error)
- func (c *Client) GetAppCookiesCtx(ctx context.Context) ([]Cookie, error)
- func (c *Client) GetAppPreferences() (AppPreferences, error)
- func (c *Client) GetAppPreferencesCtx(ctx context.Context) (AppPreferences, error)
- func (c *Client) GetAppVersion() (string, error)
- func (c *Client) GetAppVersionCtx(ctx context.Context) (string, error)
- func (c *Client) GetBuildInfo() (BuildInfo, error)
- func (c *Client) GetBuildInfoCtx(ctx context.Context) (BuildInfo, error)
- func (c *Client) GetCategories() (map[string]Category, error)
- func (c *Client) GetCategoriesCtx(ctx context.Context) (map[string]Category, error)
- func (c *Client) GetDefaultSavePath() (string, error)
- func (c *Client) GetDefaultSavePathCtx(ctx context.Context) (string, error)
- func (c *Client) GetDirectoryContent(dirPath string, withMetadata bool) (any, error)
- func (c *Client) GetDirectoryContentCtx(ctx context.Context, dirPath string, withMetadata bool) (any, error)
- func (c *Client) GetFilesInformation(hash string) (*TorrentFiles, error)
- func (c *Client) GetFilesInformationCtx(ctx context.Context, hash string) (*TorrentFiles, error)
- func (c *Client) GetFreeSpaceOnDisk() (int64, error)
- func (c *Client) GetFreeSpaceOnDiskCtx(ctx context.Context) (int64, error)
- func (c *Client) GetGlobalDownloadLimit() (int64, error)
- func (c *Client) GetGlobalDownloadLimitCtx(ctx context.Context) (int64, error)
- func (c *Client) GetGlobalUploadLimit() (int64, error)
- func (c *Client) GetGlobalUploadLimitCtx(ctx context.Context) (int64, error)
- func (c *Client) GetHTTPClient() *http.Client
- func (c *Client) GetLogs() ([]Log, error)
- func (c *Client) GetLogsCtx(ctx context.Context) ([]Log, error)
- func (c *Client) GetMonitoredFolders() (MonitoredFolders, error)
- func (c *Client) GetMonitoredFoldersCtx(ctx context.Context) (MonitoredFolders, error)
- func (c *Client) GetPeerLogs() ([]PeerLog, error)
- func (c *Client) GetPeerLogsCtx(ctx context.Context) ([]PeerLog, error)
- func (c *Client) GetProcessInfo() (ProcessInfo, error)
- func (c *Client) GetProcessInfoCtx(ctx context.Context) (ProcessInfo, error)
- func (c *Client) GetRSSItems(withData bool) (RSSItems, error)
- func (c *Client) GetRSSItemsCtx(ctx context.Context, withData bool) (RSSItems, error)
- func (c *Client) GetRSSMatchingArticles(ruleName string) (RSSMatchingArticles, error)
- func (c *Client) GetRSSMatchingArticlesCtx(ctx context.Context, ruleName string) (RSSMatchingArticles, error)
- func (c *Client) GetRSSRules() (RSSRules, error)
- func (c *Client) GetRSSRulesCtx(ctx context.Context) (RSSRules, error)
- func (c *Client) GetTags() ([]string, error)
- func (c *Client) GetTagsCtx(ctx context.Context) ([]string, error)
- func (c *Client) GetTorrentCreationStatus(taskID string) ([]TorrentCreationTask, error)
- func (c *Client) GetTorrentCreationStatusCtx(ctx context.Context, taskID string) ([]TorrentCreationTask, error)
- func (c *Client) GetTorrentDownloadLimit(hashes []string) (map[string]int64, error)
- func (c *Client) GetTorrentDownloadLimitCtx(ctx context.Context, hashes []string) (map[string]int64, error)
- func (c *Client) GetTorrentFile(taskID string) ([]byte, error)
- func (c *Client) GetTorrentFileCtx(ctx context.Context, taskID string) ([]byte, error)
- func (c *Client) GetTorrentPeers(hash string, rid int64) (*TorrentPeersResponse, error)
- func (c *Client) GetTorrentPeersCtx(ctx context.Context, hash string, rid int64) (*TorrentPeersResponse, error)
- func (c *Client) GetTorrentPieceHashes(hash string) ([]string, error)
- func (c *Client) GetTorrentPieceHashesCtx(ctx context.Context, hash string) ([]string, error)
- func (c *Client) GetTorrentPieceStates(hash string) ([]PieceState, error)
- func (c *Client) GetTorrentPieceStatesCtx(ctx context.Context, hash string) ([]PieceState, error)
- func (c *Client) GetTorrentProperties(hash string) (TorrentProperties, error)
- func (c *Client) GetTorrentPropertiesCtx(ctx context.Context, hash string) (TorrentProperties, error)
- func (c *Client) GetTorrentTrackers(hash string) ([]TorrentTracker, error)
- func (c *Client) GetTorrentTrackersCtx(ctx context.Context, hash string) ([]TorrentTracker, error)
- func (c *Client) GetTorrentUploadLimit(hashes []string) (map[string]int64, error)
- func (c *Client) GetTorrentUploadLimitCtx(ctx context.Context, hashes []string) (map[string]int64, error)
- func (c *Client) GetTorrents(o TorrentFilterOptions) ([]Torrent, error)
- func (c *Client) GetTorrentsActiveDownloads() ([]Torrent, error)
- func (c *Client) GetTorrentsActiveDownloadsCtx(ctx context.Context) ([]Torrent, error)
- func (c *Client) GetTorrentsCtx(ctx context.Context, o TorrentFilterOptions) ([]Torrent, error)
- func (c *Client) GetTorrentsRaw() (string, error)
- func (c *Client) GetTorrentsRawCtx(ctx context.Context) (string, error)
- func (c *Client) GetTorrentsWebSeeds(hash string) ([]WebSeed, error)
- func (c *Client) GetTorrentsWebSeedsCtx(ctx context.Context, hash string) ([]WebSeed, error)
- func (c *Client) GetTransferInfo() (*TransferInfo, error)
- func (c *Client) GetTransferInfoCtx(ctx context.Context) (*TransferInfo, error)
- func (c *Client) GetWebAPIVersion() (string, error)
- func (c *Client) GetWebAPIVersionCtx(ctx context.Context) (string, error)
- func (c *Client) IncreasePriority(hashes []string) error
- func (c *Client) IncreasePriorityCtx(ctx context.Context, hashes []string) error
- func (c *Client) Login() error
- func (c *Client) LoginCtx(ctx context.Context) error
- func (c *Client) MarkRSSItemAsRead(itemPath string, articleID string) error
- func (c *Client) MarkRSSItemAsReadCtx(ctx context.Context, itemPath string, articleID string) error
- func (c *Client) MoveRSSItem(itemPath, destPath string) error
- func (c *Client) MoveRSSItemCtx(ctx context.Context, itemPath, destPath string) error
- func (c *Client) NewPeerSyncManager(hash string, options ...PeerSyncOptions) *PeerSyncManager
- func (c *Client) NewSyncManager(options ...SyncOptions) *SyncManager
- func (c *Client) Pause(hashes []string) error
- func (c *Client) PauseCtx(ctx context.Context, hashes []string) error
- func (c *Client) ReAnnounceTorrents(hashes []string) error
- func (c *Client) ReAnnounceTorrentsCtx(ctx context.Context, hashes []string) error
- func (c *Client) ReannounceTorrentWithRetry(ctx context.Context, hash string, opts *ReannounceOptions) error
- func (c *Client) Recheck(hashes []string) error
- func (c *Client) RecheckCtx(ctx context.Context, hashes []string) error
- func (c *Client) RefreshRSSItem(itemPath string) error
- func (c *Client) RefreshRSSItemCtx(ctx context.Context, itemPath string) error
- func (c *Client) RemoveCategories(categories []string) error
- func (c *Client) RemoveCategoriesCtx(ctx context.Context, categories []string) error
- func (c *Client) RemoveRSSItem(path string) error
- func (c *Client) RemoveRSSItemCtx(ctx context.Context, path string) error
- func (c *Client) RemoveRSSRule(ruleName string) error
- func (c *Client) RemoveRSSRuleCtx(ctx context.Context, ruleName string) error
- func (c *Client) RemoveTags(hashes []string, tags string) error
- func (c *Client) RemoveTagsCtx(ctx context.Context, hashes []string, tags string) error
- func (c *Client) RemoveTrackers(hash string, urls string) error
- func (c *Client) RemoveTrackersCtx(ctx context.Context, hash string, urls string) error
- func (c *Client) RenameFile(hash, oldPath, newPath string) error
- func (c *Client) RenameFileCtx(ctx context.Context, hash, oldPath, newPath string) error
- func (c *Client) RenameFolder(hash, oldPath, newPath string) error
- func (c *Client) RenameFolderCtx(ctx context.Context, hash, oldPath, newPath string) error
- func (c *Client) RenameRSSRule(ruleName, newRuleName string) error
- func (c *Client) RenameRSSRuleCtx(ctx context.Context, ruleName, newRuleName string) error
- func (c *Client) RequiresMinVersion(minVersion *semver.Version) (bool, error)
- func (c *Client) Resume(hashes []string) error
- func (c *Client) ResumeCtx(ctx context.Context, hashes []string) error
- func (c *Client) SetAppCookies(cookies []Cookie) error
- func (c *Client) SetAppCookiesCtx(ctx context.Context, cookies []Cookie) error
- func (c *Client) SetAutoManagement(hashes []string, enable bool) error
- func (c *Client) SetAutoManagementCtx(ctx context.Context, hashes []string, enable bool) error
- func (c *Client) SetCategory(hashes []string, category string) error
- func (c *Client) SetCategoryCtx(ctx context.Context, hashes []string, category string) error
- func (c *Client) SetFilePriority(hash string, IDs string, priority int) error
- func (c *Client) SetFilePriorityCtx(ctx context.Context, hash string, IDs string, priority int) error
- func (c *Client) SetForceStart(hashes []string, value bool) error
- func (c *Client) SetForceStartCtx(ctx context.Context, hashes []string, value bool) error
- func (c *Client) SetGlobalDownloadLimit(limit int64) error
- func (c *Client) SetGlobalDownloadLimitCtx(ctx context.Context, limit int64) error
- func (c *Client) SetGlobalUploadLimit(limit int64) error
- func (c *Client) SetGlobalUploadLimitCtx(ctx context.Context, limit int64) error
- func (c *Client) SetLocation(hashes []string, location string) error
- func (c *Client) SetLocationCtx(ctx context.Context, hashes []string, location string) error
- func (c *Client) SetMaxPriority(hashes []string) error
- func (c *Client) SetMaxPriorityCtx(ctx context.Context, hashes []string) error
- func (c *Client) SetMinPriority(hashes []string) error
- func (c *Client) SetMinPriorityCtx(ctx context.Context, hashes []string) error
- func (c *Client) SetMonitoredFolders(scanDirs MonitoredFolders) error
- func (c *Client) SetMonitoredFoldersCtx(ctx context.Context, scanDirs MonitoredFolders) error
- func (c *Client) SetPreferences(prefs map[string]interface{}) error
- func (c *Client) SetPreferencesCtx(ctx context.Context, prefs map[string]interface{}) error
- func (c *Client) SetPreferencesMaxActiveDownloads(max int) error
- func (c *Client) SetPreferencesMaxActiveTorrents(max int) error
- func (c *Client) SetPreferencesMaxActiveUploads(max int) error
- func (c *Client) SetPreferencesQueueingEnabled(enabled bool) error
- func (c *Client) SetPreferencesSubcategoriesEnabled(enabled bool) error
- func (c *Client) SetRSSAutoDownloadingEnabled(enabled bool) error
- func (c *Client) SetRSSAutoDownloadingEnabledCtx(ctx context.Context, enabled bool) error
- func (c *Client) SetRSSFeedURL(path, url string) error
- func (c *Client) SetRSSFeedURLCtx(ctx context.Context, path, url string) error
- func (c *Client) SetRSSProcessingEnabled(enabled bool) error
- func (c *Client) SetRSSProcessingEnabledCtx(ctx context.Context, enabled bool) error
- func (c *Client) SetRSSRule(ruleName string, rule RSSAutoDownloadRule) error
- func (c *Client) SetRSSRuleCtx(ctx context.Context, ruleName string, rule RSSAutoDownloadRule) error
- func (c *Client) SetTags(ctx context.Context, hashes []string, tags string) error
- func (c *Client) SetTorrentDownloadLimit(hashes []string, limit int64) error
- func (c *Client) SetTorrentDownloadLimitCtx(ctx context.Context, hashes []string, limit int64) error
- func (c *Client) SetTorrentName(hash string, name string) error
- func (c *Client) SetTorrentNameCtx(ctx context.Context, hash string, name string) error
- func (c *Client) SetTorrentShareLimit(hashes []string, opts ShareLimitOptions) error
- func (c *Client) SetTorrentShareLimitCtx(ctx context.Context, hashes []string, opts ShareLimitOptions) error
- func (c *Client) SetTorrentSuperSeeding(hashes []string, on bool) error
- func (c *Client) SetTorrentSuperSeedingCtx(ctx context.Context, hashes []string, on bool) error
- func (c *Client) SetTorrentUploadLimit(hashes []string, limit int64) error
- func (c *Client) SetTorrentUploadLimitCtx(ctx context.Context, hashes []string, limit int64) error
- func (c *Client) Shutdown() error
- func (c *Client) ShutdownCtx(ctx context.Context) error
- func (c *Client) Start(hashes []string) error
- func (c *Client) StartCtx(ctx context.Context, hashes []string) error
- func (c *Client) Stop(hashes []string) error
- func (c *Client) StopCtx(ctx context.Context, hashes []string) error
- func (c *Client) SyncMainDataCtx(ctx context.Context, rid int64) (*MainData, error)
- func (c *Client) SyncMainDataCtxWithRaw(ctx context.Context, rid int64) (*MainData, map[string]interface{}, error)
- func (c *Client) ToggleAlternativeSpeedLimits() error
- func (c *Client) ToggleAlternativeSpeedLimitsCtx(ctx context.Context) error
- func (c *Client) ToggleFirstLastPiecePrio(hashes []string) error
- func (c *Client) ToggleFirstLastPiecePrioCtx(ctx context.Context, hashes []string) error
- func (c *Client) ToggleTorrentSequentialDownload(hashes []string) error
- func (c *Client) ToggleTorrentSequentialDownloadCtx(ctx context.Context, hashes []string) error
- func (c *Client) WithHTTPClient(client *http.Client) *Client
- type Config
- type ConnectionStatus
- type ContentLayout
- type Cookie
- type Log
- type MainData
- type MonitoredFolderMode
- type MonitoredFolderTarget
- type MonitoredFolders
- type PathMetadata
- type PeerLog
- type PeerSyncManager
- type PeerSyncOptions
- type PieceState
- type ProcessInfo
- type RSSArticle
- type RSSAutoDownloadRule
- type RSSFeed
- type RSSItems
- type RSSMatchingArticles
- type RSSRuleTorrentParams
- type RSSRules
- type ReannounceOptions
- type ServerState
- type ShareLimitOptions
- type SyncManager
- func (sm *SyncManager) GetCategories() map[string]Category
- func (sm *SyncManager) GetCategoriesUnchecked() map[string]Category
- func (sm *SyncManager) GetData() *MainData
- func (sm *SyncManager) GetDataUnchecked() *MainData
- func (sm *SyncManager) GetServerState() ServerState
- func (sm *SyncManager) GetServerStateUnchecked() ServerState
- func (sm *SyncManager) GetTags() []string
- func (sm *SyncManager) GetTagsUnchecked() []string
- func (sm *SyncManager) GetTorrent(hash string) (Torrent, bool)
- func (sm *SyncManager) GetTorrentMap(options TorrentFilterOptions) map[string]Torrent
- func (sm *SyncManager) GetTorrentUnchecked(hash string) (Torrent, bool)
- func (sm *SyncManager) GetTorrents(options TorrentFilterOptions) []Torrent
- func (sm *SyncManager) GetTorrentsUnchecked(options TorrentFilterOptions) []Torrent
- func (sm *SyncManager) LastError() error
- func (sm *SyncManager) LastSyncDuration() time.Duration
- func (sm *SyncManager) LastSyncTime() time.Time
- func (sm *SyncManager) Start(ctx context.Context) error
- func (sm *SyncManager) Sync(ctx context.Context) error
- func (sm *SyncManager) Trackers() *TrackerManager
- type SyncOptions
- type Torrent
- type TorrentAddOptions
- type TorrentAddResponse
- type TorrentCreationParams
- type TorrentCreationStatus
- type TorrentCreationTask
- type TorrentCreationTaskResponse
- type TorrentFile
- type TorrentFiles
- type TorrentFilter
- type TorrentFilterOptions
- type TorrentFormat
- type TorrentPeer
- type TorrentPeersResponse
- type TorrentProperties
- type TorrentState
- type TorrentTracker
- type TorrentTrackersResponse
- type TrackerManager
- type TrackerStatus
- type TransferInfo
- type WebSeed
Constants ¶
const ( ConnectionStatusConnected = "connected" ConnectionStatusFirewalled = "firewalled" ConnectionStatusDisconnected = "disconnected" )
const ( PieceStateNotDownloadYet = 0 PieceStateNowDownloading = 1 PieceStateAlreadyDownloaded = 2 )
const ( )
Share limit action names for SetTorrentShareLimit (BitTorrent::ShareLimitAction).
const ( )
Share limits mode names for SetTorrentShareLimit (BitTorrent::ShareLimitsMode).
const ( ReannounceMaxAttempts = 50 ReannounceInterval = 7 // interval in seconds )
Variables ¶
var ( ErrBadCredentials = errors.New("bad credentials") ErrIPBanned = errors.New("User's IP is banned for too many failed login attempts") ErrUnexpectedStatus = errors.New("unexpected status code") ErrUnexpectedContentType = errors.New("unexpected Content-Type") ErrNoTorrentURLProvided = errors.New("no torrent URL provided") ErrEmptyInput = errors.New("input is empty") ErrEmptySavePath = errors.New("save path is empty") ErrNoWriteAccessToPath = errors.New("user does not have write access to directory") ErrCannotCreateSavePath = errors.New("unable to create save path directory") ErrEmptyCategoryName = errors.New("category name is empty") ErrInvalidCategoryName = errors.New("category name is invalid") ErrCategoryEditingFailed = errors.New("category editing failed") ErrCategoryDoesNotExist = errors.New("category name does not exist") ErrInvalidPriority = errors.New("priority is invalid or at least one id is not an integer") ErrTorrentNotFound = errors.New("torrent not found") ErrTorrentMetadataNotDownloadedYet = errors.New("torrent metadata hasn't downloaded yet or at least one file id was not found") ErrMissingNewPathParameter = errors.New("missing newPath parameter") ErrInvalidPathParameter = errors.New("invalid newPath or oldPath, or newPath already in use") ErrInvalidTorrentHash = errors.New("torrent hash is invalid") ErrEmptyTorrentName = errors.New("torrent name is empty") ErrAllURLsNotFound = errors.New("all urls were not found") ErrInvalidURL = errors.New("new url is not a valid URL") ErrTorrentQueueingNotEnabled = errors.New("torrent queueing is not enabled, could not change priority") ErrInvalidCookies = errors.New("request was not a valid json array of cookie objects") ErrCannotGetTorrentPieceStates = errors.New("could not get torrent piece states") ErrInvalidPeers = errors.New("none of the supplied peers are valid") ErrInvalidMonitoredFolderTarget = errors.New("invalid monitored folder target") ErrReannounceTookTooLong = errors.New("reannounce took too long, deleted torrent") ErrUnsupportedVersion = errors.New("qBittorrent version too old, please upgrade to use this feature") ErrTorrentCreationTooManyActiveTasks = errors.New("too many active torrent creation tasks") ErrTorrentCreationTaskNotFound = errors.New("torrent creation task not found") ErrTorrentCreationUnfinished = errors.New("torrent creation is still unfinished") ErrTorrentCreationFailed = errors.New("torrent creation failed") ErrTorrentAddFailed = errors.New("torrent(s) failed to be added") ErrRSSItemNotFound = errors.New("RSS item not found") ErrRSSPathConflict = errors.New("RSS path already exists or is invalid") ErrRSSRuleNotFound = errors.New("RSS rule not found") )
var (
DefaultTimeout = 60 * time.Second
)
Functions ¶
func IsFeed ¶ added in v1.15.0
func IsFeed(raw json.RawMessage) bool
IsFeed checks if the raw JSON represents a feed (has URL field).
Types ¶
type AppPreferences ¶ added in v1.7.2
type AppPreferences struct {
AddTrackers string `json:"add_trackers"`
AddTrackersEnabled bool `json:"add_trackers_enabled"`
AltDlLimit int `json:"alt_dl_limit"`
AltUpLimit int `json:"alt_up_limit"`
AlternativeWebuiEnabled bool `json:"alternative_webui_enabled"`
AlternativeWebuiPath string `json:"alternative_webui_path"`
AnnounceIP string `json:"announce_ip"`
AnnounceToAllTiers bool `json:"announce_to_all_tiers"`
AnnounceToAllTrackers bool `json:"announce_to_all_trackers"`
AnonymousMode bool `json:"anonymous_mode"`
AsyncIoThreads int `json:"async_io_threads"`
AutoDeleteMode int `json:"auto_delete_mode"`
AutoTmmEnabled bool `json:"auto_tmm_enabled"`
AutorunEnabled bool `json:"autorun_enabled"`
AutorunOnTorrentAddedEnabled bool `json:"autorun_on_torrent_added_enabled"`
AutorunOnTorrentAddedProgram string `json:"autorun_on_torrent_added_program"`
AutorunProgram string `json:"autorun_program"`
BannedIPs string `json:"banned_IPs"`
BittorrentProtocol int `json:"bittorrent_protocol"`
BlockPeersOnPrivilegedPorts bool `json:"block_peers_on_privileged_ports"`
BypassAuthSubnetWhitelist string `json:"bypass_auth_subnet_whitelist"`
BypassAuthSubnetWhitelistEnabled bool `json:"bypass_auth_subnet_whitelist_enabled"`
BypassLocalAuth bool `json:"bypass_local_auth"`
CategoryChangedTmmEnabled bool `json:"category_changed_tmm_enabled"`
CheckingMemoryUse int `json:"checking_memory_use"`
ConnectionSpeed int `json:"connection_speed"`
CurrentInterfaceAddress string `json:"current_interface_address"`
CurrentNetworkInterface string `json:"current_network_interface"`
Dht bool `json:"dht"`
DiskCache int `json:"disk_cache"`
DiskCacheTTL int `json:"disk_cache_ttl"`
DiskIoReadMode int `json:"disk_io_read_mode"`
DiskIoType int `json:"disk_io_type"`
DiskIoWriteMode int `json:"disk_io_write_mode"`
DiskQueueSize int `json:"disk_queue_size"`
DlLimit int `json:"dl_limit"`
DontCountSlowTorrents bool `json:"dont_count_slow_torrents"`
DyndnsDomain string `json:"dyndns_domain"`
DyndnsEnabled bool `json:"dyndns_enabled"`
DyndnsPassword string `json:"dyndns_password"`
DyndnsService int `json:"dyndns_service"`
DyndnsUsername string `json:"dyndns_username"`
EmbeddedTrackerPort int `json:"embedded_tracker_port"`
EmbeddedTrackerPortForwarding bool `json:"embedded_tracker_port_forwarding"`
EnableCoalesceReadWrite bool `json:"enable_coalesce_read_write"`
EnableEmbeddedTracker bool `json:"enable_embedded_tracker"`
EnableMultiConnectionsFromSameIP bool `json:"enable_multi_connections_from_same_ip"`
EnablePieceExtentAffinity bool `json:"enable_piece_extent_affinity"`
EnableUploadSuggestions bool `json:"enable_upload_suggestions"`
Encryption int `json:"encryption"`
ExcludedFileNames string `json:"excluded_file_names"`
ExcludedFileNamesEnabled bool `json:"excluded_file_names_enabled"`
ExportDir string `json:"export_dir"`
ExportDirFin string `json:"export_dir_fin"`
FilePoolSize int `json:"file_pool_size"`
HashingThreads int `json:"hashing_threads"`
IdnSupportEnabled bool `json:"idn_support_enabled"`
IncompleteFilesExt bool `json:"incomplete_files_ext"`
IPFilterEnabled bool `json:"ip_filter_enabled"`
IPFilterPath string `json:"ip_filter_path"`
IPFilterTrackers bool `json:"ip_filter_trackers"`
LimitLanPeers bool `json:"limit_lan_peers"`
LimitTCPOverhead bool `json:"limit_tcp_overhead"`
LimitUtpRate bool `json:"limit_utp_rate"`
ListenPort int `json:"listen_port"`
Locale string `json:"locale"`
Lsd bool `json:"lsd"`
MailNotificationAuthEnabled bool `json:"mail_notification_auth_enabled"`
MailNotificationEmail string `json:"mail_notification_email"`
MailNotificationEnabled bool `json:"mail_notification_enabled"`
MailNotificationPassword string `json:"mail_notification_password"`
MailNotificationSender string `json:"mail_notification_sender"`
MailNotificationSMTP string `json:"mail_notification_smtp"`
MailNotificationSslEnabled bool `json:"mail_notification_ssl_enabled"`
MailNotificationUsername string `json:"mail_notification_username"`
MaxActiveCheckingTorrents int `json:"max_active_checking_torrents"`
MaxActiveDownloads int `json:"max_active_downloads"`
MaxActiveTorrents int `json:"max_active_torrents"`
MaxActiveUploads int `json:"max_active_uploads"`
MaxConcurrentHTTPAnnounces int `json:"max_concurrent_http_announces"`
MaxConnec int `json:"max_connec"`
MaxConnecPerTorrent int `json:"max_connec_per_torrent"`
MaxRatio float64 `json:"max_ratio"`
MaxRatioAct int `json:"max_ratio_act"`
MaxRatioEnabled bool `json:"max_ratio_enabled"`
MaxSeedingTime int `json:"max_seeding_time"`
MaxSeedingTimeEnabled bool `json:"max_seeding_time_enabled"`
MaxUploads int `json:"max_uploads"`
MaxUploadsPerTorrent int `json:"max_uploads_per_torrent"`
MemoryWorkingSetLimit int `json:"memory_working_set_limit"`
OutgoingPortsMax int `json:"outgoing_ports_max"`
OutgoingPortsMin int `json:"outgoing_ports_min"`
PeerTos int `json:"peer_tos"`
PeerTurnover int `json:"peer_turnover"`
PeerTurnoverCutoff int `json:"peer_turnover_cutoff"`
PeerTurnoverInterval int `json:"peer_turnover_interval"`
PerformanceWarning bool `json:"performance_warning"`
Pex bool `json:"pex"`
PreallocateAll bool `json:"preallocate_all"`
ProxyAuthEnabled bool `json:"proxy_auth_enabled"`
ProxyHostnameLookup bool `json:"proxy_hostname_lookup"`
ProxyIP string `json:"proxy_ip"`
ProxyPassword string `json:"proxy_password"`
ProxyPeerConnections bool `json:"proxy_peer_connections"`
ProxyPort int `json:"proxy_port"`
ProxyTorrentsOnly bool `json:"proxy_torrents_only"`
ProxyType interface{} `json:"proxy_type"` // pre 4.5.x this is an int and post 4.6.x it's a string
ProxyUsername string `json:"proxy_username"`
QueueingEnabled bool `json:"queueing_enabled"`
RandomPort bool `json:"random_port"`
ReannounceWhenAddressChanged bool `json:"reannounce_when_address_changed"`
RecheckCompletedTorrents bool `json:"recheck_completed_torrents"`
RefreshInterval int `json:"refresh_interval"`
RequestQueueSize int `json:"request_queue_size"`
ResolvePeerCountries bool `json:"resolve_peer_countries"`
ResumeDataStorageType string `json:"resume_data_storage_type"`
RssAutoDownloadingEnabled bool `json:"rss_auto_downloading_enabled"`
RssDownloadRepackProperEpisodes bool `json:"rss_download_repack_proper_episodes"`
RssMaxArticlesPerFeed int `json:"rss_max_articles_per_feed"`
RssProcessingEnabled bool `json:"rss_processing_enabled"`
RssRefreshInterval int `json:"rss_refresh_interval"`
RssSmartEpisodeFilters string `json:"rss_smart_episode_filters"`
SavePath string `json:"save_path"`
SavePathChangedTmmEnabled bool `json:"save_path_changed_tmm_enabled"`
SaveResumeDataInterval int `json:"save_resume_data_interval"`
ScanDirs MonitoredFolders `json:"scan_dirs"`
ScheduleFromHour int `json:"schedule_from_hour"`
ScheduleFromMin int `json:"schedule_from_min"`
ScheduleToHour int `json:"schedule_to_hour"`
ScheduleToMin int `json:"schedule_to_min"`
SchedulerDays int `json:"scheduler_days"`
SchedulerEnabled bool `json:"scheduler_enabled"`
SendBufferLowWatermark int `json:"send_buffer_low_watermark"`
SendBufferWatermark int `json:"send_buffer_watermark"`
SendBufferWatermarkFactor int `json:"send_buffer_watermark_factor"`
SlowTorrentDlRateThreshold int `json:"slow_torrent_dl_rate_threshold"`
SlowTorrentInactiveTimer int `json:"slow_torrent_inactive_timer"`
SlowTorrentUlRateThreshold int `json:"slow_torrent_ul_rate_threshold"`
SocketBacklogSize int `json:"socket_backlog_size"`
SsrfMitigation bool `json:"ssrf_mitigation"`
StartPausedEnabled bool `json:"start_paused_enabled"`
StopTrackerTimeout int `json:"stop_tracker_timeout"`
TempPath string `json:"temp_path"`
TempPathEnabled bool `json:"temp_path_enabled"`
TorrentChangedTmmEnabled bool `json:"torrent_changed_tmm_enabled"`
TorrentContentLayout string `json:"torrent_content_layout"`
TorrentStopCondition string `json:"torrent_stop_condition"`
UpLimit int `json:"up_limit"`
UploadChokingAlgorithm int `json:"upload_choking_algorithm"`
UploadSlotsBehavior int `json:"upload_slots_behavior"`
Upnp bool `json:"upnp"`
UpnpLeaseDuration int `json:"upnp_lease_duration"`
UseCategoryPathsInManualMode bool `json:"use_category_paths_in_manual_mode"`
UseHTTPS bool `json:"use_https"`
UseSubcategories bool `json:"use_subcategories"`
UtpTCPMixedMode int `json:"utp_tcp_mixed_mode"`
ValidateHTTPSTrackerCertificate bool `json:"validate_https_tracker_certificate"`
WebUIAddress string `json:"web_ui_address"`
WebUIBanDuration int `json:"web_ui_ban_duration"`
WebUIClickjackingProtectionEnabled bool `json:"web_ui_clickjacking_protection_enabled"`
WebUICsrfProtectionEnabled bool `json:"web_ui_csrf_protection_enabled"`
WebUICustomHTTPHeaders string `json:"web_ui_custom_http_headers"`
WebUIDomainList string `json:"web_ui_domain_list"`
WebUIHostHeaderValidationEnabled bool `json:"web_ui_host_header_validation_enabled"`
WebUIHTTPSCertPath string `json:"web_ui_https_cert_path"`
WebUIHTTPSKeyPath string `json:"web_ui_https_key_path"`
WebUIMaxAuthFailCount int `json:"web_ui_max_auth_fail_count"`
WebUIPort int `json:"web_ui_port"`
WebUIReverseProxiesList string `json:"web_ui_reverse_proxies_list"`
WebUIReverseProxyEnabled bool `json:"web_ui_reverse_proxy_enabled"`
WebUISecureCookieEnabled bool `json:"web_ui_secure_cookie_enabled"`
WebUISessionTimeout int `json:"web_ui_session_timeout"`
WebUIUpnp bool `json:"web_ui_upnp"`
WebUIUseCustomHTTPHeadersEnabled bool `json:"web_ui_use_custom_http_headers_enabled"`
WebUIUsername string `json:"web_ui_username"`
}
type BuildInfo ¶ added in v1.14.0
type BuildInfo struct {
Qt string `json:"qt"` // QT version
Libtorrent string `json:"libtorrent"` // libtorrent version
Boost string `json:"boost"` // Boost version
Openssl string `json:"openssl"` // OpenSSL version
Zlib string `json:"zlib"` // zlib version
Bitness int `json:"bitness"` // Application bitness (e.g.64-bit)
Platform string `json:"platform"` // Platform (linux, macos, windows, unknown)
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddPeersForTorrents ¶ added in v1.14.0
AddPeersForTorrents adds peers to torrents. hashes is a list of torrent hashes. peers is a list of peers. Each of peers list is a string in the form of `<ip>:<port>`.
func (*Client) AddPeersForTorrentsCtx ¶ added in v1.14.0
AddPeersForTorrentsCtx adds peers to torrents. hashes is a list of torrent hashes. peers is a list of peers. Each of peers list is a string in the form of `<ip>:<port>`.
func (*Client) AddRSSFeed ¶ added in v1.15.0
AddRSSFeed adds a new RSS feed.
func (*Client) AddRSSFeedCtx ¶ added in v1.15.0
AddRSSFeedCtx adds a new RSS feed with context.
func (*Client) AddRSSFolder ¶ added in v1.15.0
AddRSSFolder creates a new RSS folder. Path uses backslash as separator (e.g., "Folder\\Subfolder").
func (*Client) AddRSSFolderCtx ¶ added in v1.15.0
AddRSSFolderCtx creates a new RSS folder with context.
func (*Client) AddTagsCtx ¶ added in v1.3.3
func (*Client) AddTorrentFromFile ¶
func (c *Client) AddTorrentFromFile(filePath string, options map[string]string) (*TorrentAddResponse, error)
AddTorrentFromFile add new torrent from torrent file
func (*Client) AddTorrentFromFileCtx ¶
func (*Client) AddTorrentFromMemory ¶ added in v1.7.2
func (*Client) AddTorrentFromMemoryCtx ¶ added in v1.7.2
func (*Client) AddTorrentFromUrl ¶
func (c *Client) AddTorrentFromUrl(url string, options map[string]string) (*TorrentAddResponse, error)
AddTorrentFromUrl add new torrent from torrent file
func (*Client) AddTorrentFromUrlCtx ¶
func (*Client) AddTorrentsFromMemory ¶ added in v1.15.0
func (c *Client) AddTorrentsFromMemory(files [][]byte, options map[string]string) (*TorrentAddResponse, error)
AddTorrentsFromMemory adds multiple torrents from memory in a single request. This is more efficient than calling AddTorrentFromMemory multiple times.
func (*Client) AddTorrentsFromMemoryCtx ¶ added in v1.15.0
func (c *Client) AddTorrentsFromMemoryCtx(ctx context.Context, files [][]byte, options map[string]string) (*TorrentAddResponse, error)
AddTorrentsFromMemoryCtx adds multiple torrents from memory in a single request. qBittorrent's API accepts multiple "torrents" form fields, allowing batch uploads.
func (*Client) AddTorrentsFromUrlsCtx ¶ added in v1.16.0
func (c *Client) AddTorrentsFromUrlsCtx(ctx context.Context, urls []string, options map[string]string) (*TorrentAddResponse, error)
AddTorrentsFromUrlsCtx add multiple new torrents from urls
func (*Client) AddTrackers ¶ added in v1.12.0
AddTrackers add trackers of torrent
func (*Client) AddTrackersCtx ¶ added in v1.12.0
AddTrackersCtx add trackers of torrent
func (*Client) BanPeers ¶ added in v1.14.0
BanPeers bans peers. Each peer is a colon-separated host:port pair
func (*Client) BanPeersCtx ¶ added in v1.14.0
BanPeersCtx bans peers. Each peer is a colon-separated host:port pair
func (*Client) CreateCategoryCtx ¶
func (*Client) CreateTags ¶ added in v1.4.0
func (*Client) CreateTagsCtx ¶ added in v1.4.0
func (*Client) CreateTorrent ¶ added in v1.15.0
func (c *Client) CreateTorrent(params TorrentCreationParams) (*TorrentCreationTaskResponse, error)
CreateTorrent creates a new torrent creation task
func (*Client) CreateTorrentCtx ¶ added in v1.15.0
func (c *Client) CreateTorrentCtx(ctx context.Context, params TorrentCreationParams) (*TorrentCreationTaskResponse, error)
CreateTorrentCtx creates a new torrent creation task with context Requires qBittorrent v5.0.0+ (WebAPI v2.11.2+)
func (*Client) DecreasePriority ¶ added in v1.7.0
DecreasePriority decrease priority for torrents specified by hashes
func (*Client) DecreasePriorityCtx ¶ added in v1.7.0
DecreasePriorityCtx decrease priority for torrents specified by hashes
func (*Client) DeleteTags ¶ added in v1.4.0
DeleteTags delete tags from qBittorrent
func (*Client) DeleteTagsCtx ¶ added in v1.4.0
DeleteTagsCtx delete tags from qBittorrent
func (*Client) DeleteTorrentCreationTask ¶ added in v1.15.0
DeleteTorrentCreationTask deletes a torrent creation task
func (*Client) DeleteTorrentCreationTaskCtx ¶ added in v1.15.0
DeleteTorrentCreationTaskCtx deletes a torrent creation task with context Requires qBittorrent v5.0.0+ (WebAPI v2.11.2+)
func (*Client) DeleteTorrents ¶
func (*Client) DeleteTorrentsCtx ¶
func (*Client) EditCategoryCtx ¶
func (*Client) EditTracker ¶ added in v1.5.0
EditTracker edit tracker of torrent
func (*Client) EditTrackerCtx ¶ added in v1.5.0
EditTrackerCtx edit tracker of torrent
func (*Client) ExportTorrent ¶ added in v1.3.0
func (*Client) ExportTorrentCtx ¶ added in v1.3.0
func (*Client) GetAlternativeSpeedLimitsMode ¶ added in v1.14.0
GetAlternativeSpeedLimitsMode get alternative speed limits mode
func (*Client) GetAlternativeSpeedLimitsModeCtx ¶ added in v1.14.0
GetAlternativeSpeedLimitsModeCtx get alternative speed limits mode
func (*Client) GetAppCookies ¶ added in v1.14.0
GetAppCookies get app cookies. Cookies are used for downloading torrents.
func (*Client) GetAppCookiesCtx ¶ added in v1.14.0
GetAppCookiesCtx get app cookies. Cookies are used for downloading torrents.
func (*Client) GetAppPreferences ¶ added in v1.7.2
func (c *Client) GetAppPreferences() (AppPreferences, error)
func (*Client) GetAppPreferencesCtx ¶ added in v1.7.2
func (c *Client) GetAppPreferencesCtx(ctx context.Context) (AppPreferences, error)
func (*Client) GetAppVersion ¶ added in v1.4.0
func (*Client) GetAppVersionCtx ¶ added in v1.4.0
func (*Client) GetBuildInfo ¶ added in v1.14.0
GetBuildInfo get qBittorrent build information.
func (*Client) GetBuildInfoCtx ¶ added in v1.14.0
GetBuildInfoCtx get qBittorrent build information.
func (*Client) GetCategoriesCtx ¶
func (*Client) GetDefaultSavePath ¶ added in v1.14.0
GetDefaultSavePath get default save path. e.g. C:/Users/Dayman/Downloads
func (*Client) GetDefaultSavePathCtx ¶ added in v1.14.0
GetDefaultSavePathCtx get default save path. e.g. C:/Users/Dayman/Downloads
func (*Client) GetDirectoryContent ¶ added in v1.15.0
GetDirectoryContent lists folders inside a directory (for autocomplete).
func (*Client) GetDirectoryContentCtx ¶ added in v1.15.0
func (c *Client) GetDirectoryContentCtx(ctx context.Context, dirPath string, withMetadata bool) (any, error)
GetDirectoryContentCtx lists folders inside a directory (for autocomplete). Requires qBittorrent 5.0 and WebAPI >= 2.11.2. Note: withMetadata parameter is not yet released in qBittorrent (as of Dec 2025), expected in the next version. When false, returns []string; when true, returns []PathMetadata.
func (*Client) GetFilesInformation ¶
func (c *Client) GetFilesInformation(hash string) (*TorrentFiles, error)
func (*Client) GetFilesInformationCtx ¶
func (*Client) GetFreeSpaceOnDisk ¶ added in v1.11.0
func (*Client) GetFreeSpaceOnDiskCtx ¶ added in v1.11.0
GetFreeSpaceOnDiskCtx get free space on disk for default download dir. Expensive call
func (*Client) GetGlobalDownloadLimit ¶ added in v1.14.0
GetGlobalDownloadLimit get global upload limit
func (*Client) GetGlobalDownloadLimitCtx ¶ added in v1.14.0
GetGlobalDownloadLimitCtx get global upload limit
func (*Client) GetGlobalUploadLimit ¶ added in v1.14.0
GetGlobalUploadLimit get global upload limit
func (*Client) GetGlobalUploadLimitCtx ¶ added in v1.14.0
GetGlobalUploadLimitCtx get global upload limit
func (*Client) GetHTTPClient ¶ added in v1.15.0
GetHTTPClient allows you to a receive the implemented http.Client.
func (*Client) GetLogsCtx ¶ added in v1.14.0
GetLogsCtx get main client logs
func (*Client) GetMonitoredFolders ¶ added in v1.16.0
func (c *Client) GetMonitoredFolders() (MonitoredFolders, error)
GetMonitoredFolders returns configured folders watched for torrent files.
func (*Client) GetMonitoredFoldersCtx ¶ added in v1.16.0
func (c *Client) GetMonitoredFoldersCtx(ctx context.Context) (MonitoredFolders, error)
GetMonitoredFoldersCtx returns configured folders watched for torrent files.
func (*Client) GetPeerLogs ¶ added in v1.14.0
GetPeerLogs get peer logs
func (*Client) GetPeerLogsCtx ¶ added in v1.14.0
GetPeerLogsCtx get peer logs
func (*Client) GetProcessInfo ¶ added in v1.16.0
func (c *Client) GetProcessInfo() (ProcessInfo, error)
GetProcessInfo get qBittorrent process information.
func (*Client) GetProcessInfoCtx ¶ added in v1.16.0
func (c *Client) GetProcessInfoCtx(ctx context.Context) (ProcessInfo, error)
GetProcessInfoCtx get qBittorrent process information.
func (*Client) GetRSSItems ¶ added in v1.15.0
GetRSSItems retrieves all RSS feeds and folders. If withData is true, includes article data for each feed.
func (*Client) GetRSSItemsCtx ¶ added in v1.15.0
GetRSSItemsCtx retrieves all RSS feeds and folders with context.
func (*Client) GetRSSMatchingArticles ¶ added in v1.15.0
func (c *Client) GetRSSMatchingArticles(ruleName string) (RSSMatchingArticles, error)
GetRSSMatchingArticles gets articles matching a rule for preview.
func (*Client) GetRSSMatchingArticlesCtx ¶ added in v1.15.0
func (c *Client) GetRSSMatchingArticlesCtx(ctx context.Context, ruleName string) (RSSMatchingArticles, error)
GetRSSMatchingArticlesCtx gets articles matching a rule for preview with context. Note: qBittorrent returns an empty object for non-existent rules.
func (*Client) GetRSSRules ¶ added in v1.15.0
GetRSSRules retrieves all RSS auto-download rules.
func (*Client) GetRSSRulesCtx ¶ added in v1.15.0
GetRSSRulesCtx retrieves all RSS auto-download rules with context.
func (*Client) GetTagsCtx ¶ added in v1.4.0
func (*Client) GetTorrentCreationStatus ¶ added in v1.15.0
func (c *Client) GetTorrentCreationStatus(taskID string) ([]TorrentCreationTask, error)
GetTorrentCreationStatus retrieves the status of torrent creation tasks If taskID is empty, returns all tasks
func (*Client) GetTorrentCreationStatusCtx ¶ added in v1.15.0
func (c *Client) GetTorrentCreationStatusCtx(ctx context.Context, taskID string) ([]TorrentCreationTask, error)
GetTorrentCreationStatusCtx retrieves the status of torrent creation tasks with context If taskID is empty, returns all tasks Requires qBittorrent v5.0.0+ (WebAPI v2.11.2+)
func (*Client) GetTorrentDownloadLimit ¶ added in v1.14.0
GetTorrentDownloadLimit get download limit for torrents specified by hashes.
example response:
{
"8c212779b4abde7c6bc608063a0d008b7e40ce32":338944,
"284b83c9c7935002391129fd97f43db5d7cc2ba0":123
}
8c212779b4abde7c6bc608063a0d008b7e40ce32 is the hash of the torrent and 338944 its download speed limit in bytes per second; this value will be zero if no limit is applied.
func (*Client) GetTorrentDownloadLimitCtx ¶ added in v1.14.0
func (c *Client) GetTorrentDownloadLimitCtx(ctx context.Context, hashes []string) (map[string]int64, error)
GetTorrentDownloadLimitCtx get download limit for torrents specified by hashes.
example response:
{
"8c212779b4abde7c6bc608063a0d008b7e40ce32":338944,
"284b83c9c7935002391129fd97f43db5d7cc2ba0":123
}
8c212779b4abde7c6bc608063a0d008b7e40ce32 is the hash of the torrent and 338944 its download speed limit in bytes per second; this value will be zero if no limit is applied.
func (*Client) GetTorrentFile ¶ added in v1.15.0
GetTorrentFile downloads the torrent file for a completed torrent creation task
func (*Client) GetTorrentFileCtx ¶ added in v1.15.0
GetTorrentFileCtx downloads the torrent file for a completed torrent creation task with context Requires qBittorrent v5.0.0+ (WebAPI v2.11.2+)
func (*Client) GetTorrentPeers ¶ added in v1.15.0
func (c *Client) GetTorrentPeers(hash string, rid int64) (*TorrentPeersResponse, error)
GetTorrentPeers retrieves the list of peers for a torrent
func (*Client) GetTorrentPeersCtx ¶ added in v1.15.0
func (c *Client) GetTorrentPeersCtx(ctx context.Context, hash string, rid int64) (*TorrentPeersResponse, error)
GetTorrentPeersCtx retrieves the list of peers for a torrent with context
func (*Client) GetTorrentPieceHashes ¶ added in v1.14.0
GetTorrentPieceHashes returns an array of hashes (in order) of all pieces (in order) of a specific torrent.
func (*Client) GetTorrentPieceHashesCtx ¶ added in v1.14.0
GetTorrentPieceHashesCtx returns an array of hashes (in order) of all pieces (in order) of a specific torrent.
func (*Client) GetTorrentPieceStates ¶ added in v1.14.0
func (c *Client) GetTorrentPieceStates(hash string) ([]PieceState, error)
GetTorrentPieceStates returns an array of states (integers) of all pieces (in order) of a specific torrent.
func (*Client) GetTorrentPieceStatesCtx ¶ added in v1.14.0
GetTorrentPieceStatesCtx returns an array of states (integers) of all pieces (in order) of a specific torrent.
func (*Client) GetTorrentProperties ¶ added in v1.7.2
func (c *Client) GetTorrentProperties(hash string) (TorrentProperties, error)
func (*Client) GetTorrentPropertiesCtx ¶ added in v1.7.2
func (*Client) GetTorrentTrackers ¶
func (c *Client) GetTorrentTrackers(hash string) ([]TorrentTracker, error)
func (*Client) GetTorrentTrackersCtx ¶
func (*Client) GetTorrentUploadLimit ¶ added in v1.14.0
GetTorrentUploadLimit get upload speed limit for torrents specified by hashes.
example response:
{
"8c212779b4abde7c6bc608063a0d008b7e40ce32":338944,
"284b83c9c7935002391129fd97f43db5d7cc2ba0":123
}
8c212779b4abde7c6bc608063a0d008b7e40ce32 is the hash of the torrent and 338944 its upload speed limit in bytes per second; this value will be zero if no limit is applied.
func (*Client) GetTorrentUploadLimitCtx ¶ added in v1.14.0
func (c *Client) GetTorrentUploadLimitCtx(ctx context.Context, hashes []string) (map[string]int64, error)
GetTorrentUploadLimitCtx get upload speed limit for torrents specified by hashes.
example response:
{
"8c212779b4abde7c6bc608063a0d008b7e40ce32":338944,
"284b83c9c7935002391129fd97f43db5d7cc2ba0":123
}
8c212779b4abde7c6bc608063a0d008b7e40ce32 is the hash of the torrent and 338944 its upload speed limit in bytes per second; this value will be zero if no limit is applied.
func (*Client) GetTorrents ¶
func (c *Client) GetTorrents(o TorrentFilterOptions) ([]Torrent, error)
func (*Client) GetTorrentsActiveDownloads ¶
func (*Client) GetTorrentsActiveDownloadsCtx ¶
func (*Client) GetTorrentsCtx ¶
func (*Client) GetTorrentsRaw ¶
func (*Client) GetTorrentsRawCtx ¶
func (*Client) GetTorrentsWebSeeds ¶ added in v1.14.0
func (*Client) GetTorrentsWebSeedsCtx ¶ added in v1.14.0
func (*Client) GetTransferInfo ¶
func (c *Client) GetTransferInfo() (*TransferInfo, error)
func (*Client) GetTransferInfoCtx ¶
func (c *Client) GetTransferInfoCtx(ctx context.Context) (*TransferInfo, error)
func (*Client) GetWebAPIVersion ¶ added in v1.4.0
func (*Client) GetWebAPIVersionCtx ¶ added in v1.4.0
func (*Client) IncreasePriority ¶ added in v1.7.0
IncreasePriority increase priority for torrents specified by hashes
func (*Client) IncreasePriorityCtx ¶ added in v1.7.0
IncreasePriorityCtx increase priority for torrents specified by hashes
func (*Client) Login ¶
Login https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#authentication
func (*Client) MarkRSSItemAsRead ¶ added in v1.15.0
MarkRSSItemAsRead marks all articles in an item (feed/folder) as read. If articleID is provided, only that specific article is marked as read.
func (*Client) MarkRSSItemAsReadCtx ¶ added in v1.15.0
MarkRSSItemAsReadCtx marks articles as read with context. Note: qBittorrent silently returns 200 OK even for invalid paths.
func (*Client) MoveRSSItem ¶ added in v1.15.0
MoveRSSItem moves a feed or folder to a new location.
func (*Client) MoveRSSItemCtx ¶ added in v1.15.0
MoveRSSItemCtx moves a feed or folder to a new location with context.
func (*Client) NewPeerSyncManager ¶ added in v1.15.0
func (c *Client) NewPeerSyncManager(hash string, options ...PeerSyncOptions) *PeerSyncManager
NewPeerSyncManager creates a new peer sync manager for a specific torrent
func (*Client) NewSyncManager ¶ added in v1.15.0
func (c *Client) NewSyncManager(options ...SyncOptions) *SyncManager
NewSyncManager creates a new sync manager for this client
func (*Client) ReAnnounceTorrents ¶
func (*Client) ReAnnounceTorrentsCtx ¶
func (*Client) ReannounceTorrentWithRetry ¶ added in v1.1.0
func (*Client) RefreshRSSItem ¶ added in v1.15.0
RefreshRSSItem triggers a manual refresh of a feed or all feeds in a folder.
func (*Client) RefreshRSSItemCtx ¶ added in v1.15.0
RefreshRSSItemCtx triggers a manual refresh of a feed or all feeds in a folder with context. Note: qBittorrent silently returns 200 OK even for invalid paths.
func (*Client) RemoveCategories ¶
func (*Client) RemoveCategoriesCtx ¶
func (*Client) RemoveRSSItem ¶ added in v1.15.0
RemoveRSSItem removes a feed or folder.
func (*Client) RemoveRSSItemCtx ¶ added in v1.15.0
RemoveRSSItemCtx removes a feed or folder with context.
func (*Client) RemoveRSSRule ¶ added in v1.15.0
RemoveRSSRule deletes an auto-download rule.
func (*Client) RemoveRSSRuleCtx ¶ added in v1.15.0
RemoveRSSRuleCtx deletes an auto-download rule with context. Note: qBittorrent silently succeeds even if the rule doesn't exist.
func (*Client) RemoveTags ¶ added in v1.3.3
RemoveTags remove tags from torrents specified by hashes
func (*Client) RemoveTagsCtx ¶ added in v1.3.3
RemoveTagsCtx remove tags from torrents specified by hashes
func (*Client) RemoveTrackers ¶ added in v1.14.0
RemoveTracker remove trackers of torrent
func (*Client) RemoveTrackersCtx ¶ added in v1.14.0
RemoveTrackersCtx remove trackers of torrent
func (*Client) RenameFile ¶
func (*Client) RenameFileCtx ¶
func (*Client) RenameFolder ¶ added in v1.14.0
RenameFolder Rename folder in torrent
func (*Client) RenameFolderCtx ¶ added in v1.14.0
RenameFolderCtx Rename folder in torrent
func (*Client) RenameRSSRule ¶ added in v1.15.0
RenameRSSRule renames an existing rule.
func (*Client) RenameRSSRuleCtx ¶ added in v1.15.0
RenameRSSRuleCtx renames an existing rule with context. Note: qBittorrent silently succeeds even if the rule doesn't exist.
func (*Client) RequiresMinVersion ¶ added in v1.13.0
RequiresMinVersion checks the current version against version X and errors if the current version is older than X
func (*Client) SetAppCookies ¶ added in v1.14.0
SetAppCookies get app cookies. Cookies are used for downloading torrents.
func (*Client) SetAppCookiesCtx ¶ added in v1.14.0
SetAppCookiesCtx get app cookies. Cookies are used for downloading torrents.
func (*Client) SetAutoManagement ¶
func (*Client) SetAutoManagementCtx ¶
func (*Client) SetCategoryCtx ¶
func (*Client) SetFilePriority ¶ added in v1.12.0
SetFilePriority Set file priority
func (*Client) SetFilePriorityCtx ¶ added in v1.12.0
func (c *Client) SetFilePriorityCtx(ctx context.Context, hash string, IDs string, priority int) error
SetFilePriorityCtx Set file priority
func (*Client) SetForceStartCtx ¶
func (*Client) SetGlobalDownloadLimit ¶ added in v1.14.0
SetGlobalDownloadLimit set download limit globally
func (*Client) SetGlobalDownloadLimitCtx ¶ added in v1.14.0
SetGlobalDownloadLimitCtx set download limit globally
func (*Client) SetGlobalUploadLimit ¶ added in v1.14.0
SetGlobalUploadLimit set upload limit globally
func (*Client) SetGlobalUploadLimitCtx ¶ added in v1.14.0
SetGlobalUploadLimitCtx set upload limit globally
func (*Client) SetLocationCtx ¶
func (*Client) SetMaxPriority ¶ added in v1.7.0
SetMaxPriority set torrents to max priority specified by hashes
func (*Client) SetMaxPriorityCtx ¶ added in v1.7.0
SetMaxPriorityCtx set torrents to max priority specified by hashes
func (*Client) SetMinPriority ¶ added in v1.7.0
SetMinPriority set torrents to min priority specified by hashes
func (*Client) SetMinPriorityCtx ¶ added in v1.7.0
SetMinPriorityCtx set torrents to min priority specified by hashes
func (*Client) SetMonitoredFolders ¶ added in v1.16.0
func (c *Client) SetMonitoredFolders(scanDirs MonitoredFolders) error
SetMonitoredFolders updates folders watched for torrent files via app/setPreferences scan_dirs.
func (*Client) SetMonitoredFoldersCtx ¶ added in v1.16.0
func (c *Client) SetMonitoredFoldersCtx(ctx context.Context, scanDirs MonitoredFolders) error
SetMonitoredFoldersCtx updates folders watched for torrent files via app/setPreferences scan_dirs.
func (*Client) SetPreferences ¶ added in v1.8.0
func (*Client) SetPreferencesCtx ¶ added in v1.8.0
func (*Client) SetPreferencesMaxActiveDownloads ¶ added in v1.8.0
SetPreferencesMaxActiveDownloads set max active downloads
func (*Client) SetPreferencesMaxActiveTorrents ¶ added in v1.8.0
SetPreferencesMaxActiveTorrents set max active torrents
func (*Client) SetPreferencesMaxActiveUploads ¶ added in v1.8.0
SetPreferencesMaxActiveUploads set max active uploads
func (*Client) SetPreferencesQueueingEnabled ¶ added in v1.8.0
SetPreferencesQueueingEnabled enable/disable torrent queueing
func (*Client) SetPreferencesSubcategoriesEnabled ¶ added in v1.15.0
SetPreferencesSubcategoriesEnabled enable/disable subcategories
func (*Client) SetRSSAutoDownloadingEnabled ¶ added in v1.15.0
SetRSSAutoDownloadingEnabled enable/disable RSS auto-downloading
func (*Client) SetRSSAutoDownloadingEnabledCtx ¶ added in v1.15.0
SetRSSAutoDownloadingEnabledCtx enable/disable RSS auto-downloading
func (*Client) SetRSSFeedURL ¶ added in v1.15.0
SetRSSFeedURL changes the URL of an existing feed. Requires qBittorrent 4.6.0+ (WebAPI 2.9.1+).
func (*Client) SetRSSFeedURLCtx ¶ added in v1.15.0
SetRSSFeedURLCtx changes the URL of an existing feed with context. Requires qBittorrent 4.6.0+ (WebAPI 2.9.1+).
func (*Client) SetRSSProcessingEnabled ¶ added in v1.15.0
SetRSSProcessingEnabled enable/disable RSS processing
func (*Client) SetRSSProcessingEnabledCtx ¶ added in v1.15.0
SetRSSProcessingEnabledCtx enable/disable RSS processing
func (*Client) SetRSSRule ¶ added in v1.15.0
func (c *Client) SetRSSRule(ruleName string, rule RSSAutoDownloadRule) error
SetRSSRule creates or updates an auto-download rule.
func (*Client) SetRSSRuleCtx ¶ added in v1.15.0
func (c *Client) SetRSSRuleCtx(ctx context.Context, ruleName string, rule RSSAutoDownloadRule) error
SetRSSRuleCtx creates or updates an auto-download rule with context.
func (*Client) SetTags ¶ added in v1.13.0
SetTags is a new method in qBittorrent 5.1 WebAPI 2.11.4 that allows for upserting tags in one go, instead of having to remove and add tags in different calls. For client instances with a lot of torrents, this will benefit a lot. It checks for the required min version, and if it's less than the required version, it will error, and then the caller can handle it how they want.
func (*Client) SetTorrentDownloadLimit ¶ added in v1.12.0
SetTorrentDownloadLimit set download limit for torrents specified by hashes
func (*Client) SetTorrentDownloadLimitCtx ¶ added in v1.12.0
func (c *Client) SetTorrentDownloadLimitCtx(ctx context.Context, hashes []string, limit int64) error
SetTorrentDownloadLimitCtx set download limit for torrents specified by hashes
func (*Client) SetTorrentName ¶ added in v1.14.0
SetTorrentName set name for torrent specified by hash
func (*Client) SetTorrentNameCtx ¶ added in v1.14.0
SetTorrentNameCtx set name for torrent specified by hash
func (*Client) SetTorrentShareLimit ¶ added in v1.12.0
func (c *Client) SetTorrentShareLimit(hashes []string, opts ShareLimitOptions) error
SetTorrentShareLimit set share limits for torrents specified by hashes.
func (*Client) SetTorrentShareLimitCtx ¶ added in v1.12.0
func (c *Client) SetTorrentShareLimitCtx(ctx context.Context, hashes []string, opts ShareLimitOptions) error
SetTorrentShareLimitCtx set share limits for torrents specified by hashes.
func (*Client) SetTorrentSuperSeeding ¶ added in v1.14.0
SetTorrentSuperSeeding set super speeding mode for torrents specified by hashes.
hashes contains the hashes of the torrents to set super seeding mode for. or you can set to "all" to set super seeding mode for all torrents.
func (*Client) SetTorrentSuperSeedingCtx ¶ added in v1.14.0
SetTorrentSuperSeedingCtx set super seeding mode for torrents specified by hashes.
hashes contains the hashes of the torrents to set super seeding mode for. or you can set to "all" to set super seeding mode for all torrents.
func (*Client) SetTorrentUploadLimit ¶ added in v1.10.0
SetTorrentUploadLimit set upload limit for torrent specified by hashes
func (*Client) SetTorrentUploadLimitCtx ¶ added in v1.10.0
SetTorrentUploadLimitCtx set upload limit for torrent specified by hashes
func (*Client) ShutdownCtx ¶ added in v1.14.0
func (*Client) SyncMainDataCtx ¶ added in v1.11.0
SyncMainDataCtx Sync API implements requests for obtaining changes since the last request. Response ID. If not provided, rid=0 will be assumed. If the given rid is different from the one of last server reply, full_update will be true (see the server reply details for more info)
func (*Client) SyncMainDataCtxWithRaw ¶ added in v1.15.0
func (c *Client) SyncMainDataCtxWithRaw(ctx context.Context, rid int64) (*MainData, map[string]interface{}, error)
SyncMainDataCtxWithRaw returns both parsed MainData and raw JSON data for partial updates
func (*Client) ToggleAlternativeSpeedLimits ¶ added in v1.14.0
ToggleAlternativeSpeedLimits toggle alternative speed limits globally
func (*Client) ToggleAlternativeSpeedLimitsCtx ¶ added in v1.14.0
ToggleAlternativeSpeedLimitsCtx toggle alternative speed limits globally
func (*Client) ToggleFirstLastPiecePrio ¶ added in v1.9.0
ToggleFirstLastPiecePrio toggles the priority of the first and last pieces of torrents specified by hashes
func (*Client) ToggleFirstLastPiecePrioCtx ¶ added in v1.9.0
ToggleFirstLastPiecePrioCtx toggles the priority of the first and last pieces of torrents specified by hashes
func (*Client) ToggleTorrentSequentialDownload ¶ added in v1.14.0
ToggleTorrentSequentialDownload toggles sequential download mode for torrents specified by hashes.
hashes contains the hashes of the torrents to toggle sequential download mode for. or you can set to "all" to toggle sequential download mode for all torrents.
func (*Client) ToggleTorrentSequentialDownloadCtx ¶ added in v1.14.0
ToggleTorrentSequentialDownloadCtx toggles sequential download mode for torrents specified by hashes.
hashes contains the hashes of the torrents to toggle sequential download mode for. or you can set to "all" to toggle sequential download mode for all torrents.
func (*Client) WithHTTPClient ¶ added in v1.12.0
WithHTTPClient allows you to a provide a custom http.Client.
type Config ¶
type Config struct {
Host string
Username string
Password string
APIKey string
// TLS skip cert validation
TLSSkipVerify bool
// HTTP Basic auth username
BasicUser string
// HTTP Basic auth password
BasicPass string
Timeout int
Log *log.Logger
// Retry settings
RetryAttempts int
RetryDelay int // in seconds
}
type ConnectionStatus ¶
type ConnectionStatus string
type ContentLayout ¶
type ContentLayout string
const ( ContentLayoutOriginal ContentLayout = "Original" ContentLayoutSubfolderNone ContentLayout = "NoSubfolder" ContentLayoutSubfolderCreate ContentLayout = "Subfolder" )
type Log ¶ added in v1.14.0
type Log struct {
ID int64 `json:"id"`
Message string `json:"message"`
Timestamp int64 `json:"timestamp"`
Type int64 `json:"type"`
}
Log
type MainData ¶ added in v1.11.0
type MainData struct {
Rid int64 `json:"rid"`
FullUpdate bool `json:"full_update"`
Torrents map[string]Torrent `json:"torrents"`
TorrentsRemoved []string `json:"torrents_removed"`
Categories map[string]Category `json:"categories"`
CategoriesRemoved []string `json:"categories_removed"`
Tags []string `json:"tags"`
TagsRemoved []string `json:"tags_removed"`
Trackers map[string][]string `json:"trackers"`
ServerState ServerState `json:"server_state"`
}
func (*MainData) UpdateWithRawData ¶ added in v1.15.0
UpdateWithRawData efficiently merges partial updates using raw JSON data This provides field-level merging similar to the SyncManager's logic
type MonitoredFolderMode ¶ added in v1.16.0
type MonitoredFolderMode int
MonitoredFolderMode describes where torrents discovered in a monitored folder should be downloaded.
const ( // MonitoredFolderModeMonitoredFolder means download to the monitored folder itself. MonitoredFolderModeMonitoredFolder MonitoredFolderMode = 0 // MonitoredFolderModeDefaultSavePath means download to qBittorrent's default save path. MonitoredFolderModeDefaultSavePath MonitoredFolderMode = 1 // MonitoredFolderModeCustomPath means download to a custom path. MonitoredFolderModeCustomPath MonitoredFolderMode = 2 )
type MonitoredFolderTarget ¶ added in v1.16.0
type MonitoredFolderTarget struct {
// contains filtered or unexported fields
}
MonitoredFolderTarget represents one qBittorrent scan_dirs target value. The Web API accepts either integer values (0, 1) or a custom path string.
func NewMonitoredFolderCustomPath ¶ added in v1.16.0
func NewMonitoredFolderCustomPath(path string) MonitoredFolderTarget
NewMonitoredFolderCustomPath creates a custom-path monitored folder target.
func NewMonitoredFolderTarget ¶ added in v1.16.0
func NewMonitoredFolderTarget(mode MonitoredFolderMode) MonitoredFolderTarget
NewMonitoredFolderTarget creates an int-based monitored folder target (0 or 1).
func (MonitoredFolderTarget) CustomPath ¶ added in v1.16.0
func (d MonitoredFolderTarget) CustomPath() string
CustomPath returns the custom path, if Mode() is MonitoredFolderModeCustomPath.
func (MonitoredFolderTarget) MarshalJSON ¶ added in v1.16.0
func (d MonitoredFolderTarget) MarshalJSON() ([]byte, error)
func (MonitoredFolderTarget) Mode ¶ added in v1.16.0
func (d MonitoredFolderTarget) Mode() MonitoredFolderMode
Mode returns the target mode.
func (*MonitoredFolderTarget) UnmarshalJSON ¶ added in v1.16.0
func (d *MonitoredFolderTarget) UnmarshalJSON(data []byte) error
type MonitoredFolders ¶ added in v1.16.0
type MonitoredFolders map[string]MonitoredFolderTarget
MonitoredFolders is the typed representation of qBittorrent's scan_dirs setting. Key: monitored folder path, Value: target where discovered torrents should be saved.
type PathMetadata ¶ added in v1.15.0
type PathMetadata struct {
Name string `json:"name"`
Type string `json:"type"` // "dir" or "file"
Size int64 `json:"size,omitempty"`
CreationDate int64 `json:"creation_date"`
LastAccessDate int64 `json:"last_access_date"`
LastModificationDate int64 `json:"last_modification_date"`
}
PathMetadata represents the response of the getDirectoryContent method with withMetadata set to true
type PeerLog ¶ added in v1.14.0
type PeerLog struct {
ID int64 `json:"id"`
IP string `json:"ip"`
Blocked bool `json:"blocked"`
Timestamp int64 `json:"timestamp"`
Reason string `json:"reason"`
}
PeerLog
type PeerSyncManager ¶ added in v1.15.0
type PeerSyncManager struct {
// contains filtered or unexported fields
}
PeerSyncManager manages synchronization of peer data for a specific torrent It handles incremental updates efficiently using the rid parameter
func NewPeerSyncManager ¶ added in v1.15.0
func NewPeerSyncManager(client *Client, hash string, options ...PeerSyncOptions) *PeerSyncManager
NewPeerSyncManager creates a new peer sync manager for a specific torrent
func (*PeerSyncManager) GetPeerCount ¶ added in v1.15.0
func (psm *PeerSyncManager) GetPeerCount() int
GetPeerCount returns the current number of connected peers
func (*PeerSyncManager) GetPeers ¶ added in v1.15.0
func (psm *PeerSyncManager) GetPeers() *TorrentPeersResponse
GetPeers returns a copy of the current peer data
func (*PeerSyncManager) Start ¶ added in v1.15.0
func (psm *PeerSyncManager) Start(ctx context.Context) error
Start initializes the peer sync manager and optionally starts auto-sync
func (*PeerSyncManager) Stop ¶ added in v1.15.0
func (psm *PeerSyncManager) Stop()
Stop stops auto-sync if it's running
type PeerSyncOptions ¶ added in v1.15.0
type PeerSyncOptions struct {
AutoSync bool
SyncInterval time.Duration
OnUpdate func(*TorrentPeersResponse)
OnError func(error)
}
PeerSyncOptions configures the behavior of the peer sync manager
func DefaultPeerSyncOptions ¶ added in v1.15.0
func DefaultPeerSyncOptions() PeerSyncOptions
DefaultPeerSyncOptions returns the default options for peer sync
type PieceState ¶ added in v1.14.0
type PieceState int
PieceState represents download state of torrent pieces.
type ProcessInfo ¶ added in v1.16.0
type ProcessInfo struct {
LaunchTime int64 `json:"launch_time"` // Process launch time as UTC epoch seconds
}
type RSSArticle ¶ added in v1.15.0
type RSSArticle struct {
ID string `json:"id"`
Date string `json:"date"`
Title string `json:"title"`
Author string `json:"author,omitempty"`
Description string `json:"description,omitempty"`
TorrentURL string `json:"torrentURL,omitempty"`
Link string `json:"link,omitempty"`
IsRead bool `json:"isRead"`
}
RSSArticle represents an RSS feed article.
type RSSAutoDownloadRule ¶ added in v1.15.0
type RSSAutoDownloadRule struct {
Enabled bool `json:"enabled"`
Priority int `json:"priority"`
UseRegex bool `json:"useRegex"`
MustContain string `json:"mustContain"`
MustNotContain string `json:"mustNotContain"`
EpisodeFilter string `json:"episodeFilter,omitempty"`
AffectedFeeds []string `json:"affectedFeeds"`
LastMatch string `json:"lastMatch,omitempty"`
IgnoreDays int `json:"ignoreDays"`
SmartFilter bool `json:"smartFilter"`
PreviouslyMatchedEpisodes []string `json:"previouslyMatchedEpisodes,omitempty"`
TorrentParams *RSSRuleTorrentParams `json:"torrentParams,omitempty"`
// Legacy fields for backward compatibility
AddPaused *bool `json:"addPaused,omitempty"`
SavePath string `json:"savePath,omitempty"`
AssignedCategory string `json:"assignedCategory,omitempty"`
TorrentContentLayout string `json:"torrentContentLayout,omitempty"`
}
RSSAutoDownloadRule represents an RSS auto-download rule.
type RSSFeed ¶ added in v1.15.0
type RSSFeed struct {
UID string `json:"uid"`
URL string `json:"url"`
RefreshInterval int64 `json:"refreshInterval,omitempty"`
Title string `json:"title,omitempty"`
LastBuildDate string `json:"lastBuildDate,omitempty"`
IsLoading bool `json:"isLoading,omitempty"`
HasError bool `json:"hasError,omitempty"`
Articles []RSSArticle `json:"articles,omitempty"`
}
RSSFeed represents an RSS feed with optional article data.
type RSSItems ¶ added in v1.15.0
type RSSItems map[string]json.RawMessage
RSSItems represents the hierarchical response from rss/items endpoint. The response is a map where keys are item names and values can be either RSSFeed objects or nested RSSItems (for folders).
func (RSSItems) ParseFeeds ¶ added in v1.15.0
ParseFeeds parses the hierarchical RSSItems response and returns all feeds.
type RSSMatchingArticles ¶ added in v1.15.0
RSSMatchingArticles represents the response from rss/matchingArticles endpoint. Keys are feed names, values are arrays of matching article titles.
type RSSRuleTorrentParams ¶ added in v1.15.0
type RSSRuleTorrentParams struct {
Category string `json:"category,omitempty"`
Tags []string `json:"tags,omitempty"`
SavePath string `json:"save_path,omitempty"`
DownloadPath string `json:"download_path,omitempty"`
ContentLayout string `json:"content_layout,omitempty"`
OperatingMode string `json:"operating_mode,omitempty"`
SkipChecking bool `json:"skip_checking,omitempty"`
UploadLimit int `json:"upload_limit,omitempty"`
DownloadLimit int `json:"download_limit,omitempty"`
SeedingTimeLimit int `json:"seeding_time_limit,omitempty"`
InactiveSeedingTimeLimit int `json:"inactive_seeding_time_limit,omitempty"`
RatioLimit float64 `json:"ratio_limit,omitempty"`
Stopped *bool `json:"stopped,omitempty"`
StopCondition string `json:"stop_condition,omitempty"`
UseAutoTMM *bool `json:"use_auto_tmm,omitempty"`
UseDownloadPath *bool `json:"use_download_path,omitempty"`
AddToQueueTop *bool `json:"add_to_top_of_queue,omitempty"`
}
RSSRuleTorrentParams represents torrent parameters for an auto-download rule. JSON field names use snake_case to match qBittorrent's AddTorrentParams serialization.
type RSSRules ¶ added in v1.15.0
type RSSRules map[string]RSSAutoDownloadRule
RSSRules represents the response from rss/rules endpoint. Keys are rule names, values are the rule definitions.
type ReannounceOptions ¶ added in v1.1.0
type ServerState ¶ added in v1.11.0
type ServerState struct {
AlltimeDl int64 `json:"alltime_dl"`
AlltimeUl int64 `json:"alltime_ul"`
AverageTimeQueue int64 `json:"average_time_queue"`
ConnectionStatus string `json:"connection_status"`
DhtNodes int64 `json:"dht_nodes"`
DlInfoData int64 `json:"dl_info_data"`
DlInfoSpeed int64 `json:"dl_info_speed"`
DlRateLimit int64 `json:"dl_rate_limit"`
FreeSpaceOnDisk int64 `json:"free_space_on_disk"`
GlobalRatio string `json:"global_ratio"`
LastExternalAddressV4 string `json:"last_external_address_v4,omitempty"`
LastExternalAddressV6 string `json:"last_external_address_v6,omitempty"`
QueuedIoJobs int64 `json:"queued_io_jobs"`
Queueing bool `json:"queueing"`
ReadCacheHits string `json:"read_cache_hits"`
ReadCacheOverload string `json:"read_cache_overload"`
RefreshInterval int64 `json:"refresh_interval"`
TotalBuffersSize int64 `json:"total_buffers_size"`
TotalPeerConnections int64 `json:"total_peer_connections"`
TotalQueuedSize int64 `json:"total_queued_size"`
TotalWastedSession int64 `json:"total_wasted_session"`
UpInfoData int64 `json:"up_info_data"`
UpInfoSpeed int64 `json:"up_info_speed"`
UpRateLimit int64 `json:"up_rate_limit"`
UseAltSpeedLimits bool `json:"use_alt_speed_limits"`
UseSubcategories bool `json:"use_subcategories"`
WriteCacheOverload string `json:"write_cache_overload"`
}
type ShareLimitOptions ¶ added in v1.16.0
type ShareLimitOptions struct {
}
ShareLimitOptions defines share limit settings for torrents. ShareLimitAction and ShareLimitsMode were added in webapi 2.12.
ShareLimitAction and ShareLimitsMode must be Qt meta enum key names as used by the WebUI (see Utils::String::toEnum in qBittorrent). Numeric strings such as "0" are not recognized and are treated as Default by the server.
type SyncManager ¶ added in v1.15.0
type SyncManager struct {
// contains filtered or unexported fields
}
SyncManager manages synchronization of MainData updates and provides a consistent view of the qBittorrent state across partial updates.
func NewSyncManager ¶ added in v1.15.0
func NewSyncManager(client *Client, options ...SyncOptions) *SyncManager
NewSyncManager creates a new sync manager for the given client
func (*SyncManager) GetCategories ¶ added in v1.15.0
func (sm *SyncManager) GetCategories() map[string]Category
GetCategories returns a copy of all categories
func (*SyncManager) GetCategoriesUnchecked ¶ added in v1.15.0
func (sm *SyncManager) GetCategoriesUnchecked() map[string]Category
GetCategoriesUnchecked returns a copy of all categories without checking freshness. This is faster but may return stale data.
func (*SyncManager) GetData ¶ added in v1.15.0
func (sm *SyncManager) GetData() *MainData
GetData returns a deep copy of the current synchronized data
func (*SyncManager) GetDataUnchecked ¶ added in v1.15.0
func (sm *SyncManager) GetDataUnchecked() *MainData
GetDataUnchecked returns a deep copy of the current synchronized data without checking freshness. This is faster but may return stale data. Use this when you've just called Sync() or when AutoSync is enabled and you don't need the absolute latest data.
func (*SyncManager) GetServerState ¶ added in v1.15.0
func (sm *SyncManager) GetServerState() ServerState
GetServerState returns the current server state
func (*SyncManager) GetServerStateUnchecked ¶ added in v1.15.0
func (sm *SyncManager) GetServerStateUnchecked() ServerState
GetServerStateUnchecked returns the current server state without checking freshness. This is faster but may return stale data.
func (*SyncManager) GetTags ¶ added in v1.15.0
func (sm *SyncManager) GetTags() []string
GetTags returns a copy of all tags
func (*SyncManager) GetTagsUnchecked ¶ added in v1.15.0
func (sm *SyncManager) GetTagsUnchecked() []string
GetTagsUnchecked returns a copy of all tags without checking freshness. This is faster but may return stale data.
func (*SyncManager) GetTorrent ¶ added in v1.15.0
func (sm *SyncManager) GetTorrent(hash string) (Torrent, bool)
GetTorrent returns a specific torrent by hash
func (*SyncManager) GetTorrentMap ¶ added in v1.15.0
func (sm *SyncManager) GetTorrentMap(options TorrentFilterOptions) map[string]Torrent
GetTorrentMap returns a filtered map of torrents keyed by hash
func (*SyncManager) GetTorrentUnchecked ¶ added in v1.15.0
func (sm *SyncManager) GetTorrentUnchecked(hash string) (Torrent, bool)
GetTorrentUnchecked returns a specific torrent by hash without checking freshness. This is faster but may return stale data. Use this when you've just called Sync() or when AutoSync is enabled and you don't need the absolute latest data.
func (*SyncManager) GetTorrents ¶ added in v1.15.0
func (sm *SyncManager) GetTorrents(options TorrentFilterOptions) []Torrent
GetTorrents returns a filtered list of torrents
func (*SyncManager) GetTorrentsUnchecked ¶ added in v1.15.0
func (sm *SyncManager) GetTorrentsUnchecked(options TorrentFilterOptions) []Torrent
GetTorrentsUnchecked returns a filtered list of torrents without checking freshness. This is faster but may return stale data. Use this when you've just called Sync() or when AutoSync is enabled and you don't need the absolute latest data.
func (*SyncManager) LastError ¶ added in v1.15.0
func (sm *SyncManager) LastError() error
LastError returns the error from the last sync operation, or nil if successful
func (*SyncManager) LastSyncDuration ¶ added in v1.15.0
func (sm *SyncManager) LastSyncDuration() time.Duration
LastSyncDuration returns the duration of the last sync operation
func (*SyncManager) LastSyncTime ¶ added in v1.15.0
func (sm *SyncManager) LastSyncTime() time.Time
LastSyncTime returns the time of the last successful sync
func (*SyncManager) Start ¶ added in v1.15.0
func (sm *SyncManager) Start(ctx context.Context) error
Start initializes the sync manager and optionally starts auto-sync
func (*SyncManager) Sync ¶ added in v1.15.0
func (sm *SyncManager) Sync(ctx context.Context) error
Sync performs a synchronization with the qBittorrent server If another sync is already in progress, this method will wait for it to complete and all callers will receive the same result (using singleflight pattern). Note: Uses context.Background() for all syncs to avoid context confusion in batched calls.
func (*SyncManager) Trackers ¶ added in v1.15.0
func (sm *SyncManager) Trackers() *TrackerManager
Trackers returns the tracker manager associated with this sync manager.
type SyncOptions ¶ added in v1.15.0
type SyncOptions struct {
// AutoSync enables automatic periodic syncing
AutoSync bool
// SyncInterval is the base interval between automatic syncs (default: 2s)
SyncInterval time.Duration
// DynamicSync enables dynamic sync intervals based on request duration
DynamicSync bool
// MaxSyncInterval is the maximum sync interval when using dynamic sync (default: 30s)
MaxSyncInterval time.Duration
// MinSyncInterval is the minimum sync interval when using dynamic sync (default: 1s)
MinSyncInterval time.Duration
// JitterPercent adds randomness to sync intervals (0-100, default: 10)
JitterPercent int
// OnUpdate is called whenever the data is updated
OnUpdate func(*MainData)
// OnError is called when sync encounters an error
OnError func(error)
// RetainRemovedData keeps removed items for one sync cycle for comparison
RetainRemovedData bool
}
SyncOptions configures the behavior of the sync manager
func DefaultSyncOptions ¶ added in v1.15.0
func DefaultSyncOptions() SyncOptions
DefaultSyncOptions returns sensible default options
type Torrent ¶
type Torrent struct {
AddedOn int64 `json:"added_on"`
AmountLeft int64 `json:"amount_left"`
AutoManaged bool `json:"auto_tmm"`
Availability float64 `json:"availability"`
Category string `json:"category"`
Comment string `json:"comment"`
Completed int64 `json:"completed"`
CompletionOn int64 `json:"completion_on"`
CreatedBy string `json:"created_by"`
ContentPath string `json:"content_path"`
DlLimit int64 `json:"dl_limit"`
DlSpeed int64 `json:"dlspeed"`
DownloadPath string `json:"download_path"`
Downloaded int64 `json:"downloaded"`
DownloadedSession int64 `json:"downloaded_session"`
ETA int64 `json:"eta"`
FirstLastPiecePrio bool `json:"f_l_piece_prio"`
ForceStart bool `json:"force_start"`
Hash string `json:"hash"`
InfohashV1 string `json:"infohash_v1"`
InfohashV2 string `json:"infohash_v2"`
Popularity float64 `json:"popularity"`
Private bool `json:"private"`
LastActivity int64 `json:"last_activity"`
MagnetURI string `json:"magnet_uri"`
MaxRatio float64 `json:"max_ratio"`
MaxSeedingTime int64 `json:"max_seeding_time"`
MaxInactiveSeedingTime int64 `json:"max_inactive_seeding_time"`
Name string `json:"name"`
NumComplete int64 `json:"num_complete"`
NumIncomplete int64 `json:"num_incomplete"`
NumLeechs int64 `json:"num_leechs"`
NumSeeds int64 `json:"num_seeds"`
Priority int64 `json:"priority"`
Progress float64 `json:"progress"`
Ratio float64 `json:"ratio"`
RatioLimit float64 `json:"ratio_limit"`
Reannounce int64 `json:"reannounce"`
SavePath string `json:"save_path"`
SeedingTime int64 `json:"seeding_time"`
SeedingTimeLimit int64 `json:"seeding_time_limit"`
InactiveSeedingTimeLimit int64 `json:"inactive_seeding_time_limit"`
SeenComplete int64 `json:"seen_complete"`
SequentialDownload bool `json:"seq_dl"`
Size int64 `json:"size"`
State TorrentState `json:"state"`
SuperSeeding bool `json:"super_seeding"`
Tags string `json:"tags"`
TimeActive int64 `json:"time_active"`
TotalSize int64 `json:"total_size"`
Tracker string `json:"tracker"`
TrackersCount int64 `json:"trackers_count"`
UpLimit int64 `json:"up_limit"`
Uploaded int64 `json:"uploaded"`
UploadedSession int64 `json:"uploaded_session"`
UpSpeed int64 `json:"upspeed"`
Trackers []TorrentTracker `json:"trackers"`
}
type TorrentAddOptions ¶
type TorrentAddOptions struct {
Stopped bool // introduced in Web API v2.11.0 (v5.0.0)
Paused bool
SkipHashCheck bool
ContentLayout ContentLayout
SavePath string
DownloadPath string
UseDownloadPath bool
AutoTMM bool
Category string
Tags string
LimitUploadSpeed int64
LimitDownloadSpeed int64
LimitRatio float64
LimitSeedTime int64
Rename string
FirstLastPiecePrio bool
SequentialDownload bool
}
func (*TorrentAddOptions) Prepare ¶
func (o *TorrentAddOptions) Prepare() map[string]string
type TorrentAddResponse ¶ added in v1.16.0
type TorrentCreationParams ¶ added in v1.15.0
type TorrentCreationParams struct {
SourcePath string `json:"sourcePath"`
TorrentFilePath string `json:"torrentFilePath,omitempty"`
Private bool `json:"private,omitempty"`
Format TorrentFormat `json:"format,omitempty"`
OptimizeAlignment bool `json:"optimizeAlignment,omitempty"`
PaddedFileSizeLimit int `json:"paddedFileSizeLimit,omitempty"`
PieceSize int `json:"pieceSize,omitempty"`
Comment string `json:"comment,omitempty"`
Source string `json:"source,omitempty"`
Trackers []string `json:"trackers,omitempty"`
URLSeeds []string `json:"urlSeeds,omitempty"`
StartSeeding *bool `json:"startSeeding,omitempty"` // nil = default (true), false = don't seed, true = seed
}
TorrentCreationParams represents the parameters for creating a torrent
type TorrentCreationStatus ¶ added in v1.15.0
type TorrentCreationStatus string
TorrentCreationStatus represents the status of a torrent creation task
const ( TorrentCreationStatusQueued TorrentCreationStatus = "Queued" TorrentCreationStatusRunning TorrentCreationStatus = "Running" TorrentCreationStatusFinished TorrentCreationStatus = "Finished" TorrentCreationStatusFailed TorrentCreationStatus = "Failed" )
type TorrentCreationTask ¶ added in v1.15.0
type TorrentCreationTask struct {
TaskID string `json:"taskID"`
SourcePath string `json:"sourcePath"`
TorrentFilePath string `json:"torrentFilePath,omitempty"`
PieceSize int `json:"pieceSize"`
Private bool `json:"private"`
Format TorrentFormat `json:"format,omitempty"`
OptimizeAlignment bool `json:"optimizeAlignment,omitempty"`
PaddedFileSizeLimit int `json:"paddedFileSizeLimit,omitempty"`
Status TorrentCreationStatus `json:"status"`
Comment string `json:"comment,omitempty"`
Source string `json:"source,omitempty"`
Trackers []string `json:"trackers,omitempty"`
URLSeeds []string `json:"urlSeeds,omitempty"`
TimeAdded string `json:"timeAdded"`
TimeStarted string `json:"timeStarted,omitempty"`
TimeFinished string `json:"timeFinished,omitempty"`
Progress float64 `json:"progress,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
}
TorrentCreationTask represents a torrent creation task
type TorrentCreationTaskResponse ¶ added in v1.15.0
type TorrentCreationTaskResponse struct {
TaskID string `json:"taskID"`
}
TorrentCreationTaskResponse represents the response when adding a torrent creation task
type TorrentFile ¶ added in v1.15.0
type TorrentFiles ¶
type TorrentFiles []TorrentFile
type TorrentFilter ¶
type TorrentFilter string
const ( // Torrent is paused TorrentFilterAll TorrentFilter = "all" // Torrent is active TorrentFilterActive TorrentFilter = "active" // Torrent is inactive TorrentFilterInactive TorrentFilter = "inactive" // Torrent is completed TorrentFilterCompleted TorrentFilter = "completed" // Torrent is resumed (for backward compatibility with qBittorrent < 4.6.0) // In older versions (e.g., v4.3.9), "resumed" means !isPaused() // Removed in v4.6.0+ (commit 5d1c2496, March 2024) in favor of "running" TorrentFilterResumed TorrentFilter = "resumed" // Torrent is paused TorrentFilterPaused TorrentFilter = "paused" // Torrent is stopped // Added in qBittorrent v4.6.0+ (commit 5d1c2496, March 2024) // Replaces the old "paused" filter TorrentFilterStopped TorrentFilter = "stopped" // Torrent is running (not stopped) // Added in qBittorrent v4.6.0+ (commit 5d1c2496, March 2024) // Replaces the old "resumed" filter TorrentFilterRunning TorrentFilter = "running" // Torrent is stalled TorrentFilterStalled TorrentFilter = "stalled" // Torrent is being seeded and data is being transferred TorrentFilterUploading TorrentFilter = "uploading" // Torrent is being seeded, but no connection were made TorrentFilterStalledUploading TorrentFilter = "stalled_uploading" // Torrent is being downloaded and data is being transferred TorrentFilterDownloading TorrentFilter = "downloading" // Torrent is being downloaded, but no connection were made TorrentFilterStalledDownloading TorrentFilter = "stalled_downloading" // Torrent is errored TorrentFilterError TorrentFilter = "errored" // Torrent is checking TorrentFilterChecking TorrentFilter = "checking" // Torrent is moving TorrentFilterMoving TorrentFilter = "moving" )
func ParseTorrentFilter ¶ added in v1.15.0
func ParseTorrentFilter(filter string) TorrentFilter
type TorrentFilterOptions ¶
type TorrentFormat ¶ added in v1.15.0
type TorrentFormat string
TorrentFormat represents the torrent format for creation
const ( TorrentFormatV1 TorrentFormat = "v1" TorrentFormatV2 TorrentFormat = "v2" TorrentFormatHybrid TorrentFormat = "hybrid" )
type TorrentPeer ¶ added in v1.15.0
type TorrentPeer struct {
IP string `json:"ip,omitempty"`
Connection string `json:"connection,omitempty"`
Flags string `json:"flags,omitempty"`
FlagsDesc string `json:"flags_desc,omitempty"`
Client string `json:"client,omitempty"`
Files string `json:"files,omitempty"`
Country string `json:"country,omitempty"`
CountryCode string `json:"country_code,omitempty"`
PeerIDClient string `json:"peer_id_client,omitempty"`
Port int `json:"port,omitempty"`
Progress float64 `json:"progress"` // Progress should always be included (0 is valid)
DownSpeed int64 `json:"dl_speed,omitempty"`
UpSpeed int64 `json:"up_speed,omitempty"`
Downloaded int64 `json:"downloaded,omitempty"`
Uploaded int64 `json:"uploaded,omitempty"`
Relevance float64 `json:"relevance,omitempty"`
// contains filtered or unexported fields
}
TorrentPeer represents a peer connected to a torrent
func (TorrentPeer) HasProgress ¶ added in v1.15.0
func (tp TorrentPeer) HasProgress() bool
HasProgress reports whether the progress field was present in the JSON payload.
func (*TorrentPeer) UnmarshalJSON ¶ added in v1.15.0
func (tp *TorrentPeer) UnmarshalJSON(data []byte) error
UnmarshalJSON captures whether optional fields such as progress were present in the payload.
type TorrentPeersResponse ¶ added in v1.15.0
type TorrentPeersResponse struct {
Peers map[string]TorrentPeer `json:"peers,omitempty"`
PeersRemoved []string `json:"peers_removed,omitempty"`
Rid int64 `json:"rid"`
FullUpdate bool `json:"full_update"`
ShowFlags bool `json:"show_flags,omitempty"`
}
TorrentPeersResponse represents the response from sync/torrentPeers endpoint
func (*TorrentPeersResponse) MergePeers ¶ added in v1.15.0
func (r *TorrentPeersResponse) MergePeers(update *TorrentPeersResponse)
MergePeers merges a partial peer update into an existing peer list This handles incremental updates from the sync/torrentPeers endpoint
type TorrentProperties ¶ added in v1.7.2
type TorrentProperties struct {
AdditionDate int `json:"addition_date"`
Comment string `json:"comment"`
CompletionDate int `json:"completion_date"`
CreatedBy string `json:"created_by"`
CreationDate int `json:"creation_date"`
DlLimit int `json:"dl_limit"`
DlSpeed int `json:"dl_speed"`
DlSpeedAvg int `json:"dl_speed_avg"`
DownloadPath string `json:"download_path"`
Eta int `json:"eta"`
Hash string `json:"hash"`
InfohashV1 string `json:"infohash_v1"`
InfohashV2 string `json:"infohash_v2"`
IsPrivate bool `json:"is_private"`
LastSeen int `json:"last_seen"`
Name string `json:"name"`
NbConnections int `json:"nb_connections"`
NbConnectionsLimit int `json:"nb_connections_limit"`
Peers int `json:"peers"`
PeersTotal int `json:"peers_total"`
PieceSize int `json:"piece_size"`
PiecesHave int `json:"pieces_have"`
PiecesNum int `json:"pieces_num"`
Reannounce int `json:"reannounce"`
SavePath string `json:"save_path"`
SeedingTime int `json:"seeding_time"`
Seeds int `json:"seeds"`
SeedsTotal int `json:"seeds_total"`
TimeElapsed int `json:"time_elapsed"`
TotalDownloaded int64 `json:"total_downloaded"`
TotalDownloadedSession int64 `json:"total_downloaded_session"`
TotalSize int64 `json:"total_size"`
TotalUploaded int64 `json:"total_uploaded"`
TotalUploadedSession int64 `json:"total_uploaded_session"`
TotalWasted int64 `json:"total_wasted"`
UpLimit int `json:"up_limit"`
UpSpeed int `json:"up_speed"`
UpSpeedAvg int `json:"up_speed_avg"`
}
type TorrentState ¶
type TorrentState string
const ( // Some error occurred, applies to paused torrents TorrentStateError TorrentState = "error" // Torrent data files is missing TorrentStateMissingFiles TorrentState = "missingFiles" // Torrent is being seeded and data is being transferred TorrentStateUploading TorrentState = "uploading" // Torrent is paused and has finished downloading TorrentStatePausedUp TorrentState = "pausedUP" // Torrent is stopped and has finished downloading TorrentStateStoppedUp TorrentState = "stoppedUP" // Queuing is enabled and torrent is queued for upload TorrentStateQueuedUp TorrentState = "queuedUP" // Torrent is being seeded, but no connection were made TorrentStateStalledUp TorrentState = "stalledUP" // Torrent has finished downloading and is being checked TorrentStateCheckingUp TorrentState = "checkingUP" // Torrent is forced to uploading and ignore queue limit TorrentStateForcedUp TorrentState = "forcedUP" // Torrent is allocating disk space for download TorrentStateAllocating TorrentState = "allocating" // Torrent is being downloaded and data is being transferred TorrentStateDownloading TorrentState = "downloading" // Torrent has just started downloading and is fetching metadata TorrentStateMetaDl TorrentState = "metaDL" // Torrent is paused and has NOT finished downloading TorrentStatePausedDl TorrentState = "pausedDL" // Torrent is stopped and has NOT finished downloading TorrentStateStoppedDl TorrentState = "stoppedDL" // Queuing is enabled and torrent is queued for download TorrentStateQueuedDl TorrentState = "queuedDL" // Torrent is being downloaded, but no connection were made TorrentStateStalledDl TorrentState = "stalledDL" // Same as checkingUP, but torrent has NOT finished downloading TorrentStateCheckingDl TorrentState = "checkingDL" // Torrent is forced to downloading to ignore queue limit TorrentStateForcedDl TorrentState = "forcedDL" // Checking resume data on qBt startup TorrentStateCheckingResumeData TorrentState = "checkingResumeData" // Torrent is moving to another location TorrentStateMoving TorrentState = "moving" // Unknown status TorrentStateUnknown TorrentState = "unknown" )
type TorrentTracker ¶
type TorrentTracker struct {
// Tier int `json:"tier"` // can be both empty "" and int
Url string `json:"url"`
Status TrackerStatus `json:"status"`
NumPeers int `json:"num_peers"`
NumSeeds int `json:"num_seeds"`
NumLeechers int `json:"num_leeches"`
NumDownloaded int `json:"num_downloaded"`
Message string `json:"msg"`
}
type TorrentTrackersResponse ¶
type TorrentTrackersResponse struct {
Trackers []TorrentTracker `json:"trackers"`
}
type TrackerManager ¶ added in v1.15.0
type TrackerManager struct {
// contains filtered or unexported fields
}
TrackerManager coordinates tracker metadata hydration with caching.
func NewTrackerManager ¶ added in v1.15.0
func NewTrackerManager(api trackerAPI) *TrackerManager
NewTrackerManager constructs a manager for tracker metadata caching.
func (*TrackerManager) HydrateTorrents ¶ added in v1.15.0
func (tm *TrackerManager) HydrateTorrents(ctx context.Context, torrents []Torrent) ([]Torrent, map[string][]TorrentTracker)
HydrateTorrents enriches the provided torrents with tracker metadata from cache. For versions that support IncludeTrackers, fetches all trackers at once. Otherwise fetches individually if not cached. It returns the enriched slice and a cache of tracker lists keyed by hash.
func (*TrackerManager) Invalidate ¶ added in v1.15.0
func (tm *TrackerManager) Invalidate(hashes ...string)
Invalidate clears cached tracker metadata for the supplied hashes. When no hashes are provided the entire cache is purged.
func (*TrackerManager) SetUseIncludeTrackers ¶ added in v1.15.0
func (tm *TrackerManager) SetUseIncludeTrackers(use bool)
SetUseIncludeTrackers configures whether the manager should use the bulk IncludeTrackers API (available in qBittorrent 5.1+/WebAPI 2.11.4+).
func (*TrackerManager) SupportsIncludeTrackers ¶ added in v1.15.0
func (tm *TrackerManager) SupportsIncludeTrackers() bool
SupportsIncludeTrackers reports whether bulk tracker fetching is enabled.
type TrackerStatus ¶
type TrackerStatus int
TrackerStatus is the numeric status from torrents/trackers and sync payloads; see https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-trackers
const ( // 0 Tracker is disabled (used for DHT, PeX, and LSD) TrackerStatusDisabled TrackerStatus = 0 // 1 Tracker has not been contacted yet TrackerStatusNotContacted TrackerStatus = 1 // 2 Tracker has been contacted and is working TrackerStatusOK TrackerStatus = 2 // 3 Tracker is updating TrackerStatusUpdating TrackerStatus = 3 // 4 Not working: generic announce failure; Web API 2.13+ adds 5 and 6 for finer-grained failures TrackerStatusNotWorking TrackerStatus = 4 // 5 Tracker error: explicit tracker-side error (not unreachable; not generic 4) TrackerStatusTrackerError TrackerStatus = 5 // 6 Unreachable: cannot connect to the tracker (vs 5: tracker returned an error instead) TrackerStatusUnreachable TrackerStatus = 6 )
type TransferInfo ¶
type TransferInfo struct {
ConnectionStatus ConnectionStatus `json:"connection_status"`
DHTNodes int64 `json:"dht_nodes"`
DlInfoData int64 `json:"dl_info_data"`
DlInfoSpeed int64 `json:"dl_info_speed"`
DlRateLimit int64 `json:"dl_rate_limit"`
UpInfoData int64 `json:"up_info_data"`
UpInfoSpeed int64 `json:"up_info_speed"`
UpRateLimit int64 `json:"up_rate_limit"`
}
TransferInfo
https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-global-transfer-info
dl_info_speed integer Global download rate (bytes/s)
dl_info_data integer Data downloaded this session (bytes)
up_info_speed integer Global upload rate (bytes/s)
up_info_data integer Data uploaded this session (bytes)
dl_rate_limit integer Download rate limit (bytes/s)
up_rate_limit integer Upload rate limit (bytes/s)
dht_nodes integer DHT nodes connected to
connection_status string Connection status. See possible values here below