Documentation ¶
Index ¶
- type AskDownloadTaskReply
- type AskFindSubReply
- type AskFindSubReq
- type AskForDownloadReply
- type AskForDownloadReq
- type AskForUploadReply
- type AskForUploadReq
- type CodeReplyData
- type CodeReqData
- type DownloadInfo
- type DownloadSubReply
- type DownloadSubReq
- type FeedReply
- type FeedReq
- type FindSubReply
- type FindSubReq
- type IdConvertReply
- type IdConvertReq
- type MediaInfoReply
- type MediaInfoReq
- type Subtitle
- type SubtitleBestApi
- func (s *SubtitleBestApi) AskDownloadSub(SubSha256, DownloadToken, ApiKey string) (*AskForDownloadReply, error)
- func (s *SubtitleBestApi) AskDownloadTask(id string) (*AskDownloadTaskReply, error)
- func (s *SubtitleBestApi) AskFindSub(VideoFeature, ImdbId, TmdbId, Season, Episode, FindSubToken, ApiKey string) (*AskFindSubReply, error)
- func (s *SubtitleBestApi) AskFroUpload(subSha256 string, IsMovie, trusted bool, ImdbId, TmdbId string, ...) (*AskForUploadReply, error)
- func (s *SubtitleBestApi) CheckAlive() error
- func (s *SubtitleBestApi) ConvertId(id, source, videoType string) (*IdConvertReply, error)
- func (s *SubtitleBestApi) DownloadSub(SubSha256, DownloadToken, ApiKey, downloadFileDesFPath string) (*DownloadSubReply, error)
- func (s *SubtitleBestApi) FeedBack(id, version, MediaServer string, EnableShare, EnableApiKey bool) (*FeedReply, error)
- func (s *SubtitleBestApi) FindSub(VideoFeature, ImdbId, TmdbId, Season, Episode, FindSubToken, ApiKey string) (*FindSubReply, error)
- func (s *SubtitleBestApi) GetCode() (string, error)
- func (s *SubtitleBestApi) GetMediaInfo(id, source, videoType string) (*MediaInfoReply, error)
- func (s *SubtitleBestApi) UploadLowTrustSub(lowTrustVideoSubInfo *models.LowVideoSubInfo, subSaveRootDirPath string, ...) (*UploadSubReply, error)
- func (s *SubtitleBestApi) UploadSub(videoSubInfo *models.VideoSubInfo, subSaveRootDirPath string, ...) (*UploadSubReply, error)
- type UploadSubReply
- type UploadSubReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AskDownloadTaskReply ¶
type AskDownloadTaskReply struct { Status int `json:"status"` // 0 失败,1 有任务,2 没有任务 Message string `json:"message"` // 返回的信息,包括成功和失败的原因 DownloadInfo DownloadInfo `json:"download_info,optional"` // 下载信息 }
type AskFindSubReply ¶
type AskFindSubReq ¶
type AskFindSubReq struct { VideoFeature string `form:"video_feature"` // VideoFeature ID ImdbId string `form:"imdb_id"` // IMDB ID TmdbId string `form:"tmdb_id"` // TMDB ID,这里是这个剧集的 TMDB ID 不是这一集的哈 Season int `form:"season"` // 如果对应的是电影则可能是 0,没有 Episode int `form:"episode"` // 如果对应的是电影则可能是 0,没有 FindSubToken string `form:"find_sub_token"` // 查询令牌,由 Client 生成的 8 位随机字符,不包含特殊字符即可 ApiKey string `form:"api_key,optional"` // API Key,非必须,可能是某些用户才有的权限 }
type AskForDownloadReply ¶
type AskForDownloadReq ¶
type AskForUploadReply ¶
type AskForUploadReq ¶
type AskForUploadReq struct { SubSha256 string `json:"sub_sha256"` Trusted bool `json:"trusted,optional"` // 是否是信任的字幕 ImdbId string `form:"imdb_id,optional"` // IMDB ID TmdbId string `form:"tmdb_id,optional"` // TMDB ID,这里是这个剧集的 TMDB ID 不是这一集的哈 Season int `form:"season,optional"` // 如果对应的是电影则可能是 0,没有 Episode int `form:"episode,optional"` // 如果对应的是电影则可能是 0,没有 }
type CodeReplyData ¶
type CodeReqData ¶
type CodeReqData struct {
NowTime string `json:"now_time"`
}
type DownloadInfo ¶
type DownloadInfo struct { TaskID string `json:"task_id"` // 任务id VideoFeature string `json:"video_feature"` // VideoFeature ID ImdbId string `json:"imdb_id"` // IMDB ID TmdbId string `json:"tmdb_id"` // TMDB ID,这里是这个剧集的 TMDB ID 不是这一集的哈 Season int `json:"season"` // 如果对应的是电影则可能是 0,没有 Episode int `json:"episode"` // 如果对应的是电影则可能是 0,没有 IsMovie bool `json:"is_movie"` // 是否是电影,如果是电影则 season 和 episode 可能是 0,没有 }
type DownloadSubReply ¶
type DownloadSubReq ¶
type FindSubReply ¶
type FindSubReq ¶
type FindSubReq struct { VideoFeature string `form:"video_feature"` // VideoFeature ID ImdbId string `form:"imdb_id"` // IMDB ID TmdbId string `form:"tmdb_id"` // TMDB ID,这里是这个剧集的 TMDB ID 不是这一集的哈 Season int `form:"season"` // 如果对应的是电影则可能是 0,没有 Episode int `form:"episode"` // 如果对应的是电影则可能是 0,没有 FindSubToken string `form:"find_sub_token"` // 查询令牌,由 Client 生成的 8 位随机字符,不包含特殊字符即可 ApiKey string `form:"api_key,optional"` // API Key,非必须,可能是某些用户才有的权限 }
type IdConvertReply ¶
type IdConvertReq ¶
type MediaInfoReply ¶
type MediaInfoReply struct { Status int `json:"status"` // 0 失败,1 成功,2 在队列中等待查询 Message string `json:"message"` TMDBId string `json:"tmdb_id,omitempty"` OriginalTitle string `json:"original_title,omitempty"` OriginalLanguage string `json:"original_language,omitempty"` TitleEN string `json:"title_en,omitempty"` TitleCN string `json:"title_cn,omitempty"` Year string `json:"year,omitempty"` }
{ "status": 1, "message": "", "tmdb_id": "503235", "original_title": "邪不压正", "original_language": "zh", "title_en": "Hidden Man", "title_cn": "邪不压正", "year": "2018-07-13" }
{ "status": 1, "message": "", "tmdb_id": "78154", "original_title": "L'amica geniale", "original_language": "it", "title_en": "My Brilliant Friend", "title_cn": "我的天才女友", "year": "2018-11-18" }
type MediaInfoReq ¶
type MediaInfoReq struct { Id string `json:"id"` Source string `json:"source"` // options=imdb|tmdb VideoType string `json:"video_type"` // ,options=movie|series }
{ "id": "tt7278862", "source": "imdb", "video_type": "series" }
{ "id": "503235", "source": "tmdb", "video_type": "movie" }
type Subtitle ¶
type Subtitle struct { SubSha256 string `json:"sub_sha256"` // 文件的 SHA256 IsDouble bool `json:"is_double"` // 是否是双语,基础是中文 MyLanguage string `json:"my_language"` // 这个是本程序定义的语言类型,见 my_language.go 文件 LowTrust bool `json:"low_trust"` // 是否是低信任的 ExtraPreName string `json:"extra_pre_name,optional"` //字幕额外的命名信息,指 Emby 字幕命名格式(简英,subhd),的 subhd MatchVideoFeature bool `json:"match_video_feature"` // 是否匹配到 VideoFeature Ext string `json:"ext"` // 字幕的后缀名 }
type SubtitleBestApi ¶
type SubtitleBestApi struct {
// contains filtered or unexported fields
}
func NewSubtitleBestApi ¶
func NewSubtitleBestApi(log *logrus.Logger, inAuthKey random_auth_key.AuthKey) *SubtitleBestApi
func (*SubtitleBestApi) AskDownloadSub ¶
func (s *SubtitleBestApi) AskDownloadSub(SubSha256, DownloadToken, ApiKey string) (*AskForDownloadReply, error)
func (*SubtitleBestApi) AskDownloadTask ¶
func (s *SubtitleBestApi) AskDownloadTask(id string) (*AskDownloadTaskReply, error)
func (*SubtitleBestApi) AskFindSub ¶
func (s *SubtitleBestApi) AskFindSub(VideoFeature, ImdbId, TmdbId, Season, Episode, FindSubToken, ApiKey string) (*AskFindSubReply, error)
func (*SubtitleBestApi) AskFroUpload ¶
func (s *SubtitleBestApi) AskFroUpload(subSha256 string, IsMovie, trusted bool, ImdbId, TmdbId string, Season, Episode int, VideoFeature string) (*AskForUploadReply, error)
AskFroUpload 在使用这个接口前,需要从 IMDB ID 获取到 TMDB ID
func (*SubtitleBestApi) CheckAlive ¶
func (s *SubtitleBestApi) CheckAlive() error
func (*SubtitleBestApi) ConvertId ¶
func (s *SubtitleBestApi) ConvertId(id, source, videoType string) (*IdConvertReply, error)
ConvertId 目前仅仅支持 TMDB ID 转 IMDB ID
func (*SubtitleBestApi) DownloadSub ¶
func (s *SubtitleBestApi) DownloadSub(SubSha256, DownloadToken, ApiKey, downloadFileDesFPath string) (*DownloadSubReply, error)
DownloadSub 首先要确认 downloadFileDesFPath 这个文件是否存在,如果存在且跟需要下载的文件的 sha256 一样就要跳过,然后下载完毕后,也需要 check 这个文件是否存在,存在则需要判断是否是字幕
func (*SubtitleBestApi) FeedBack ¶
func (s *SubtitleBestApi) FeedBack(id, version, MediaServer string, EnableShare, EnableApiKey bool) (*FeedReply, error)
func (*SubtitleBestApi) FindSub ¶
func (s *SubtitleBestApi) FindSub(VideoFeature, ImdbId, TmdbId, Season, Episode, FindSubToken, ApiKey string) (*FindSubReply, error)
func (*SubtitleBestApi) GetCode ¶
func (s *SubtitleBestApi) GetCode() (string, error)
func (*SubtitleBestApi) GetMediaInfo ¶
func (s *SubtitleBestApi) GetMediaInfo(id, source, videoType string) (*MediaInfoReply, error)
func (*SubtitleBestApi) UploadLowTrustSub ¶
func (s *SubtitleBestApi) UploadLowTrustSub(lowTrustVideoSubInfo *models.LowVideoSubInfo, subSaveRootDirPath string, tmdbId, year, taskID string) (*UploadSubReply, error)
func (*SubtitleBestApi) UploadSub ¶
func (s *SubtitleBestApi) UploadSub(videoSubInfo *models.VideoSubInfo, subSaveRootDirPath string, tmdbId, year string) (*UploadSubReply, error)
UploadSub 在使用这个接口前,需要从 IMDB ID 获取到 TMDB ID,其实在这一步应该默认就拿到了 TMDB ID,需要提前在 AskFroUpload 接口调用前就搞定这个 year 这个也是从之前的接口拿到, 2019 or 2022
type UploadSubReply ¶
type UploadSubReq ¶
type UploadSubReq struct { SubSha256 string `json:"sub_sha256"` // 文件的 SHA256 Season int `json:"season"` // 如果对应的是电影则可能是 0,没有 Episode int `json:"episode"` // 如果对应的是电影则可能是 0,没有 IsDouble bool `json:"is_double"` // 是否是双语,基础是中文 LanguageISO string `json:"language_iso"` // 字幕的语言,目标语言,就算是双语,中英,也应该是中文。ISO_639-1_codes 标准,见 ISOLanguage.go 文件,这里无法区分简体繁体 MyLanguage string `json:"my_language"` // 这个是本程序定义的语言类型,见 my_language.go 文件 ExtraPreName string `json:"extra_pre_name"` // 字幕额外的命名信息,指 Emby 字幕命名格式(简英,subhd),的 subhd ImdbId string `json:"imdb_id"` // IMDB ID TmdbId string `json:"tmdb_id"` // TMDB ID,这里是这个剧集的 TMDB ID 不是这一集的哈 VideoFeature string `json:"video_feature"` // VideoFeature ID Year int `json:"year"` // 年份,比如 2019、2022 }
Click to show internal directories.
Click to hide internal directories.