creativecenter

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package creativecenter contains parameters and stable response models for Bilibili's authenticated creator-center read APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive struct {
	AID         int64  `json:"aid"`
	BVID        string `json:"bvid"`
	Title       string `json:"title"`
	Cover       string `json:"cover"`
	Duration    int64  `json:"duration"`
	Description string `json:"desc"`
}

type ArchiveAudit

type ArchiveAudit struct {
	Archive  *Archive        `json:"Archive"`
	Videos   json.RawMessage `json:"Videos"`
	Stat     ArchiveStat     `json:"stat"`
	State    int64           `json:"state_panel"`
	TypeName *string         `json:"typename"`
}

type ArchiveCompare

type ArchiveCompare struct {
	List []ArchiveCompareItem `json:"list"`
}

type ArchiveCompareItem

type ArchiveCompareItem struct {
	AID         int64           `json:"aid"`
	BVID        string          `json:"bvid"`
	Cover       string          `json:"cover"`
	Title       string          `json:"title"`
	PublishedAt int64           `json:"pubtime"`
	Duration    int64           `json:"duration"`
	Stat        json.RawMessage `json:"stat"`
	HourStat    json.RawMessage `json:"hour_stat"`
}

ArchiveCompareStat is intentionally retained as raw JSON: the upstream diagnose schema contains dozens of experimental, frequently changing rates.

type ArchiveCompareParams

type ArchiveCompareParams struct {
	// contains filtered or unexported fields
}

func NewArchiveCompareParams

func NewArchiveCompareParams() ArchiveCompareParams

func (ArchiveCompareParams) EncodeQuery

func (p ArchiveCompareParams) EncodeQuery() (url.Values, error)

func (ArchiveCompareParams) WithSize

func (ArchiveCompareParams) WithTimestamp

func (p ArchiveCompareParams) WithTimestamp(timestamp uint64) (ArchiveCompareParams, error)

type ArchiveStat

type ArchiveStat struct {
	AID         int64 `json:"aid"`
	View        int64 `json:"view"`
	Danmaku     int64 `json:"danmaku"`
	Reply       int64 `json:"reply"`
	Favorite    int64 `json:"favorite"`
	Coin        int64 `json:"coin"`
	Share       int64 `json:"share"`
	NowRank     int64 `json:"now_rank"`
	HistoryRank int64 `json:"his_rank"`
	Like        int64 `json:"like"`
	Dislike     int64 `json:"dislike"`
	VT          int64 `json:"vt"`
	VV          int64 `json:"vv"`
}

type ArchiveVideos

type ArchiveVideos struct {
	Archive Archive     `json:"archive"`
	Videos  []VideoPart `json:"videos"`
}

type ArchiveVideosParams

type ArchiveVideosParams struct {
	// contains filtered or unexported fields
}

func NewArchiveVideosParams

func NewArchiveVideosParams(aid ids.AID) ArchiveVideosParams

func (ArchiveVideosParams) EncodeQuery

func (p ArchiveVideosParams) EncodeQuery() (url.Values, error)

type ArchivesList

type ArchivesList struct {
	Archives []ArchiveAudit `json:"arc_audits"`
	Page     Page           `json:"page"`
	PlayType int64          `json:"play_type"`
}

type ArchivesListParams

type ArchivesListParams struct {
	// contains filtered or unexported fields
}

func NewArchivesListParams

func NewArchivesListParams(page, pageSize uint32) (ArchivesListParams, error)

func (ArchivesListParams) EncodeQuery

func (p ArchivesListParams) EncodeQuery() (url.Values, error)

type ArticleStat

type ArticleStat struct {
	View              int64 `json:"view"`
	Reply             int64 `json:"reply"`
	Like              int64 `json:"like"`
	Coin              int64 `json:"coin"`
	Favorite          int64 `json:"fav"`
	Share             int64 `json:"share"`
	IncrementView     int64 `json:"incr_view"`
	IncrementReply    int64 `json:"incr_reply"`
	IncrementLike     int64 `json:"incr_like"`
	IncrementCoin     int64 `json:"incr_coin"`
	IncrementFavorite int64 `json:"incr_fav"`
	IncrementShare    int64 `json:"incr_share"`
}

type ArticleTrendMetric

type ArticleTrendMetric uint8
const (
	ArticleTrendRead ArticleTrendMetric = iota + 1
	ArticleTrendReply
	ArticleTrendShare
	ArticleTrendCoin
	ArticleTrendFavorite
	ArticleTrendLike
)

type ArticleTrendParams

type ArticleTrendParams struct {
	// contains filtered or unexported fields
}

func NewArticleTrendParams

func NewArticleTrendParams(metric ArticleTrendMetric) ArticleTrendParams

func (ArticleTrendParams) EncodeQuery

func (p ArticleTrendParams) EncodeQuery() (url.Values, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides creator-center operations.

func NewClient

func NewClient(client *core.Client) Client

NewClient binds the creativecenter module to a shared client.

func (Client) ArchiveCompare

func (c Client) ArchiveCompare(ctx context.Context, params ArchiveCompareParams) (ArchiveCompare, error)

func (Client) ArchiveVideos

func (c Client) ArchiveVideos(ctx context.Context, params ArchiveVideosParams) (ArchiveVideos, error)

func (Client) ArchivesList

func (c Client) ArchivesList(ctx context.Context, params ArchivesListParams) (ArchivesList, error)

func (Client) ArticleStat

func (c Client) ArticleStat(ctx context.Context) (ArticleStat, error)

func (Client) ArticleTrend

func (c Client) ArticleTrend(ctx context.Context, params ArticleTrendParams) ([]Trend, error)

func (Client) ElectromagneticInfo

func (c Client) ElectromagneticInfo(ctx context.Context) (ElectromagneticInfo, error)

func (Client) PlaySource

func (c Client) PlaySource(ctx context.Context) (*PlaySource, error)

func (Client) SeasonByAID

func (c Client) SeasonByAID(ctx context.Context, params SeasonByAIDParams) (Season, error)

func (Client) SeasonInfo

func (c Client) SeasonInfo(ctx context.Context, params SeasonInfoParams) (SeasonInfo, error)

func (Client) SeasonList

func (c Client) SeasonList(ctx context.Context, params SeasonListParams) (SeasonList, error)

func (Client) SeasonSection

func (c Client) SeasonSection(ctx context.Context, params SectionParams) (SectionEpisodes, error)

func (Client) UpStat

func (c Client) UpStat(ctx context.Context) (UpStat, error)

func (Client) VideoTrend

func (c Client) VideoTrend(ctx context.Context, params VideoTrendParams) ([]Trend, error)

func (Client) ViewerData

func (c Client) ViewerData(ctx context.Context) (ViewerData, error)

type ElectromagneticInfo

type ElectromagneticInfo struct {
	MID       uint64 `json:"mid"`
	Level     uint32 `json:"level"`
	Score     uint32 `json:"score"`
	Credit    uint32 `json:"credit"`
	State     int32  `json:"state"`
	UpdatedAt uint64 `json:"update_date"`
}

type Episode

type Episode struct {
	ID           uint64  `json:"id"`
	Title        string  `json:"title"`
	AID          uint64  `json:"aid"`
	BVID         string  `json:"bvid"`
	CID          uint64  `json:"cid"`
	SeasonID     uint64  `json:"seasonId"`
	SectionID    uint64  `json:"sectionId"`
	Order        uint32  `json:"order"`
	VideoTitle   *string `json:"videoTitle"`
	ArchiveTitle *string `json:"archiveTitle"`
	ArchiveState int32   `json:"archiveState"`
	RejectReason *string `json:"rejectReason"`
	State        int32   `json:"state"`
	Cover        string  `json:"cover"`
	Free         uint32  `json:"is_free"`
	AIDOwner     bool    `json:"aid_owner"`
	ChargingPay  uint32  `json:"charging_pay"`
}

type Page

type Page struct {
	Page     int64 `json:"pn"`
	PageSize int64 `json:"ps"`
	Count    int64 `json:"count"`
}

type PlaySource

type PlaySource struct {
	PageSource struct {
		Dynamic, Other, Search, Space, Tenma int64
		RelatedVideo                         int64 `json:"related_video"`
	} `json:"page_source"`
	Proportion struct{ Android, H5, IOS, Out, PC int64 } `json:"play_proportion"`
}

type Season

type Season struct {
	ID           uint64  `json:"id"`
	Title        string  `json:"title"`
	Description  string  `json:"desc"`
	Cover        string  `json:"cover"`
	Ended        uint32  `json:"isEnd"`
	MID          uint64  `json:"mid"`
	Activity     uint32  `json:"isAct"`
	Paid         uint32  `json:"is_pay"`
	State        int32   `json:"state"`
	PartState    uint32  `json:"partState"`
	SignState    uint32  `json:"signState"`
	RejectReason *string `json:"rejectReason"`
	CreatedAt    uint64  `json:"ctime"`
	ModifiedAt   uint64  `json:"mtime"`
	NoSection    uint32  `json:"no_section"`
	Forbidden    uint32  `json:"forbid"`
	ProtocolID   *string `json:"protocol_id"`
	EpisodeCount uint32  `json:"ep_num"`
	Price        uint32  `json:"season_price"`
	Opened       uint32  `json:"is_opened"`
	ChargingPay  uint32  `json:"has_charging_pay"`
	PUGVPay      *uint32 `json:"has_pugv_pay"`
	SeasonUpFrom *uint32 `json:"SeasonUpfrom"`
}

type SeasonByAIDParams

type SeasonByAIDParams struct {
	// contains filtered or unexported fields
}

func NewSeasonByAIDParams

func NewSeasonByAIDParams(aid ids.AID) SeasonByAIDParams

func (SeasonByAIDParams) EncodeQuery

func (p SeasonByAIDParams) EncodeQuery() (url.Values, error)

type SeasonInfo

type SeasonInfo struct {
	Season       Season          `json:"season"`
	Course       json.RawMessage `json:"course"`
	CheckIn      json.RawMessage `json:"checkin"`
	Stat         json.RawMessage `json:"seasonStat"`
	Sections     Sections        `json:"sections"`
	PartEpisodes json.RawMessage `json:"part_episodes"`
}

type SeasonInfoParams

type SeasonInfoParams struct {
	// contains filtered or unexported fields
}

func NewSeasonInfoParams

func NewSeasonInfoParams(seasonID ids.SeasonID) SeasonInfoParams

func (SeasonInfoParams) EncodeQuery

func (p SeasonInfoParams) EncodeQuery() (url.Values, error)

type SeasonItem

type SeasonItem struct {
	Season       Season          `json:"season"`
	CheckIn      json.RawMessage `json:"checkin"`
	Stat         *SeasonStat     `json:"seasonStat"`
	Sections     *Sections       `json:"sections"`
	PartEpisodes []Episode       `json:"part_episodes"`
}

type SeasonList

type SeasonList struct {
	Seasons  []SeasonItem    `json:"seasons"`
	Tip      json.RawMessage `json:"tip"`
	Total    uint32          `json:"total"`
	PlayType uint32          `json:"play_type"`
}

type SeasonListOrder

type SeasonListOrder string
const (
	SeasonOrderCreated SeasonListOrder = "ctime"
	SeasonOrderUpdated SeasonListOrder = "mtime"
)

type SeasonListParams

type SeasonListParams struct {
	// contains filtered or unexported fields
}

func NewSeasonListParams

func NewSeasonListParams(page, pageSize uint32) (SeasonListParams, error)

func (SeasonListParams) EncodeQuery

func (p SeasonListParams) EncodeQuery() (url.Values, error)

func (SeasonListParams) WithOrder

func (SeasonListParams) WithSort

func (p SeasonListParams) WithSort(sort SortOrder) SeasonListParams

type SeasonStat

type SeasonStat struct {
	View         uint64 `json:"view"`
	Danmaku      uint64 `json:"danmaku"`
	Reply        uint64 `json:"reply"`
	Favorite     uint64 `json:"fav"`
	Coin         uint64 `json:"coin"`
	Share        uint64 `json:"share"`
	Like         uint64 `json:"like"`
	Subscription uint64 `json:"subscription"`
	NowRank      uint32 `json:"nowRank"`
	HistoryRank  uint32 `json:"hisRank"`
}

type Section

type Section struct {
	ID           uint64          `json:"id"`
	Type         uint32          `json:"type"`
	SeasonID     uint64          `json:"seasonId"`
	Title        string          `json:"title"`
	Order        uint32          `json:"order"`
	State        int32           `json:"state"`
	PartState    int32           `json:"partState"`
	CreatedAt    int64           `json:"ctime"`
	ModifiedAt   int64           `json:"mtime"`
	EpisodeCount int64           `json:"epCount"`
	Cover        string          `json:"cover"`
	Episodes     json.RawMessage `json:"Episodes"`
}

type SectionEpisodes

type SectionEpisodes struct {
	Section  Section   `json:"section"`
	Episodes []Episode `json:"episodes"`
}

type SectionParams

type SectionParams struct {
	// contains filtered or unexported fields
}

func NewSectionParams

func NewSectionParams(seasonID ids.SeasonID) SectionParams

func (SectionParams) EncodeQuery

func (p SectionParams) EncodeQuery() (url.Values, error)

type Sections

type Sections struct {
	Sections []Section `json:"sections"`
	Total    int64     `json:"total"`
}

type SortOrder

type SortOrder string
const (
	SortAscending  SortOrder = "asc"
	SortDescending SortOrder = "desc"
)

type Trend

type Trend struct {
	Date      int64 `json:"date_key"`
	Increment int64 `json:"total_inc"`
}

type UpStat

type UpStat struct {
	IncrementCoin     int64 `json:"inc_coin"`
	IncrementElectric int64 `json:"inc_elec"`
	IncrementFavorite int64 `json:"inc_fav"`
	IncrementLike     int64 `json:"inc_like"`
	IncrementShare    int64 `json:"inc_share"`
	IncrementClick    int64 `json:"incr_click"`
	IncrementDanmaku  int64 `json:"incr_dm"`
	IncrementFans     int64 `json:"incr_fans"`
	IncrementReply    int64 `json:"incr_reply"`
	TotalClick        int64 `json:"total_click"`
	TotalCoin         int64 `json:"total_coin"`
	TotalDanmaku      int64 `json:"total_dm"`
	TotalElectric     int64 `json:"total_elec"`
	TotalFans         int64 `json:"total_fans"`
	TotalFavorite     int64 `json:"total_fav"`
	TotalLike         int64 `json:"total_like"`
	TotalReply        int64 `json:"total_reply"`
	TotalShare        int64 `json:"total_share"`
}

type VideoPart

type VideoPart struct {
	CID      int64  `json:"cid"`
	Index    int64  `json:"index"`
	Duration int64  `json:"duration"`
	Title    string `json:"title"`
}

type VideoTrendMetric

type VideoTrendMetric uint8
const (
	VideoTrendPlay VideoTrendMetric = iota + 1
	VideoTrendDanmaku
	VideoTrendReply
	VideoTrendShare
	VideoTrendCoin
	VideoTrendFavorite
	VideoTrendCharge
	VideoTrendLike
)

type VideoTrendParams

type VideoTrendParams struct {
	// contains filtered or unexported fields
}

func NewVideoTrendParams

func NewVideoTrendParams(metric VideoTrendMetric) VideoTrendParams

func (VideoTrendParams) EncodeQuery

func (p VideoTrendParams) EncodeQuery() (url.Values, error)

type ViewerBaseDetail

type ViewerBaseDetail struct {
	Male     int64 `json:"male"`
	Female   int64 `json:"female"`
	AgeOne   int64 `json:"age_one"`
	AgeTwo   int64 `json:"age_two"`
	AgeThree int64 `json:"age_three"`
	AgeFour  int64 `json:"age_four"`
	PC       int64 `json:"plat_pc"`
	H5       int64 `json:"plat_h5"`
	Out      int64 `json:"plat_out"`
	IOS      int64 `json:"plat_ios"`
	Android  int64 `json:"plat_android"`
	OtherApp int64 `json:"plat_other_app"`
}

type ViewerData

type ViewerData struct {
	Period     map[string]string `json:"period"`
	ViewerArea struct {
		Fan    map[string]int64 `json:"fan"`
		NotFan map[string]int64 `json:"not_fan"`
	} `json:"viewer_area"`
	ViewerBase struct {
		Fan    ViewerBaseDetail `json:"fan"`
		NotFan ViewerBaseDetail `json:"not_fan"`
	} `json:"viewer_base"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL