Documentation
¶
Index ¶
- Constants
- Variables
- func TranslateErrorCode(errorCode ErrorCode) core.ErrorCode
- func UpstreamErrorWithCause(cause error) *core.UpstreamError
- type APIClient
- func (c APIClient) CheckTorrentsCached(params *CheckTorrentsCachedParams) (APIResponse[CheckTorrentsCachedData], error)
- func (c APIClient) CheckUsenetCached(params *CheckUsenetCachedParams) (APIResponse[CheckUsenetCachedData], error)
- func (c APIClient) CheckWebDLCached(params *CheckWebDLCachedParams) (APIResponse[CheckWebDLCachedData], error)
- func (c APIClient) ControlTorrent(params *ControlTorrentParams) (APIResponse[ControlTorrentData], error)
- func (c APIClient) ControlUsenetDownload(params *ControlUsenetDownloadParams) (APIResponse[ControlUsenetDownloadData], error)
- func (c APIClient) ControlWebDLDownload(params *ControlWebDLDownloadParams) (APIResponse[ControlWebDLDownloadData], error)
- func (c APIClient) CreateTorrent(params *CreateTorrentParams) (APIResponse[CreateTorrentData], error)
- func (c APIClient) CreateUsenetDownload(params *CreateUsenetDownloadParams) (APIResponse[CreateUsenetDownloadData], error)
- func (c APIClient) CreateWebDLDownload(params *CreateWebDLDownloadParams) (APIResponse[CreateWebDLDownloadData], error)
- func (c APIClient) GetTorrent(params *GetTorrentParams) (APIResponse[GetTorrentData], error)
- func (c APIClient) GetTorrentInfo(params *GetTorrentInfoParams) (APIResponse[GetTorrentInfoData], error)
- func (c APIClient) GetUsenetDownload(params *GetUsenetDownloadParams) (APIResponse[GetUsenetDownloadData], error)
- func (c APIClient) GetUser(params *GetUserParams) (APIResponse[GetUserData], error)
- func (c APIClient) GetWebDLDownload(params *GetWebDLDownloadParams) (APIResponse[GetWebDLDownloadData], error)
- func (c APIClient) ListTorrents(params *ListTorrentsParams) (APIResponse[ListTorrentsData], error)
- func (c APIClient) ListUsenetDownload(params *ListUsenetDownloadParams) (APIResponse[ListUsenetDownloadData], error)
- func (c APIClient) ListWebDLDownload(params *ListWebDLDownloadParams) (APIResponse[ListWebDLDownloadData], error)
- func (c APIClient) Request(method, path string, params request.Context, v ResponseEnvelop) (*http.Response, error)
- func (c APIClient) RequestDownloadLink(params *RequestDownloadLinkParams) (APIResponse[RequestDownloadLinkData], error)
- func (c APIClient) RequestSearch(method, path string, params request.Context, v ResponseEnvelop) (*http.Response, error)
- func (c APIClient) RequestUsenetDownloadLink(params *RequestUsenetDownloadLinkParams) (APIResponse[RequestDownloadLinkData], error)
- func (c APIClient) RequestWebDLDownloadLink(params *RequestWebDLDownloadLinkParams) (APIResponse[RequestDownloadLinkData], error)
- func (c APIClient) SearchUsenetByID(params *SearchUsenetByIDParams) (APIResponse[UsenetSearchByIDData], error)
- type APIClientConfig
- type APIResponse
- type CheckTorrentsCachedData
- type CheckTorrentsCachedDataItem
- type CheckTorrentsCachedDataItemFile
- type CheckTorrentsCachedParams
- type CheckUsenetCachedData
- type CheckUsenetCachedDataItem
- type CheckUsenetCachedDataItemFile
- type CheckUsenetCachedParams
- type CheckWebDLCachedData
- type CheckWebDLCachedDataItem
- type CheckWebDLCachedParams
- type ControlTorrentData
- type ControlTorrentOperation
- type ControlTorrentParams
- type ControlUsenetDownloadData
- type ControlUsenetDownloadOperation
- type ControlUsenetDownloadParams
- type ControlWebDLDownloadData
- type ControlWebDLDownloadOperation
- type ControlWebDLDownloadParams
- type CreateTorrentData
- type CreateTorrentParams
- type CreateTorrentParamsSeed
- type CreateUsenetDownloadData
- type CreateUsenetDownloadParams
- type CreateUsenetDownloadParamsPostProcessing
- type CreateWebDLDownloadData
- type CreateWebDLDownloadParams
- type CreateWebDLDownloadParamsPostProcessing
- type Ctx
- type ErrorCode
- type GetTorrentData
- type GetTorrentInfoData
- type GetTorrentInfoParams
- type GetTorrentParams
- type GetUsenetDownloadData
- type GetUsenetDownloadParams
- type GetUserData
- type GetUserParams
- type GetWebDLDownloadData
- type GetWebDLDownloadParams
- type ListTorrentsData
- type ListTorrentsParams
- type ListUsenetDownloadData
- type ListUsenetDownloadParams
- type ListWebDLDownloadData
- type ListWebDLDownloadParams
- type LockedFileLink
- type Plan
- type RequestDownloadLinkData
- type RequestDownloadLinkParams
- type RequestUsenetDownloadLinkParams
- type RequestWebDLDownloadLinkParams
- type Response
- type ResponseEnvelop
- type ResponseError
- type ResponseStatus
- type SearchUsenetByIDParams
- type StoreClient
- func (c *StoreClient) AddMagnet(params *store.AddMagnetParams) (*store.AddMagnetData, error)
- func (c *StoreClient) AddNewz(params *store.AddNewzParams) (*store.AddNewzData, error)
- func (c *StoreClient) CheckMagnet(params *store.CheckMagnetParams) (*store.CheckMagnetData, error)
- func (c *StoreClient) CheckNewz(params *store.CheckNewzParams) (*store.CheckNewzData, error)
- func (c *StoreClient) GenerateLink(params *store.GenerateLinkParams) (*store.GenerateLinkData, error)
- func (c *StoreClient) GenerateNewzLink(params *store.GenerateNewzLinkParams) (*store.GenerateNewzLinkData, error)
- func (c *StoreClient) GetMagnet(params *store.GetMagnetParams) (*store.GetMagnetData, error)
- func (c *StoreClient) GetName() store.StoreName
- func (c *StoreClient) GetNewz(params *store.GetNewzParams) (*store.GetNewzData, error)
- func (c *StoreClient) GetUser(params *store.GetUserParams) (*store.User, error)
- func (c *StoreClient) ListMagnets(params *store.ListMagnetsParams) (*store.ListMagnetsData, error)
- func (c *StoreClient) ListNewz(params *store.ListNewzParams) (*store.ListNewzData, error)
- func (c *StoreClient) RemoveMagnet(params *store.RemoveMagnetParams) (*store.RemoveMagnetData, error)
- func (c *StoreClient) RemoveNewz(params *store.RemoveNewzParams) (*store.RemoveNewzData, error)
- type StoreClientConfig
- type Torrent
- type TorrentDownloadState
- type TorrentFile
- type UsenetDownload
- type UsenetDownloadFile
- type UsenetDownloadState
- type UsenetSearchByIDData
- type UsenetSearchByIDDataMetadata
- type UsenetSearchByIDDataNZB
- type WebDLDownload
- type WebDLDownloadFile
- type WebDLDownloadState
Constants ¶
View Source
const ( PlanFree = iota PlanEssential PlanPro PlanStandard )
Variables ¶
View Source
var DefaultHTTPClient = config.DefaultHTTPClient
View Source
var SearchAPIBaseURL = util.MustParseURL("https://search-api.torbox.app")
Functions ¶
func TranslateErrorCode ¶
func UpstreamErrorWithCause ¶
func UpstreamErrorWithCause(cause error) *core.UpstreamError
Types ¶
type APIClient ¶
type APIClient struct {
BaseURL *url.URL
HTTPClient *http.Client
// contains filtered or unexported fields
}
func NewAPIClient ¶
func NewAPIClient(conf *APIClientConfig) *APIClient
func (APIClient) CheckTorrentsCached ¶
func (c APIClient) CheckTorrentsCached(params *CheckTorrentsCachedParams) (APIResponse[CheckTorrentsCachedData], error)
func (APIClient) CheckUsenetCached ¶
func (c APIClient) CheckUsenetCached(params *CheckUsenetCachedParams) (APIResponse[CheckUsenetCachedData], error)
func (APIClient) CheckWebDLCached ¶
func (c APIClient) CheckWebDLCached(params *CheckWebDLCachedParams) (APIResponse[CheckWebDLCachedData], error)
func (APIClient) ControlTorrent ¶
func (c APIClient) ControlTorrent(params *ControlTorrentParams) (APIResponse[ControlTorrentData], error)
func (APIClient) ControlUsenetDownload ¶
func (c APIClient) ControlUsenetDownload(params *ControlUsenetDownloadParams) (APIResponse[ControlUsenetDownloadData], error)
func (APIClient) ControlWebDLDownload ¶
func (c APIClient) ControlWebDLDownload(params *ControlWebDLDownloadParams) (APIResponse[ControlWebDLDownloadData], error)
func (APIClient) CreateTorrent ¶
func (c APIClient) CreateTorrent(params *CreateTorrentParams) (APIResponse[CreateTorrentData], error)
Possible Detail values:
- Found Cached Torrent. Using Cached Torrent.
func (APIClient) CreateUsenetDownload ¶
func (c APIClient) CreateUsenetDownload(params *CreateUsenetDownloadParams) (APIResponse[CreateUsenetDownloadData], error)
func (APIClient) CreateWebDLDownload ¶
func (c APIClient) CreateWebDLDownload(params *CreateWebDLDownloadParams) (APIResponse[CreateWebDLDownloadData], error)
func (APIClient) GetTorrent ¶
func (c APIClient) GetTorrent(params *GetTorrentParams) (APIResponse[GetTorrentData], error)
func (APIClient) GetTorrentInfo ¶
func (c APIClient) GetTorrentInfo(params *GetTorrentInfoParams) (APIResponse[GetTorrentInfoData], error)
func (APIClient) GetUsenetDownload ¶
func (c APIClient) GetUsenetDownload(params *GetUsenetDownloadParams) (APIResponse[GetUsenetDownloadData], error)
func (APIClient) GetUser ¶
func (c APIClient) GetUser(params *GetUserParams) (APIResponse[GetUserData], error)
func (APIClient) GetWebDLDownload ¶
func (c APIClient) GetWebDLDownload(params *GetWebDLDownloadParams) (APIResponse[GetWebDLDownloadData], error)
func (APIClient) ListTorrents ¶
func (c APIClient) ListTorrents(params *ListTorrentsParams) (APIResponse[ListTorrentsData], error)
func (APIClient) ListUsenetDownload ¶
func (c APIClient) ListUsenetDownload(params *ListUsenetDownloadParams) (APIResponse[ListUsenetDownloadData], error)
func (APIClient) ListWebDLDownload ¶
func (c APIClient) ListWebDLDownload(params *ListWebDLDownloadParams) (APIResponse[ListWebDLDownloadData], error)
func (APIClient) RequestDownloadLink ¶
func (c APIClient) RequestDownloadLink(params *RequestDownloadLinkParams) (APIResponse[RequestDownloadLinkData], error)
func (APIClient) RequestSearch ¶
func (APIClient) RequestUsenetDownloadLink ¶
func (c APIClient) RequestUsenetDownloadLink(params *RequestUsenetDownloadLinkParams) (APIResponse[RequestDownloadLinkData], error)
func (APIClient) RequestWebDLDownloadLink ¶
func (c APIClient) RequestWebDLDownloadLink(params *RequestWebDLDownloadLinkParams) (APIResponse[RequestDownloadLinkData], error)
func (APIClient) SearchUsenetByID ¶
func (c APIClient) SearchUsenetByID(params *SearchUsenetByIDParams) (APIResponse[UsenetSearchByIDData], error)
type APIClientConfig ¶
type APIResponse ¶
type CheckTorrentsCachedData ¶
type CheckTorrentsCachedData []CheckTorrentsCachedDataItem
type CheckTorrentsCachedDataItem ¶
type CheckTorrentsCachedDataItem struct {
Name string `json:"name"`
Size int64 `json:"size"`
Hash string `json:"hash"`
Trackers []any `json:"trackers"`
Seeds int `json:"seeds"`
Peers int `json:"peers"`
Files []CheckTorrentsCachedDataItemFile `json:"files"`
}
func (CheckTorrentsCachedDataItem) GetName ¶
func (t CheckTorrentsCachedDataItem) GetName() string
type CheckTorrentsCachedDataItemFile ¶
type CheckTorrentsCachedDataItemFile struct {
Name string `json:"name"` // full path
Size int64 `json:"size"`
}
func (CheckTorrentsCachedDataItemFile) GetName ¶
func (f CheckTorrentsCachedDataItemFile) GetName() string
func (CheckTorrentsCachedDataItemFile) GetPath ¶
func (f CheckTorrentsCachedDataItemFile) GetPath() string
type CheckUsenetCachedData ¶
type CheckUsenetCachedData []CheckUsenetCachedDataItem
type CheckUsenetCachedDataItem ¶
type CheckUsenetCachedDataItem struct {
Name string `json:"name"`
Size int64 `json:"size"`
Hash string `json:"hash"`
Files []CheckUsenetCachedDataItemFile `json:"files,omitempty"`
}
type CheckUsenetCachedDataItemFile ¶
type CheckUsenetCachedDataItemFile struct {
Name string `json:"name"` // full path
Size int64 `json:"size"`
OpenSubtitlesHash string `json:"opensubtitles_hash"`
ShortName string `json:"short_name"`
MimeType string `json:"mimetype"`
}
func (CheckUsenetCachedDataItemFile) GetName ¶
func (f CheckUsenetCachedDataItemFile) GetName() string
func (CheckUsenetCachedDataItemFile) GetPath ¶
func (f CheckUsenetCachedDataItemFile) GetPath() string
type CheckUsenetCachedParams ¶
type CheckWebDLCachedData ¶
type CheckWebDLCachedData []CheckWebDLCachedDataItem
type CheckWebDLCachedParams ¶
type ControlTorrentData ¶
type ControlTorrentData struct {
}
type ControlTorrentOperation ¶
type ControlTorrentOperation string
const ( ControlTorrentOperationReannounce ControlTorrentOperation = "reannounce" ControlTorrentOperationDelete ControlTorrentOperation = "delete" ControlTorrentOperationResume ControlTorrentOperation = "resume" ControlTorrentOperationPause ControlTorrentOperation = "pause" )
type ControlTorrentParams ¶
type ControlTorrentParams struct {
Ctx
TorrentId int `json:"torrent_id"`
Operation ControlTorrentOperation `json:"operation"`
All bool `json:"all"`
}
type ControlUsenetDownloadData ¶
type ControlUsenetDownloadData struct {
}
type ControlUsenetDownloadOperation ¶
type ControlUsenetDownloadOperation string
const ( ControlUsenetDownloadOperationDelete ControlUsenetDownloadOperation = "delete" ControlUsenetDownloadOperationPause ControlUsenetDownloadOperation = "pause" ControlUsenetDownloadOperationResume ControlUsenetDownloadOperation = "resume" )
type ControlUsenetDownloadParams ¶
type ControlUsenetDownloadParams struct {
Ctx
UsenetId int `json:"usenet_id"`
Operation ControlUsenetDownloadOperation `json:"operation"`
All bool `json:"all"`
}
type ControlWebDLDownloadData ¶
type ControlWebDLDownloadData struct {
}
type ControlWebDLDownloadOperation ¶
type ControlWebDLDownloadOperation string
const (
ControlWebDLDownloadOperationDelete ControlWebDLDownloadOperation = "delete"
)
type ControlWebDLDownloadParams ¶
type ControlWebDLDownloadParams struct {
Ctx
WebDLId int `json:"webdl_id"`
Operation ControlWebDLDownloadOperation `json:"operation"`
All bool `json:"all"`
}
type CreateTorrentData ¶
type CreateTorrentParams ¶
type CreateTorrentParamsSeed ¶
type CreateTorrentParamsSeed int
const ( CreateTorrentParamsSeedAuto CreateTorrentParamsSeed = 1 CreateTorrentParamsSeedYes CreateTorrentParamsSeed = 2 CreateTorrentParamsSeedNo CreateTorrentParamsSeed = 3 )
type CreateUsenetDownloadParams ¶
type CreateUsenetDownloadParams struct {
Ctx
File *multipart.FileHeader
Link string
Name string
Password string
PostProcessing CreateUsenetDownloadParamsPostProcessing
AsQueued bool
}
type CreateUsenetDownloadParamsPostProcessing ¶
type CreateUsenetDownloadParamsPostProcessing int
const ( CreateUsenetDownloadParamsPostProcessingDefault CreateUsenetDownloadParamsPostProcessing = iota CreateUsenetDownloadParamsPostProcessingNone CreateUsenetDownloadParamsPostProcessingRepair CreateUsenetDownloadParamsPostProcessingRepairUnpack CreateUsenetDownloadParamsPostProcessingRepairUnpackDelete )
type CreateWebDLDownloadData ¶
type CreateWebDLDownloadParamsPostProcessing ¶
type CreateWebDLDownloadParamsPostProcessing int
const ( CreateWebDLDownloadParamsPostProcessingDefault CreateWebDLDownloadParamsPostProcessing = iota CreateWebDLDownloadParamsPostProcessingNone CreateWebDLDownloadParamsPostProcessingRepair CreateWebDLDownloadParamsPostProcessingRepairUnpack CreateWebDLDownloadParamsPostProcessingRepairUnpackDelete )
type ErrorCode ¶
type ErrorCode string
const ( ErrorCodeDatabaseError ErrorCode = "DATABASE_ERROR" ErrorCodeUnknownError ErrorCode = "UNKNOWN_ERROR" ErrorCodeNoAuth ErrorCode = "NO_AUTH" ErrorCodeBadToken ErrorCode = "BAD_TOKEN" ErrorCodeAuthError ErrorCode = "AUTH_ERROR" ErrorCodeInvalidOption ErrorCode = "INVALID_OPTION" ErrorCodeRedirectError ErrorCode = "REDIRECT_ERROR" ErrorCodeOAuthVerificationError ErrorCode = "OAUTH_VERIFICATION_ERROR" ErrorCodeEndpointNotFound ErrorCode = "ENDPOINT_NOT_FOUND" ErrorCodeItemNotFound ErrorCode = "ITEM_NOT_FOUND" ErrorCodePlanRestrictedFeature ErrorCode = "PLAN_RESTRICTED_FEATURE" ErrorCodeDuplicateItem ErrorCode = "DUPLICATE_ITEM" ErrorCodeBozoRssFeed ErrorCode = "BOZO_RSS_FEED" ErrorCodeSellixError ErrorCode = "SELLIX_ERROR" ErrorCodeTooMuchData ErrorCode = "TOO_MUCH_DATA" ErrorCodeDownloadTooLarge ErrorCode = "DOWNLOAD_TOO_LARGE" ErrorCodeMissingRequiredOption ErrorCode = "MISSING_REQUIRED_OPTION" ErrorCodeTooManyOptions ErrorCode = "TOO_MANY_OPTIONS" ErrorCodeBozoTorrent ErrorCode = "BOZO_TORRENT" ErrorCodeNoServersAvailableError ErrorCode = "NO_SERVERS_AVAILABLE_ERROR" ErrorCodeMonthlyLimit ErrorCode = "MONTHLY_LIMIT" ErrorCodeCooldownLimit ErrorCode = "COOLDOWN_LIMIT" ErrorCodeActiveLimit ErrorCode = "ACTIVE_LIMIT" ErrorCodeDownloadServerError ErrorCode = "DOWNLOAD_SERVER_ERROR" ErrorCodeBozoNzb ErrorCode = "BOZO_NZB" ErrorCodeSearchError ErrorCode = "SEARCH_ERROR" ErrorCodeInvalidDevice ErrorCode = "INVALID_DEVICE" ErrorCodeDiffIssue ErrorCode = "DIFF_ISSUE" ErrorCodeLinkOffline ErrorCode = "LINK_OFFLINE" ErrorCodeVendorDisabled ErrorCode = "VENDOR_DISABLED" )
type GetTorrentData ¶
type GetTorrentData = Torrent
type GetTorrentInfoData ¶
type GetTorrentInfoData = CheckTorrentsCachedDataItem
type GetTorrentInfoParams ¶
type GetTorrentParams ¶
type GetUsenetDownloadData ¶
type GetUsenetDownloadData = UsenetDownload
type GetUsenetDownloadParams ¶
type GetUserData ¶
type GetUserData struct {
Id int `json:"id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Email string `json:"email"`
Plan Plan `json:"plan"`
TotalDownloaded int `json:"total_downloaded"`
Customer string `json:"customer"`
Server int `json:"server"`
IsSubscribed bool `json:"is_subscribed"`
PremiumExpiresAt string `json:"premium_expires_at"`
CooldownUntil string `json:"cooldown_until"`
AuthId string `json:"auth_id"`
UserReferral string `json:"user_referral"`
BaseEmail string `json:"base_email"`
Settings *map[string]any `json:"settings,omitempty"`
}
type GetUserParams ¶
type GetWebDLDownloadData ¶
type GetWebDLDownloadData = WebDLDownload
type GetWebDLDownloadParams ¶
type ListTorrentsData ¶
type ListTorrentsData []Torrent
type ListTorrentsParams ¶
type ListUsenetDownloadData ¶
type ListUsenetDownloadData []UsenetDownload
type ListWebDLDownloadData ¶
type ListWebDLDownloadData []WebDLDownload
type ListWebDLDownloadParams ¶
type LockedFileLink ¶
type LockedFileLink string
func (LockedFileLink) Parse ¶
func (l LockedFileLink) Parse() (id, fileId int, err error)
type RequestDownloadLinkData ¶
type RequestDownloadLinkData struct {
Link string
}
type ResponseEnvelop ¶
type ResponseError ¶
type ResponseError struct {
Detail string `json:"detail"`
Err ErrorCode `json:"error"`
Data string `json:"data"`
}
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
type ResponseStatus ¶
type ResponseStatus string
const ( ResponseStatusSuccess ResponseStatus = "success" ResponseStatusError ResponseStatus = "error" )
type SearchUsenetByIDParams ¶
type StoreClient ¶
func NewStoreClient ¶
func NewStoreClient(config *StoreClientConfig) *StoreClient
func (*StoreClient) AddMagnet ¶
func (c *StoreClient) AddMagnet(params *store.AddMagnetParams) (*store.AddMagnetData, error)
func (*StoreClient) AddNewz ¶
func (c *StoreClient) AddNewz(params *store.AddNewzParams) (*store.AddNewzData, error)
func (*StoreClient) CheckMagnet ¶
func (c *StoreClient) CheckMagnet(params *store.CheckMagnetParams) (*store.CheckMagnetData, error)
func (*StoreClient) CheckNewz ¶
func (c *StoreClient) CheckNewz(params *store.CheckNewzParams) (*store.CheckNewzData, error)
func (*StoreClient) GenerateLink ¶
func (c *StoreClient) GenerateLink(params *store.GenerateLinkParams) (*store.GenerateLinkData, error)
func (*StoreClient) GenerateNewzLink ¶
func (c *StoreClient) GenerateNewzLink(params *store.GenerateNewzLinkParams) (*store.GenerateNewzLinkData, error)
func (*StoreClient) GetMagnet ¶
func (c *StoreClient) GetMagnet(params *store.GetMagnetParams) (*store.GetMagnetData, error)
func (*StoreClient) GetName ¶
func (c *StoreClient) GetName() store.StoreName
func (*StoreClient) GetNewz ¶
func (c *StoreClient) GetNewz(params *store.GetNewzParams) (*store.GetNewzData, error)
func (*StoreClient) GetUser ¶
func (c *StoreClient) GetUser(params *store.GetUserParams) (*store.User, error)
func (*StoreClient) ListMagnets ¶
func (c *StoreClient) ListMagnets(params *store.ListMagnetsParams) (*store.ListMagnetsData, error)
func (*StoreClient) ListNewz ¶
func (c *StoreClient) ListNewz(params *store.ListNewzParams) (*store.ListNewzData, error)
func (*StoreClient) RemoveMagnet ¶
func (c *StoreClient) RemoveMagnet(params *store.RemoveMagnetParams) (*store.RemoveMagnetData, error)
func (*StoreClient) RemoveNewz ¶
func (c *StoreClient) RemoveNewz(params *store.RemoveNewzParams) (*store.RemoveNewzData, error)
type StoreClientConfig ¶
type Torrent ¶
type Torrent struct {
Id int `json:"id"`
Hash string `json:"hash"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Magnet string `json:"magnet,omitempty"`
Size int64 `json:"size"`
Active bool `json:"active"`
AuthId string `json:"auth_id"`
DownloadState TorrentDownloadState `json:"download_state"`
Seeds int `json:"seeds"`
Peers int `json:"peers"`
Ratio float32 `json:"ratio"`
Progress float32 `json:"progress"`
DownloadSpeed int `json:"download_speed"`
UploadSpeed int `json:"upload_speed"`
Name string `json:"name"`
ETA int `json:"eta"`
Server int `json:"server"`
TorrentFile bool `json:"torrent_file"`
ExpiresAt string `json:"expires_at"`
DownloadPresent bool `json:"download_present"`
DownloadFinished bool `json:"download_finished"`
Files []TorrentFile `json:"files"`
InactiveCheck int `json:"inactive_check"`
Availability float32 `json:"availability"`
Owner string `json:"owner"`
Private bool `json:"private"`
}
func (Torrent) GetAddedAt ¶
type TorrentDownloadState ¶
type TorrentDownloadState string
const ( TorrentDownloadStateDownloading TorrentDownloadState = "downloading" // The torrent is currently downloading TorrentDownloadStateUploading TorrentDownloadState = "uploading" // The torrent is currently seeding TorrentDownloadStateStalled TorrentDownloadState = "stalled" // The torrent is trying to download, but there are no seeds connected to download from TorrentDownloadStatePaused TorrentDownloadState = "paused" // The torrent is paused TorrentDownloadStateCompleted TorrentDownloadState = "completed" // The torrent is completely downloaded. Do not use this for download completion status TorrentDownloadStateCached TorrentDownloadState = "cached" // The torrent is cached from the server TorrentDownloadStateMetaDL TorrentDownloadState = "metaDL" // The torrent is downloading metadata from the hoard TorrentDownloadStateCheckingResumeData TorrentDownloadState = "checkingResumeData" // The torrent is checking resumable data )
type TorrentFile ¶
type TorrentFile struct {
Id int `json:"id"`
MD5 string `json:"md5"`
Hash string `json:"hash"`
Name string `json:"name"`
Size int64 `json:"size"`
Zipped bool `json:"zipped"`
S3Path string `json:"s3_path"`
Infected bool `json:"infected"`
MimeType string `json:"mimetype"`
ShortName string `json:"short_name"`
AbsolutePath string `json:"absolute_path"`
OpensubtitlesHash string `json:"opensubtitles_hash"`
}
func (TorrentFile) GetName ¶
func (f TorrentFile) GetName() string
func (TorrentFile) GetPath ¶
func (f TorrentFile) GetPath() string
type UsenetDownload ¶
type UsenetDownload struct {
Id int `json:"id"`
Hash string `json:"hash"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Size int64 `json:"size"`
Active bool `json:"active"`
AuthId string `json:"auth_id"`
DownloadState UsenetDownloadState `json:"download_state"`
Progress float32 `json:"progress"`
DownloadSpeed int `json:"download_speed"`
UploadSpeed int `json:"upload_speed"`
Name string `json:"name"`
ETA int `json:"eta"`
Server int `json:"server"`
TorrentFile bool `json:"torrent_file"`
ExpiresAt string `json:"expires_at"`
DownloadPresent bool `json:"download_present"`
DownloadFinished bool `json:"download_finished"`
Files []UsenetDownloadFile `json:"files"`
InactiveCheck int `json:"inactive_check"`
Availability float32 `json:"availability"`
OriginalUrl string `json:"original_url"` // None
DownloadId string `json:"download_id"`
Cached bool `json:"cached"`
CachedAt string `json:"cached_at"`
}
func (UsenetDownload) GetAddedAt ¶
func (und UsenetDownload) GetAddedAt() time.Time
type UsenetDownloadFile ¶
type UsenetDownloadFile struct {
Id int `json:"id"`
MD5 string `json:"md5"`
Hash string `json:"hash"`
Name string `json:"name"`
Size int64 `json:"size"`
Zipped bool `json:"zipped"`
S3Path string `json:"s3_path"`
Infected bool `json:"infected"`
MimeType string `json:"mimetype"`
ShortName string `json:"short_name"`
AbsolutePath string `json:"absolute_path"`
OpensubtitlesHash string `json:"opensubtitles_hash"`
}
func (UsenetDownloadFile) GetName ¶
func (f UsenetDownloadFile) GetName() string
func (UsenetDownloadFile) GetPath ¶
func (f UsenetDownloadFile) GetPath() string
type UsenetDownloadState ¶
type UsenetDownloadState = TorrentDownloadState
type UsenetSearchByIDData ¶
type UsenetSearchByIDData struct {
Metadata *UsenetSearchByIDDataMetadata `json:"metadata,omitempty"`
NZBs []UsenetSearchByIDDataNZB `json:"nzbs"`
TimeTaken float32 `json:"time_taken"`
Cache bool `json:"cache"`
TotalNZBs int `json:"total_nzbs"`
}
type UsenetSearchByIDDataMetadata ¶
type UsenetSearchByIDDataMetadata struct {
GlobalID string `json:"globalID"`
ID string `json:"id"`
IMDBID string `json:"imdb_id"`
TMDBID string `json:"tmdb_id"`
TVDBID string `json:"tvdb_id"`
TVMazeID string `json:"tvmaze_id"`
TraktID string `json:"trakt_id"`
MALID string `json:"mal_id"`
AniListID string `json:"anilist_id"`
KitsuID string `json:"kitsu_id"`
SimklID string `json:"simkl_id"`
Title string `json:"title"`
Titles []string `json:"titles"`
TitlesFull []struct {
Language string `json:"language"` // EN
Title string `json:"title"`
} `json:"titles_full"`
TranslatedTitles []any `json:"translated_titles"`
Link any `json:"link"`
Description string `json:"description"`
Genres []string `json:"genres"`
MediaType string `json:"mediaType"` // movie
Rating float32 `json:"rating"`
Popularity int `json:"popularity"`
Languages []string `json:"languages"`
ContentRating string `json:"contentRating"`
Actors []any `json:"actors"`
Trailer any `json:"trailer"`
Characters []any `json:"characters"`
Image string `json:"image"`
IsAdult bool `json:"isAdult"`
Type string `json:"type"` // movie
ReleasedDate string `json:"releasedDate"`
SeasonsNumber int `json:"seasonsNumber"`
EpisodesNumber int `json:"episodesNumber"`
Runtime string `json:"runtime"` // 2h 7m
ReleaseYears int `json:"releaseYears"`
Keywords []string `json:"keywords"`
Backdrop string `json:"backdrop"`
}
type UsenetSearchByIDDataNZB ¶
type UsenetSearchByIDDataNZB struct {
Hash string `json:"hash"`
AlternativeHashes []string `json:"alternative_hashes"`
RawTitle string `json:"raw_title"`
Title string `json:"title"`
// TitleParsedData struct {
// Resolution string `json:"resolution"`
// Year int `json:"year"`
// Codec string `json:"codec"`
// Audio string `json:"audio"`
// Remux bool `json:"remux"`
// Title string `json:"title"`
// Excess string `json:"excess"` // or []string
// Encoder string `json:"encoder"`
// Language string `json:"language"`
// Site string `json:"site"`
// HDR bool `json:"hdr"`
// } `json:"title_parsed_data"`
Size int64 `json:"size"`
Tracker string `json:"tracker"`
Categories []int `json:"categories"`
Files int `json:"files"`
NZB string `json:"nzb"`
Age string `json:"age"`
Type string `json:"type"` // "usenet"
UserSearch bool `json:"user_search"`
Cached bool `json:"cached"`
Owned bool `json:"owned"`
}
type WebDLDownload ¶
type WebDLDownload struct {
Active bool `json:"active"`
AuthId string `json:"auth_id"`
Availability float32 `json:"availability"`
Cached bool `json:"cached"`
CachedAt string `json:"cached_at"`
CreatedAt string `json:"created_at"`
DownloadFinished bool `json:"download_finished"`
DownloadPresent bool `json:"download_present"`
DownloadSpeed int `json:"download_speed"`
DownloadState WebDLDownloadState `json:"download_state"`
ETA int `json:"eta"`
ExpiresAt string `json:"expires_at"`
Files []WebDLDownloadFile `json:"files"`
Hash string `json:"hash"`
Id int `json:"id"`
InactiveCheck int `json:"inactive_check"`
Name string `json:"name"`
OriginalUrl string `json:"original_url"` // None
Progress float32 `json:"progress"`
Server int `json:"server"`
Size int64 `json:"size"`
TorrentFile bool `json:"torrent_file"`
UpdatedAt string `json:"updated_at"`
UploadSpeed int `json:"upload_speed"`
}
func (WebDLDownload) GetAddedAt ¶
func (und WebDLDownload) GetAddedAt() time.Time
type WebDLDownloadFile ¶
type WebDLDownloadFile struct {
AbsolutePath string `json:"absolute_path"`
Hash string `json:"hash"`
Id int `json:"id"`
Infected bool `json:"infected"`
MD5 string `json:"md5"` // null
MimeType string `json:"mimetype"`
Name string `json:"name"`
S3Path string `json:"s3_path"`
ShortName string `json:"short_name"`
Size int64 `json:"size"`
Zipped bool `json:"zipped"`
}
type WebDLDownloadState ¶
type WebDLDownloadState = TorrentDownloadState // decrypting
Click to show internal directories.
Click to hide internal directories.