torbox

package
v0.0.0-...-aba3ae9 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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 TranslateErrorCode(errorCode ErrorCode) core.ErrorCode

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 (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 (APIClient) ControlWebDLDownload

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 (APIClient) CreateWebDLDownload

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 (APIClient) ListWebDLDownload

func (c APIClient) ListWebDLDownload(params *ListWebDLDownloadParams) (APIResponse[ListWebDLDownloadData], error)

func (APIClient) Request

func (c APIClient) Request(method, path string, params request.Context, v ResponseEnvelop) (*http.Response, error)

func (APIClient) RequestSearch

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 (APIClient) SearchUsenetByID

func (c APIClient) SearchUsenetByID(params *SearchUsenetByIDParams) (APIResponse[UsenetSearchByIDData], error)

type APIClientConfig

type APIClientConfig struct {
	BaseURL    string // default: https://api.torbox.app
	APIKey     string
	HTTPClient *http.Client
	UserAgent  string
}

type APIResponse

type APIResponse[T any] struct {
	Header     http.Header
	StatusCode int
	Data       T
	Detail     string
}

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 (CheckTorrentsCachedDataItemFile) GetPath

type CheckTorrentsCachedParams

type CheckTorrentsCachedParams struct {
	Ctx
	Hashes    []string `json:"hashes"`
	ListFiles bool     `json:"-"`
}

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 (CheckUsenetCachedDataItemFile) GetPath

type CheckUsenetCachedParams

type CheckUsenetCachedParams struct {
	Ctx
	Hashes    []string `json:"hashes"`
	ListFiles bool     `json:"-"`
}

type CheckWebDLCachedData

type CheckWebDLCachedData []CheckWebDLCachedDataItem

type CheckWebDLCachedDataItem

type CheckWebDLCachedDataItem struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
	Hash string `json:"hash"`
}

type CheckWebDLCachedParams

type CheckWebDLCachedParams struct {
	Ctx
	Hashes []string
}

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 CreateTorrentData struct {
	TorrentId int    `json:"torrent_id"`
	Hash      string `json:"hash"`
	AuthId    string `json:"auth_id"`
}

type CreateTorrentParams

type CreateTorrentParams struct {
	Ctx
	File     *multipart.FileHeader
	Magnet   string
	Seed     int
	AllowZip bool
	Name     string
}

type CreateTorrentParamsSeed

type CreateTorrentParamsSeed int
const (
	CreateTorrentParamsSeedAuto CreateTorrentParamsSeed = 1
	CreateTorrentParamsSeedYes  CreateTorrentParamsSeed = 2
	CreateTorrentParamsSeedNo   CreateTorrentParamsSeed = 3
)

type CreateUsenetDownloadData

type CreateUsenetDownloadData struct {
	UsenetDownloadId int    `json:"usenetdownload_id"`
	Hash             string `json:"hash"`
	AuthId           string `json:"auth_id"`
}

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 CreateWebDLDownloadData struct {
	UsenetDownloadId int    `json:"webdownload_id"`
	Hash             string `json:"hash"`
	AuthId           string `json:"auth_id"`
}

type CreateWebDLDownloadParams

type CreateWebDLDownloadParams struct {
	Ctx
	Link     string
	Name     string
	Password string
	AsQueued bool
}

type CreateWebDLDownloadParamsPostProcessing

type CreateWebDLDownloadParamsPostProcessing int
const (
	CreateWebDLDownloadParamsPostProcessingDefault CreateWebDLDownloadParamsPostProcessing = iota
	CreateWebDLDownloadParamsPostProcessingNone
	CreateWebDLDownloadParamsPostProcessingRepair
	CreateWebDLDownloadParamsPostProcessingRepairUnpack
	CreateWebDLDownloadParamsPostProcessingRepairUnpackDelete
)

type Ctx

type Ctx = request.Ctx

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 GetTorrentInfoParams struct {
	Ctx
	Hash    string
	Timeout int // default: 10
}

type GetTorrentParams

type GetTorrentParams struct {
	Ctx
	Id          int
	BypassCache bool
}

type GetUsenetDownloadData

type GetUsenetDownloadData = UsenetDownload

type GetUsenetDownloadParams

type GetUsenetDownloadParams struct {
	Ctx
	Id          int
	BypassCache bool
}

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 GetUserParams struct {
	Ctx
	Settings bool // Allows you to retrieve user settings.
}

type GetWebDLDownloadData

type GetWebDLDownloadData = WebDLDownload

type GetWebDLDownloadParams

type GetWebDLDownloadParams struct {
	Ctx
	Id          int
	BypassCache bool
}

type ListTorrentsData

type ListTorrentsData []Torrent

type ListTorrentsParams

type ListTorrentsParams struct {
	Ctx
	BypassCache bool
	Offset      int // default: 0
	Limit       int // default: 1000
}

type ListUsenetDownloadData

type ListUsenetDownloadData []UsenetDownload

type ListUsenetDownloadParams

type ListUsenetDownloadParams struct {
	Ctx
	BypassCache bool
	Offset      int // default: 0
	Limit       int // default: 1000
}

type ListWebDLDownloadData

type ListWebDLDownloadData []WebDLDownload

type ListWebDLDownloadParams

type ListWebDLDownloadParams struct {
	Ctx
	BypassCache bool
	Offset      int // default: 0
	Limit       int // default: 1000
}
type LockedFileLink string

func (LockedFileLink) Create

func (l LockedFileLink) Create(id int, fileId int) string

func (LockedFileLink) Parse

func (l LockedFileLink) Parse() (id, fileId int, err error)

type Plan

type Plan int

type RequestDownloadLinkData

type RequestDownloadLinkData struct {
	Link string
}

type RequestDownloadLinkParams

type RequestDownloadLinkParams struct {
	Ctx
	TorrentId int
	FileId    int
	ZipLink   bool
	UserIP    string
}

type RequestUsenetDownloadLinkParams

type RequestUsenetDownloadLinkParams struct {
	Ctx
	UsenetId int
	FileId   int
	ZipLink  bool
	UserIP   string
}

type RequestWebDLDownloadLinkParams

type RequestWebDLDownloadLinkParams struct {
	Ctx
	WebDLId int
	FileId  int
	ZipLink bool
	UserIP  string
}

type Response

type Response[T any] struct {
	// contains filtered or unexported fields
}

func (Response[any]) GetError

func (r Response[any]) GetError(res *http.Response) error

func (Response[any]) IsSuccess

func (r Response[any]) IsSuccess() bool

func (*Response[T]) Unmarshal

func (r *Response[T]) Unmarshal(res *http.Response, body []byte, v any) error

type ResponseEnvelop

type ResponseEnvelop interface {
	GetError(res *http.Response) error
	Unmarshal(res *http.Response, body []byte, v any) error
}

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 SearchUsenetByIDParams struct {
	Ctx
	Metadata          bool
	Season            int
	Episode           int
	CheckCache        bool
	CheckOwned        bool
	SearchUserEngines bool
	IDType            string // imdb
	ID                string
}

type StoreClient

type StoreClient struct {
	Name store.StoreName
	// contains filtered or unexported fields
}

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 (c *StoreClient) GenerateLink(params *store.GenerateLinkParams) (*store.GenerateLinkData, error)
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 StoreClientConfig struct {
	HTTPClient *http.Client
	UserAgent  string
}

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

func (t Torrent) GetAddedAt() time.Time

func (Torrent) GetName

func (t Torrent) GetName() string

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

Jump to

Keyboard shortcuts

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