2024-07-01 17:22:31 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
type ResponseData interface {
|
|
|
|
ViewResponseData | PlayerResponseData
|
|
|
|
}
|
|
|
|
|
|
|
|
type Response[T ResponseData] struct {
|
|
|
|
Code int `json:"code"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
Ttl int `json:"ttl"`
|
|
|
|
Data T `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ViewResponseData struct {
|
|
|
|
Bvid string `json:"bvid"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Duration int `json:"duration"`
|
|
|
|
Stat struct {
|
|
|
|
Aid int `json:"aid"`
|
|
|
|
} `json:"stat"`
|
|
|
|
Pages []struct {
|
|
|
|
Cid int `json:"cid"`
|
|
|
|
Page int `json:"page"`
|
|
|
|
From string `json:"from"`
|
|
|
|
Part string `json:"part"`
|
|
|
|
Duration int `json:"duration"`
|
|
|
|
Vid string `json:"vid"`
|
|
|
|
Weblink string `json:"weblink"`
|
|
|
|
} `json:"pages"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type PlayerResponseData struct {
|
|
|
|
Aid int `json:"aid"`
|
|
|
|
Bvid string `json:"bvid"`
|
|
|
|
Cid int `json:"cid"`
|
|
|
|
PageNo int `json:"page_no"`
|
|
|
|
Subtitle struct {
|
|
|
|
Subtitles []struct {
|
|
|
|
Id int64 `json:"id"`
|
|
|
|
Lan string `json:"lan"`
|
|
|
|
LanDoc string `json:"lan_doc"`
|
|
|
|
IsLock bool `json:"is_lock"`
|
|
|
|
SubtitleUrl string `json:"subtitle_url"`
|
|
|
|
Type int `json:"type"`
|
|
|
|
IdStr string `json:"id_str"`
|
|
|
|
AiType int `json:"ai_type"`
|
|
|
|
AiStatus int `json:"ai_status"`
|
|
|
|
} `json:"subtitles"`
|
|
|
|
} `json:"subtitle"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SubtitlesResponse struct {
|
|
|
|
Body []struct {
|
2024-07-01 19:54:58 +08:00
|
|
|
Content string `json:"content"`
|
2024-07-01 17:22:31 +08:00
|
|
|
} `json:"body"`
|
|
|
|
}
|