Documentation ¶
Index ¶
- Constants
- func RegisterOSDBClientFlags(f []cli.Flag) []cli.Flag
- type Client
- func (s *Client) DownloadSubtitle(ctx context.Context, id int, format string) (d []byte, err error)
- func (s *Client) SearchSubtitles(ctx context.Context, u string) (subs []Subtitle, err error)
- func (s *Client) SearchSubtitlesByHash(ctx context.Context, hash string) (subs []Subtitle, err error)
- func (s *Client) SearchSubtitlesByIMDB(ctx context.Context, id string) (subs []Subtitle, err error)
- type LoginRequest
- type LoginResponse
- type Subtitle
- type SubtitleDownloadRequest
- type SubtitleDownloadResponse
- type SubtitleSearchResponse
Constants ¶
View Source
const ( OsdbApiKeyFlag = "osdb-api-key" OsdbApiUserAgentFlag = "osdb-api-user-agent" OsdbApiURLFlag = "osdb-api-url" OsdbUser = "osdb-user" OsdbPass = "osdb-pass" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DownloadSubtitle ¶
func (*Client) SearchSubtitles ¶
func (*Client) SearchSubtitlesByHash ¶
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct { User struct { AllowedDownloads int `json:"allowed_downloads"` AllowedTranslations int `json:"allowed_translations"` Level string `json:"level"` UserId int `json:"user_id"` ExtInstalled bool `json:"ext_installed"` Vip bool `json:"vip"` } `json:"user"` BaseUrl string `json:"base_url"` Token string `json:"token"` Status int `json:"status"` }
type Subtitle ¶
type Subtitle struct { Id string `json:"id"` Type string `json:"type"` Attributes struct { SubtitleId string `json:"subtitle_id"` Language string `json:"language"` DownloadCount int `json:"download_count"` NewDownloadCount int `json:"new_download_count"` HearingImpaired bool `json:"hearing_impaired"` Hd bool `json:"hd"` Fps float64 `json:"fps"` Votes int `json:"votes"` Points int `json:"points"` Ratings float64 `json:"ratings"` FromTrusted bool `json:"from_trusted"` ForeignPartsOnly bool `json:"foreign_parts_only"` AiTranslated bool `json:"ai_translated"` MachineTranslated bool `json:"machine_translated"` UploadDate time.Time `json:"upload_date"` Release string `json:"release"` Comments string `json:"comments"` LegacySubtitleId int `json:"legacy_subtitle_id"` Uploader struct { UploaderId int `json:"uploader_id"` Name string `json:"name"` Rank string `json:"rank"` } `json:"uploader"` FeatureDetails struct { FeatureId int `json:"feature_id"` FeatureType string `json:"feature_type"` Year int `json:"year"` Title string `json:"title"` MovieName string `json:"movie_name"` ImdbId int `json:"imdb_id"` TmdbId int `json:"tmdb_id"` } `json:"feature_details"` Url string `json:"url"` RelatedLinks []struct { Label string `json:"label"` Url string `json:"url"` ImgUrl string `json:"img_url"` } `json:"related_links"` Files []struct { FileId int `json:"file_id"` CdNumber int `json:"cd_number"` FileName string `json:"file_name"` } `json:"files"` } `json:"attributes"` }
type SubtitleDownloadRequest ¶
Click to show internal directories.
Click to hide internal directories.