Documentation
¶
Index ¶
- Constants
- type AIData
- type ArcCMS
- type ArcType
- type Audit
- type AuditOp
- type Card
- type Channel
- type Cont
- type Content
- type CornerMark
- type EP
- type EpAuth
- type EpCMS
- type EpDecor
- type Episode
- type EpisodeV2
- type FavMList
- type Follow
- type FormFav
- type FormFavAct
- type HTTPData
- type Homepage
- type Hotword
- type IDList
- type IdxData
- type IdxPager
- type IdxSeason
- type List
- type MediaParam
- type MediaResp
- type MediaRespV2
- type ModCard
- type Module
- type NewEP
- type NewEPV2
- type NewestEP
- type ParamStyle
- type Paster
- type Patch
- type PgcNewEP
- type PgcResponse
- type PlayURLReq
- type PlayURLResp
- type PointActivity
- type Publish
- type Rank
- type Rating
- type Recom
- type Region
- type ReqApply
- type ReqFav
- type ReqFavAct
- type ReqHomeFollow
- type ReqModData
- type ReqPageFollow
- type ReqTransode
- type ReqZone
- type ReqZoneInterv
- type ResFollow
- type RespAI
- type RespFavAct
- type RespModInterv
- type Response
- type ResponseRecom
- type ResultRecom
- type ReviewV2
- type Rights
- type Season
- type SeasonCMS
- type SeasonCard
- type SeasonDetail
- type SeasonV2
- type Section
- type SimpleRank
- type SnAuth
- type SnDetailCore
- type SnDetailV2
- type SnVipCorner
- type Sponsor
- type Stat
- type StatV2
- type TVEpSeason
- type Tag
- type Up
- type UserSeason
- type UserStatus
- type UserStatusV2
- type VerUpdate
- type VideoCMS
- type WatchProgress
Constants ¶
const ( // content type PgcSn = "7" PgcEp = "8" UgcArc = "9" UgcVideo = "10" )
audit related consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIData ¶
type AIData struct { AID int `json:"aid"` MID int `json:"mid"` Pts int `json:"pts"` Play int `json:"play"` Coints int `json:"coins"` VideoReview int `json:"video_review"` }
AIData is the ai card structure
type ArcCMS ¶
type ArcCMS struct { Title string AID int64 Content string Cover string TypeID int Pubtime time.Time Videos int Valid int Deleted int Result int }
ArcCMS reprensents the archive data structure in MC
type Audit ¶
type Audit struct { IDList []*IDList `json:"id_list"` OpType string `json:"optype"` Count int `json:"count"` AuditMsg string `json:"audit_msg"` }
Audit def.
type AuditOp ¶
type AuditOp struct { KID int64 // aid/cid/sid/epid Result int // pgc sn: `check`, pgc ep: state, ugc: result Valid int AuditMsg string ContentType string // type }
AuditOp def.
type Card ¶
type Card struct { SeasonID int `json:"season_id"` Title string `json:"title"` Cover string `json:"cover"` Type int `json:"type"` // 1=pgc, 2=ugc NewEP *NewEP `json:"new_ep"` CornerMark *SnVipCorner `json:"cornermark"` }
Card is the unit to display
type Channel ¶
type Channel struct { ID int Title string Desc string Splash string Deleted int Ctime time.Time Mtime time.Time }
Channel defines the structure of the channel & splash data
type Content ¶
type Content struct { ID int64 Title string Subtitle string Desc string Cover string SeasonID int CID int EPID int MenuID int State int Valid int AuditTime int PayStatus int IsDeleted int Ctime time.Time Mtime time.Time InjectTime time.Time Reason string }
Content content def.
type CornerMark ¶
CornerMark def.
type EP ¶
type EP struct { AVID string `json:"av_id"` Coins string `json:"coins"` Cover string `json:"cover"` Danmaku string `json:"danmaku"` EpisodeID string `json:"episode_id"` Index string `json:"index"` IndexTitle string `json:"index_title"` IsWebplay string `json:"is_webplay"` Page string `json:"page"` Up *Up `json:"up"` UpdateTime string `json:"update_time"` WebplayURL string `json:"webplay_url"` }
EP is the newest EP info
type EpAuth ¶
type EpAuth struct { ID int64 `json:"id"` EPID int64 `json:"epid"` SeasonID int64 `json:"season_id"` State int `json:"state"` Valid int `json:"valid"` IsDeleted int `json:"is_deleted"` NoMark int `json:"no_mark"` }
EpAuth is the structure of ep in mc
type EpCMS ¶
type EpCMS struct { EPID int64 `json:"epid"` Cover string `json:"cover"` Title string `json:"title"` Subtitle string `json:"subtitle"` PayStatus int `json:"pay_status"` }
EpCMS defines the elements could be changed from TV CMS side
type Episode ¶
type Episode struct { AID int `json:"aid"` CID int `json:"cid"` Cover string `json:"cover"` EPID int64 `json:"ep_id"` EpisodeStatus int `json:"episode_status"` From string `json:"from"` Index string `json:"index"` IndexTitle string `json:"index_title"` MID int `json:"mid"` Page int `json:"page"` VID string `json:"vid"` WaterMark bool `json:"hidemark"` // true means in the whitelist }
Episode def
type EpisodeV2 ¶
type EpisodeV2 struct { AID int64 `json:"aid"` Badge string `json:"badge"` BadgeType int `json:"badge_type"` CID int64 `json:"cid"` Cover string `json:"cover"` From string `json:"from"` ID int64 `json:"id"` LongTitle string `json:"long_title"` Status int `json:"status"` Title string `json:"title"` VID string `json:"vid"` WaterMark bool `json:"hidemark"` // true means in the whitelist CornerMark *CornerMark `json:"cornermark"` }
EpisodeV2 def.
type FavMList ¶
type FavMList struct { Page struct { Num int `json:"num"` Size int `json:"size"` Count int `json:"count"` } `json:"page"` List []*arcwar.Arc `json:"list"` }
FavMList def.
type Follow ¶
type Follow struct { Actor []string `json:"actor"` Alias string `json:"alias"` AllowBP string `json:"allow_bp"` AllowDownload string `json:"allow_download"` Area string `json:"area"` AreaLimit int `json:"arealimit"` BangumiID string `json:"bangumi_id"` BangumiTitle string `json:"bangumi_title"` Brief string `json:"brief"` Coins string `json:"coins"` Copyright string `json:"copyright"` Cover string `json:"cover"` DanmakuCount string `json:"danmaku_count"` Episodes []string `json:"episodes"` EDJump int `json:"ed_jump"` Evaluate string `json:"evaluate"` Favorites string `json:"favorites"` IsFinish string `json:"is_finish"` Progress string `json:"progress"` NewEP *EP `json:"new_ep"` NewestEPID string `json:"newest_ep_id"` NewestEPIndex string `json:"newest_ep_index"` PlayCount string `json:"play_count"` PubTime string `json:"pub_time"` RelatedSeasons []string `json:"related_seasons"` SeasonID string `json:"season_id"` SeasonTitle string `json:"season_title"` Seasons []string `json:"seasons"` SPID string `json:"spid"` SquareCover string `json:"squareCover"` Staff string `json:"staff"` Tag2s []string `json:"tag2s"` Tags []*Tag `json:"tags"` Title string `json:"title"` TotalCount string `json:"total_count"` UserSeason *UserSeason `json:"user_season"` Weekday string `json:"weekday"` CornerMark *SnVipCorner `json:"cornermark"` }
Follow is the main structure of the followed season
type FormFav ¶
type FormFav struct { AccessKey string `form:"access_key" validate:"required"` Pn int `form:"pn" default:"1"` }
FormFav is the form validation for favorites display
type FormFavAct ¶
type FormFavAct struct { AccessKey string `form:"access_key" validate:"required"` AID int64 `form:"aid" validate:"required"` Action int `form:"action" validate:"min=1,max=2"` }
FormFavAct is the form validation for favorite action
type HTTPData ¶
type HTTPData struct { Ver string `json:"ver"` Build int `json:"build"` Info string `json:"info"` Size string `json:"size"` URL string `json:"url"` Hash string `json:"hash"` Policy int `json:"policy"` IsForce int `json:"is_force"` IsPush int `json:"is_push"` IsGray int `json:"is_gray"` Mtime int `json:"mtime"` Patch *Patch `json:"patch"` }
HTTPData response
type Homepage ¶
type Homepage struct { Recom []*Card `json:"recom"` Latest []*Card `json:"latest"` Lists map[string][]*Card `json:"lists"` Follow []*Follow `json:"follow,omitempty"` }
Homepage is the home page struct
type IDList ¶
type IDList struct { Type string `json:"type"` VID string `json:"vid"` Action string `json:"action"` AuditMsg string `json:"audit_msg"` }
IDList def.
type IdxPager ¶
type IdxPager struct { CurrentPage int `json:"current_page"` TotalItems int `json:"total_items"` TotalPages int `json:"total_pages"` PageSize int `json:"page_size"` }
IdxPager is the pager struct to return in zone index page
type IdxSeason ¶
type IdxSeason struct { SeasonID int64 `json:"season_id"` Title string `json:"title"` Cover string `json:"cover"` Upinfo string `json:"upinfo"` }
IdxSeason is the struct of season in zone index page
type MediaParam ¶
type MediaParam struct { SeasonID int64 `form:"season_id"` EpID int64 `form:"ep_id"` TrackPath string `form:"track_path" validate:"required"` AccessKey string `form:"access_key"` MobiAPP string `form:"mobi_app" validate:"required"` Platform string `form:"platform"` Build int64 `form:"build"` }
MediaParam def.
func (*MediaParam) GenerateUrl ¶
func (v *MediaParam) GenerateUrl() (params url.Values)
GenerateUrl generates url.Values from tv media param struct
type MediaResp ¶
type MediaResp struct { Response Result *SeasonDetail `json:"result"` }
MediaResp is the structure of PGC display api response
type MediaRespV2 ¶
type MediaRespV2 struct { Response Result *SnDetailV2 `json:"result"` }
MediaRespV2 is the structure of PGC display api response
type ModCard ¶
type ModCard struct { Card LastEPIndex string `json:"last_ep_index"` NewestEPIndex string `json:"newest_ep_index"` TotalCount string `json:"total_count"` IsFinish string `json:"is_finish"` }
ModCard structure, based on normal Card, 4 more fields for Follow Module
type Module ¶
type Module struct { ID int `json:"id"` PageID int `json:"page_id"` Type int `json:"type"` Title string `json:"title"` Icon string `json:"icon"` Source int `json:"source"` Flexible int `json:"flexible"` Capacity int `json:"capacity"` More int `json:"more"` MoreType int `json:"more_type"` MoreNewPage int `json:"more_new_page"` MorePage int `json:"more_page"` Order int `json:"order"` Data []*ModCard `json:"data"` SrcType int `json:"src_type"` }
Module def.
func (*Module) JumpNewIdx ¶
JumpNewIdx tells whether this modules jumps to the new idx page
func (*Module) MoreTreat ¶
func (m *Module) MoreTreat()
MoreTreat treats the morepage and moretype related, used for zone/modpages, not homepage
func (*Module) OnHomepage ¶
OnHomepage tells whether the module is on the homepage
type NewEP ¶
type NewEP struct { ID int64 `json:"id"` Index string `json:"index"` IndexShow string `json:"index_show"` Cover string `json:"cover"` }
NewEP is the latest EP of a season
type NewEPV2 ¶
type NewEPV2 struct { Desc string `json:"desc"` ID int64 `json:"id"` IsNew int `json:"is_new"` Title string `json:"title"` }
NewEPV2 def.
type NewestEP ¶
type NewestEP struct { Desc string `json:"desc"` ID int `json:"id"` Index string `json:"index"` IsNew int `jsontt:"is_new"` }
NewestEP def
type ParamStyle ¶
ParamStyle .
type Paster ¶
type Paster struct { AID int `json:"aid"` CID int `json:"cid"` AllowJump int `json:"allow_jump"` Duration int `json:"duration"` Type int `json:"type"` URL string `json:"url"` }
Paster def
type Patch ¶
type Patch struct { NewID string `json:"new_id"` OldID string `json:"old_id"` URL string `json:"url"` Md5 string `json:"md5"` Size int `json:"size"` }
Patch fix
type PgcNewEP ¶
type PgcNewEP struct { ID int `json:"id"` IndexShow string `json:"index_show"` Cover string `json:"cover"` }
PgcNewEP is the result from pgc return pgc new ep value
type PgcResponse ¶
type PgcResponse struct { Code int `json:"code"` Message string `json:"message"` Result map[string]*SeasonCard `json:"result"` }
PgcResponse is the result structure from PGC API
type PlayURLReq ¶
type PlayURLReq struct { Platform string `form:"platform" validate:"required"` Device string `form:"device"` Expire string `form:"expire"` Cid string `form:"cid" validate:"required"` Avid int64 `form:"avid" validate:"required"` Build string `form:"build"` Qn string `form:"qn"` Mid string `form:"mid"` Npcybs string `form:"npcybs"` Buvid string `form:"buvid"` TrackPath string `form:"track_path"` AccessKey string `form:"access_key"` }
PlayURLReq is used for getting ugc play url param from app
type PlayURLResp ¶
type PlayURLResp struct { Code int `json:"code"` Result string `json:"result"` Message string `json:"message"` From string `json:"from"` Quality int `json:"quality"` Format string `json:"format"` Timelength int `json:"timelength"` AcceptFormat string `json:"accept_format"` AcceptDescription []string `json:"accept_description"` AcceptQuality []int `json:"accept_quality"` AcceptWatermark []bool `json:"accept_watermark"` VideoCodecid int `json:"video_codecid"` VideoProject bool `json:"video_project"` SeekParam string `json:"seek_param"` SeekType string `json:"seek_type"` Durl []struct { Order int `json:"order"` Length int `json:"length"` Size int `json:"size"` Ahead string `json:"ahead"` Vhead string `json:"vhead"` URL string `json:"url"` } `json:"durl"` }
PlayURLResp is used for return ugc play url result
type PointActivity ¶
type PointActivity struct { Content string `json:"content"` Link string `json:"link"` Tip string `json:"tip"` }
PointActivity def
type Publish ¶
type Publish struct { IsFinish int `json:"is_finish"` IsStarted int `json:"is_started"` PubTime string `json:"pub_time"` PubTimeShow string `json:"pub_time_show"` Weekday int `json:"weekday"` }
Publish def
type Rank ¶
type Rank struct { ID int64 Rank int Title string Type int8 CID int64 ContID int64 Category int8 Position int32 IsDeleted int8 Ctime time.Time Mtime time.Time }
Rank represents the table TV_RANK
type Recom ¶
type Recom struct { Cover string `json:"cover"` FollowCount int `json:"follow_count"` IsFinish int `json:"is_finish"` IsStarted int `json:"is_started"` NewestEPCover string `json:"newest_ep_cover"` NewestEPIndex string `json:"newest_ep_index"` SeasonID int64 `json:"season_id"` SeasonStatus int `json:"season_status"` SeasonType int `json:"season_type"` SeasonTypeName string `json:"season_type_name"` Title string `json:"title"` TotalCount int `json:"total_count"` CornerMark *SnVipCorner `json:"cornermark"` }
Recom def.
type Region ¶
type Region struct { PageID int `json:"id"` Title string `json:"name"` IndexTid int `json:"index_tid"` IndexType int `json:"index_type"` }
Region .
type ReqApply ¶
type ReqApply struct { CID int64 `form:"cid" validate:"required"` ApplyTime int64 `form:"apply_time" validate:"required"` }
ReqApply is request for apply time storage
type ReqFavAct ¶
type ReqFavAct struct { MID int64 AID int64 // resource id ( ugc avid ) Action int // 1=add,2=delete }
ReqFavAct is request for favorites action ( add/del ) function
type ReqHomeFollow ¶
ReqHomeFollow is the request body to HomeFollow function
type ReqModData ¶
ReqModData is the request body to modData function
type ReqPageFollow ¶
type ReqPageFollow struct { AccessKey string `form:"access_key"` PageID int `form:"page_id" validate:"min=0"` Build int `form:"build"` }
ReqPageFollow is the request body to PageFollow function
type ReqTransode ¶
type ReqTransode struct { ContType string `form:"cont_type" validate:"required"` // content type: pgc/ugc CID int64 `form:"cid" validate:"required"` Action int64 `form:"action" validate:"min=0,max=2"` // 1 = finished, others = failed }
ReqTransode is the request structure for the transcode api
type ReqZone ¶
type ReqZone struct { SType int IntervType int LengthLimit int IntervM int PGCListM map[int][]*Card }
ReqZone is the request struct of zone page
type ReqZoneInterv ¶
ReqZoneInterv is the request structure for zone intervention
type ResFollow ¶
type ResFollow struct { Code int `json:"code"` Count string `json:"count"` Pages string `json:"pages"` Message string `json:"message"` Result []*Follow `json:"result"` }
ResFollow is the result structure from PGC API
type RespAI ¶
type RespAI struct { Note string `json:"note"` SourceData string `json:"source_data"` Code int `json:"code"` Num int `json:"num"` List []*AIData `json:"list"` }
RespAI is the response of AI ugc rank data
type RespFavAct ¶
RespFavAct is response strure for favorite actions
type RespModInterv ¶
type RespModInterv struct { Ranks []*SimpleRank AIDs []int64 SIDs []int64 }
RespModInterv is the response struct for mod intervention
type ResponseRecom ¶
type ResponseRecom struct { Code int `json:"code"` Message string `json:"message"` Result *ResultRecom `json:"result"` }
ResponseRecom is the result structure from PGC API
type ResultRecom ¶
type ResultRecom struct { SeasonID int `json:"season_id"` From int `json:"from"` Title string `json:"title"` List []*Recom `json:"list"` }
ResultRecom def.
type Rights ¶
type Rights struct { AllowBp int `json:"allow_bp"` AllowDownload int `json:"allow_download"` AllowReview int `json:"allow_review"` AreaLimit int `json:"area_limit"` BanAreaShow int `json:"ban_area_show"` Copyright string `json:"copyright"` IsPreview int `json:"is_preview"` }
Rights def
type SeasonCMS ¶
type SeasonCMS struct { SeasonID int64 Cover string Desc string Title string UpInfo string Category int8 // - cn, jp, movie, tv, documentary Area string // - cn, jp, others Playtime time.Time Role string Staff string NewestOrder int // the newest passed ep's order NewestEPID int64 // the newest passed ep's ID NewestNb int // the newest ep's number ( after keyword filter ) TotalNum int Style string OriginName string Alias string PayStatus int }
SeasonCMS defines the elements could be changed from TV CMS side
type SeasonCard ¶
type SeasonCard struct {
NewEP *PgcNewEP `json:"new_ep"`
}
SeasonCard is the result structure from PGC API
type SeasonDetail ¶
type SeasonDetail struct { Episodes []*Episode `json:"episodes"` IsNewDanmaku int `json:"is_new_danmaku"` NewestEP *NewestEP `json:"newest_ep"` Stat *Stat `json:"stat"` UserStatus *UserStatus `json:"user_status"` Sponsor *Sponsor `json:"sponsor"` SeriesID int `json:"series_id"` SnDetailCore }
SeasonDetail def
type SeasonV2 ¶
type SeasonV2 struct { IsNew int `json:"is_new"` SeasonID int `json:"season_id"` SeasonTitle string `json:"season_title"` }
SeasonV2 def
type SimpleRank ¶
SimpleRank picks the necessary fields from tv_rank
func (SimpleRank) IsUGC ¶
func (c SimpleRank) IsUGC() bool
IsUGC returns whether the card is ugc card
type SnAuth ¶
type SnAuth struct { ID int64 `json:"id"` IsDeleted int8 `json:"is_deleted"` Valid int `json:"valid"` Check int8 `json:"check"` }
SnAuth is the structure of season in mc
type SnDetailCore ¶
type SnDetailCore struct { Cover string `json:"cover"` Evaluate string `json:"evaluate"` Link string `json:"link"` MediaID int `json:"media_id"` Mode int `json:"mode"` Paster *Paster `json:"paster"` Publish *Publish `json:"publish"` Rating *Rating `json:"rating"` SeasonID int64 `json:"season_id"` SeasonStatus int `json:"season_status"` SeasonTitle string `json:"season_title"` SeasonType int `json:"season_type"` SquareCover string `json:"square_cover"` Title string `json:"title"` TotalEp int `json:"total_ep"` Rights *Rights `json:"rights"` StyleLabel []*ParamStyle `json:"style_label"` }
SnDetailCore is the common part of pgc media v1 and v2
type SnDetailV2 ¶
type SnDetailV2 struct { Episodes []*EpisodeV2 `json:"episodes"` NewestEP *NewEPV2 `json:"new_ep"` Stat *StatV2 `json:"stat"` UserStatus *UserStatusV2 `json:"user_status"` Seasons []*SeasonV2 `json:"seasons"` Section []*Section `json:"section"` Type int `json:"type"` SnDetailCore }
SnDetailV2 def
type SnVipCorner ¶
SnVipCorner def.
type Sponsor ¶
type Sponsor struct { List []*List `json:"list"` PointActivity *PointActivity `json:"point_activity"` TotalBpCount int `json:"total_bp_count"` WeekBpCount int `json:"week_bp_count"` }
Sponsor def
type Stat ¶
type Stat struct { Danmakus int `json:"danmakus"` Favorites int `json:"favorites"` Views int `json:"views"` }
Stat def
type TVEpSeason ¶
type TVEpSeason struct { ID int64 OriginName string Title string Alias string Category int8 Desc string Style string Area string PlayTime time.Time Info int8 State int8 Check int8 TotalNum int32 Upinfo string Staff string Role string Copyright string Cover string AuditTime int IsDeleted int8 Ctime time.Time Mtime time.Time Valid int8 InjectTime time.Time Reason string }
TVEpSeason represents the season table
type Tag ¶
type Tag struct { Bottoms string `json:"bottoms"` Cover string `json:"cover"` Index string `json:"index"` OrderType string `json:"orderType"` Seasons []string `json:"seasons"` StyleID string `json:"style_id"` TagID string `json:"tag_id"` TagName string `json:"tag_name"` Tops string `json:"tops"` Type string `json:"type"` }
Tag is the tag info
type UserSeason ¶
type UserSeason struct { Attention string `json:"attention"` LastEPID string `json:"last_ep_id"` LastEPIndex string `json:"last_ep_index"` LastTime string `json:"last_time"` }
UserSeason is the user's season info
type UserStatus ¶
type UserStatus struct { Follow int `json:"follow"` IsVip int `json:"is_vip"` Pay int `json:"pay"` PayPackPaid int `json:"pay_pack_paid"` Sponsor int `json:"sponsor"` WatchProgress *WatchProgress `json:"watch_progress"` }
UserStatus def
type UserStatusV2 ¶
type UserStatusV2 struct { Follow int `json:"follow"` Pay int `json:"pay"` Progress *WatchProgress `json:"watch_progress"` Review *ReviewV2 `json:"review"` Sponsor int `json:"sponsor"` }
UserStatusV2 def.
type VerUpdate ¶
type VerUpdate struct { MobiApp string Build int Channel string Seed int Sdkint int Model string OldID string }
VerUpdate Params
type VideoCMS ¶
type VideoCMS struct { // Media Info CID int64 Title string AID int64 IndexOrder int // Auth Info Valid int Deleted int Result int }
VideoCMS def.
func (*VideoCMS) Auditing ¶
Auditing returns whether the video is begin audited by the license owner
type WatchProgress ¶
type WatchProgress struct { LastEpID int `json:"last_ep_id"` LastEPIndex string `json:"last_ep_index"` LastTime int64 `json:"last_time"` }
WatchProgress def.