Documentation
¶
Index ¶
- Variables
- func Authorize() error
- func DoDownload(id string) (*os.File, string, string, error)
- func GetAvailableHeader() http.Header
- func GetHeader() http.Header
- func Hash(r io.ReaderAt, size int64) (string, error)
- func HashFile(file *os.File) (string, error)
- type Attributes
- type DownloadErrorResponse
- type DownloadResponse
- type FeatureDetails
- type File
- type LoginPayload
- type LoginResponse
- type RelatedLinks
- type SearchPayload
- type SearchResponse
- type SearchResponseData
- type Uploader
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoUser = errors.New("no OpenSubtitles username provided") ErrNoPass = errors.New("no OpenSubtitles password provided") )
Functions ¶
func GetAvailableHeader ¶ added in v0.1.102
Types ¶
type Attributes ¶
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"`
Ratings float64 `json:"ratings"`
FromTrusted bool `json:"from_trusted"`
ForeignPartsOnly bool `json:"foreign_parts_only"`
UploadDate time.Time `json:"upload_date"`
AiTranslated bool `json:"ai_translated"`
NbCd int `json:"nb_cd"`
MachineTranslated bool `json:"machine_translated"`
MovieHashMatch bool `json:"moviehash_match"`
Release string `json:"release"`
Comments string `json:"comments"`
LegacySubtitleID int `json:"legacy_subtitle_id"`
LegacyUploaderID int `json:"legacy_uploader_id"`
Uploader Uploader `json:"uploader"`
FeatureDetails FeatureDetails `json:"feature_details"`
URL string `json:"url"`
RelatedLinks []RelatedLinks `json:"related_links"`
Files []File `json:"files"`
}
type DownloadErrorResponse ¶ added in v0.1.102
type DownloadResponse ¶
type DownloadResponse struct {
Link string `json:"link"`
FileName string `json:"file_name"`
Requests int `json:"requests"`
Remaining int `json:"remaining"`
Message string `json:"message"`
ResetTime string `json:"reset_time"`
ResetTimeUtc time.Time `json:"reset_time_utc"`
Uk string `json:"uk"`
UID int `json:"uid"`
TS int `json:"ts"`
}
func DownloadSubtitles ¶
func DownloadSubtitles(id string) (resp DownloadResponse, err error)
type FeatureDetails ¶
type LoginPayload ¶
type LoginResponse ¶
type RelatedLinks ¶
type SearchPayload ¶
type SearchResponse ¶
type SearchResponse struct {
TotalPages int `json:"total_pages"`
TotalCount int `json:"total_count"`
PerPage int `json:"per_page"`
Page int `json:"page"`
Data []SearchResponseData `json:"data"`
}
type SearchResponseData ¶
type SearchResponseData struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes Attributes `json:"attributes"`
}
func DoSearch ¶
func DoSearch(payloads []SearchPayload, preferredLanguage string) ([]SearchResponseData, error)
func SearchSubtitles ¶
func SearchSubtitles(payloads []SearchPayload) (results []SearchResponseData, err error)
Click to show internal directories.
Click to hide internal directories.