Documentation
¶
Overview ¶
Package audio contains validated parameters and stable response models for Bilibili audio endpoints.
Index ¶
- type Client
- func (a Client) CoinCount(ctx context.Context, params SongParams) (int32, error)
- func (a Client) CollectionInfo(ctx context.Context, params CollectionInfoParams) (*Collection, error)
- func (a Client) CollectionStatus(ctx context.Context, params SongParams) (bool, error)
- func (a Client) CollectionsList(ctx context.Context, params PageParams) (Page[Collection], error)
- func (a Client) HotMenu(ctx context.Context, params PageParams) (Page[HotMenu], error)
- func (a Client) Info(ctx context.Context, params SongParams) (Info, error)
- func (a Client) Lyric(ctx context.Context, params SongParams) (string, error)
- func (a Client) Members(ctx context.Context, params SongParams) ([]MemberGroup, error)
- func (a Client) RankDetail(ctx context.Context, params RankListParams) (RankDetail, error)
- func (a Client) RankMenu(ctx context.Context, params PageParams) (Page[RankMenu], error)
- func (a Client) RankMusicList(ctx context.Context, params RankListParams) (RankMusicList, error)
- func (a Client) RankPeriod(ctx context.Context, params RankPeriodParams) (RankPeriods, error)
- func (a Client) StatusNumber(ctx context.Context, params SongParams) (StatusNumber, error)
- func (a Client) StreamURL(ctx context.Context, params StreamURLParams) (StreamURL, error)
- func (a Client) StreamURLWeb(ctx context.Context, params StreamURLWebParams) (StreamURLWeb, error)
- func (a Client) Tags(ctx context.Context, params SongParams) ([]Tag, error)
- type Collection
- type CollectionInfoParams
- type CollectionStatistic
- type HotMenu
- type Info
- type Member
- type MemberGroup
- type MenuStatistic
- type Page
- type PageParams
- type Quality
- type QualityInfo
- type RankDetail
- type RankItem
- type RankListParams
- type RankListType
- type RankMenu
- type RankMusic
- type RankMusicList
- type RankPeriod
- type RankPeriodParams
- type RankPeriods
- type SongParams
- type Statistic
- type StatusNumber
- type StreamURL
- type StreamURLParams
- type StreamURLWeb
- type StreamURLWebParams
- type Tag
- type VIPInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides audio-domain operations.
func (Client) CollectionInfo ¶
func (a Client) CollectionInfo(ctx context.Context, params CollectionInfoParams) (*Collection, error)
func (Client) CollectionStatus ¶
func (Client) CollectionsList ¶
func (a Client) CollectionsList(ctx context.Context, params PageParams) (Page[Collection], error)
func (Client) Members ¶
func (a Client) Members(ctx context.Context, params SongParams) ([]MemberGroup, error)
func (Client) RankDetail ¶
func (a Client) RankDetail(ctx context.Context, params RankListParams) (RankDetail, error)
func (Client) RankMusicList ¶
func (a Client) RankMusicList(ctx context.Context, params RankListParams) (RankMusicList, error)
func (Client) RankPeriod ¶
func (a Client) RankPeriod(ctx context.Context, params RankPeriodParams) (RankPeriods, error)
func (Client) StatusNumber ¶
func (a Client) StatusNumber(ctx context.Context, params SongParams) (StatusNumber, error)
func (Client) StreamURLWeb ¶
func (a Client) StreamURLWeb(ctx context.Context, params StreamURLWebParams) (StreamURLWeb, error)
type Collection ¶
type Collection struct {
ID int64 `json:"id"`
UID int64 `json:"uid"`
UserName string `json:"uname"`
Title string `json:"title"`
Type int32 `json:"type"`
Published int32 `json:"published"`
Cover string `json:"cover"`
CreatedAt int64 `json:"ctime"`
SongCount int32 `json:"song"`
Description string `json:"desc"`
SIDs []int64 `json:"sids"`
MenuID int64 `json:"menuId"`
Statistic CollectionStatistic `json:"statistic"`
}
type CollectionInfoParams ¶
type CollectionInfoParams struct {
// contains filtered or unexported fields
}
func NewCollectionInfoParams ¶
func NewCollectionInfoParams(id uint64) (CollectionInfoParams, error)
func (CollectionInfoParams) EncodeQuery ¶
func (p CollectionInfoParams) EncodeQuery() (url.Values, error)
type CollectionStatistic ¶
type HotMenu ¶
type HotMenu struct {
MenuID int64 `json:"menuId"`
UID int64 `json:"uid"`
UserName string `json:"uname"`
Title string `json:"title"`
Cover string `json:"cover"`
Intro string `json:"intro"`
Type int32 `json:"type"`
Off int32 `json:"off"`
CreatedAt int64 `json:"ctime"`
CurrentTime int64 `json:"curtime"`
Statistic MenuStatistic `json:"statistic"`
SongCount int32 `json:"snum"`
Attribute int32 `json:"attr"`
IsDefault int32 `json:"isDefault"`
CollectionID int64 `json:"collectionId"`
}
type Info ¶
type Info struct {
ID ids.AudioID `json:"id"`
UID ids.MID `json:"uid"`
UserName string `json:"uname"`
Author string `json:"author"`
Title string `json:"title"`
Cover string `json:"cover"`
Intro string `json:"intro"`
LyricURL string `json:"lyric"`
CRType int32 `json:"crtype"`
Duration int64 `json:"duration"`
PassTime int64 `json:"passtime"`
CurrentTime int64 `json:"curtime"`
AID int64 `json:"aid"`
BVID string `json:"bvid"`
CID int64 `json:"cid"`
MSID int64 `json:"msid"`
Attribute int64 `json:"attr"`
Limit int64 `json:"limit"`
ActivityID int64 `json:"activityId"`
LimitDescription string `json:"limitdesc"`
CreatedAt *json.RawMessage `json:"ctime"`
Statistic Statistic `json:"statistic"`
VIP VIPInfo `json:"vipInfo"`
CollectIDs []int64 `json:"collectIds"`
CoinCount int64 `json:"coin_num"`
}
type MemberGroup ¶
type MenuStatistic ¶
type PageParams ¶
type PageParams struct {
// contains filtered or unexported fields
}
func NewPageParams ¶
func NewPageParams(page, size uint32) (PageParams, error)
func (PageParams) EncodeQuery ¶
func (p PageParams) EncodeQuery() (url.Values, error)
type QualityInfo ¶
type RankDetail ¶
type RankListParams ¶
type RankListParams struct {
// contains filtered or unexported fields
}
func NewRankListParams ¶
func NewRankListParams(id uint64) (RankListParams, error)
func (RankListParams) EncodeQuery ¶
func (p RankListParams) EncodeQuery(csrf string) (url.Values, error)
type RankListType ¶
type RankListType uint32
const ( RankHot RankListType = 1 RankOriginal RankListType = 2 )
func NewCustomRankListType ¶
func NewCustomRankListType(value uint32) (RankListType, error)
type RankMenu ¶
type RankMenu struct {
MenuID int64 `json:"menuId"`
UID int64 `json:"uid"`
UserName string `json:"uname"`
Title string `json:"title"`
Cover string `json:"cover"`
Intro string `json:"intro"`
Type int32 `json:"type"`
Off int32 `json:"off"`
CreatedAt int64 `json:"ctime"`
CurrentTime int64 `json:"curtime"`
Statistic MenuStatistic `json:"statistic"`
SongCount int32 `json:"snum"`
Attribute int32 `json:"attr"`
IsDefault int32 `json:"isDefault"`
CollectionID int64 `json:"collectionId"`
Audios []RankItem `json:"audios"`
}
type RankMusic ¶
type RankMusic struct {
MusicID string `json:"music_id"`
MusicTitle string `json:"music_title"`
Singer string `json:"singer"`
Album string `json:"album"`
MVAID uint64 `json:"mv_aid"`
MVBVID string `json:"mv_bvid"`
MVCover string `json:"mv_cover"`
Heat uint64 `json:"heat"`
Rank uint64 `json:"rank"`
CanListen bool `json:"can_listen"`
Recommendation string `json:"recommendation"`
CreationAID uint64 `json:"creation_aid"`
CreationBVID string `json:"creation_bvid"`
CreationCover string `json:"creation_cover"`
CreationTitle string `json:"creation_title"`
CreationUP uint64 `json:"creation_up"`
CreationNickname string `json:"creation_nickname"`
CreationDuration uint64 `json:"creation_duration"`
CreationPlay uint64 `json:"creation_play"`
CreationReason string `json:"creation_reason"`
Achievements []string `json:"achievements"`
MaterialID uint64 `json:"material_id"`
MaterialUseCount uint64 `json:"material_use_num"`
MaterialDuration uint64 `json:"material_duration"`
MaterialShow uint64 `json:"material_show"`
SongType uint64 `json:"song_type"`
}
type RankMusicList ¶
type RankMusicList struct {
List []RankMusic `json:"list"`
}
type RankPeriod ¶
type RankPeriodParams ¶
type RankPeriodParams struct {
// contains filtered or unexported fields
}
func NewRankPeriodParams ¶
func NewRankPeriodParams(listType RankListType) RankPeriodParams
func (RankPeriodParams) EncodeQuery ¶
func (p RankPeriodParams) EncodeQuery(csrf string) (url.Values, error)
type RankPeriods ¶
type RankPeriods struct {
List map[string][]RankPeriod `json:"list"`
}
type SongParams ¶
type SongParams struct {
// contains filtered or unexported fields
}
func NewSongParams ¶
func NewSongParams(sid ids.AudioID) SongParams
func (SongParams) EncodeQuery ¶
func (p SongParams) EncodeQuery() (url.Values, error)
type StatusNumber ¶
type StreamURLParams ¶
type StreamURLParams struct {
// contains filtered or unexported fields
}
func NewStreamURLParams ¶
func NewStreamURLParams(sid ids.AudioID, quality Quality) StreamURLParams
func (StreamURLParams) EncodeQuery ¶
func (p StreamURLParams) EncodeQuery() (url.Values, error)
func (StreamURLParams) WithMID ¶
func (p StreamURLParams) WithMID(mid uint64) (StreamURLParams, error)
func (StreamURLParams) WithPlatform ¶
func (p StreamURLParams) WithPlatform(platform string) (StreamURLParams, error)
func (StreamURLParams) WithPrivilege ¶
func (p StreamURLParams) WithPrivilege(privilege uint32) (StreamURLParams, error)
type StreamURLWeb ¶
type StreamURLWebParams ¶
type StreamURLWebParams struct {
// contains filtered or unexported fields
}
func NewStreamURLWebParams ¶
func NewStreamURLWebParams(sid ids.AudioID) StreamURLWebParams
func (StreamURLWebParams) EncodeQuery ¶
func (p StreamURLWebParams) EncodeQuery() (url.Values, error)
func (StreamURLWebParams) WithPrivilege ¶
func (p StreamURLWebParams) WithPrivilege(privilege uint32) (StreamURLWebParams, error)
func (StreamURLWebParams) WithQuality ¶
func (p StreamURLWebParams) WithQuality(quality Quality) StreamURLWebParams
Click to show internal directories.
Click to hide internal directories.