Documentation
¶
Overview ¶
Package article contains validated parameters and stable response models for Bilibili article endpoints.
Index ¶
- type ArticleCard
- type ArticleItem
- type Articles
- type ArticlesInfoParams
- type Author
- type AuthorVIP
- type CardData
- type CardItem
- type CardKind
- type CardsParams
- type Category
- type Client
- func (a Client) Articles(ctx context.Context, params ArticlesInfoParams) (Articles, error)
- func (a Client) Cards(ctx context.Context, params CardsParams) (CardData, error)
- func (a Client) Info(ctx context.Context, params InfoParams) (Info, error)
- func (a Client) View(ctx context.Context, params ViewParams) (View, error)
- type Collection
- type Info
- type InfoParams
- type LiveCard
- type Media
- type OfficialVerify
- type ShareChannel
- type Stats
- type Tag
- type VideoCard
- type VideoDimension
- type VideoOwner
- type VideoRights
- type VideoStat
- type View
- type ViewParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArticleCard ¶
type ArticleCard struct {
ActID int64 `json:"act_id"`
ApplyTime string `json:"apply_time"`
Attributes *int32 `json:"attributes"`
AuthenMark *json.RawMessage `json:"authenMark"`
Author Author `json:"author"`
BannerURL string `json:"banner_url"`
Categories []Category `json:"categories"`
Category Category `json:"category"`
CheckState int32 `json:"check_state"`
CheckTime string `json:"check_time"`
ContentPictures *json.RawMessage `json:"content_pic_list"`
CoverAID int64 `json:"cover_avid"`
CreatedAt int64 `json:"ctime"`
Dispute *json.RawMessage `json:"dispute"`
Dynamic *string `json:"dynamic"`
ID ids.CVID `json:"id"`
ImageURLs []string `json:"image_urls"`
IsLike bool `json:"is_like"`
List *Collection `json:"list"`
Media Media `json:"media"`
ModifiedAt int64 `json:"mtime"`
OriginImageURLs []string `json:"origin_image_urls"`
OriginTemplateID int32 `json:"origin_template_id"`
Original int32 `json:"original"`
PrivatePublish int32 `json:"private_pub"`
PublishTime int64 `json:"publish_time"`
Reprint int32 `json:"reprint"`
State int32 `json:"state"`
Stats Stats `json:"stats"`
Summary string `json:"summary"`
TemplateID int32 `json:"template_id"`
Title string `json:"title"`
TopVideoInfo *json.RawMessage `json:"top_video_info"`
Type int32 `json:"type"`
Words int64 `json:"words"`
}
type ArticleItem ¶
type ArticleItem struct {
ID int64 `json:"id"`
Title string `json:"title"`
State int32 `json:"state"`
PublishTime int64 `json:"publish_time"`
Words int64 `json:"words"`
ImageURLs []string `json:"image_urls"`
Category Category `json:"category"`
Categories []Category `json:"categories"`
Summary string `json:"summary"`
Stats *Stats `json:"stats"`
LikeState *int32 `json:"like_state"`
}
type Articles ¶
type Articles struct {
List Collection `json:"list"`
Articles []ArticleItem `json:"articles"`
Author Author `json:"author"`
Last ArticleItem `json:"last"`
Attention bool `json:"attention"`
}
type ArticlesInfoParams ¶
type ArticlesInfoParams struct {
// contains filtered or unexported fields
}
func NewArticlesInfoParams ¶
func NewArticlesInfoParams(id uint64) (ArticlesInfoParams, error)
func (ArticlesInfoParams) EncodeQuery ¶
func (p ArticlesInfoParams) EncodeQuery() (url.Values, error)
type Author ¶
type Author struct {
MID ids.MID `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
Level int32 `json:"level"`
Fans int64 `json:"fans"`
OfficialVerify OfficialVerify `json:"official_verify"`
Nameplate json.RawMessage `json:"nameplate"`
Pendant json.RawMessage `json:"pendant"`
VIP AuthorVIP `json:"vip"`
}
type CardItem ¶
type CardItem struct {
Video *VideoCard
Article *ArticleCard
Live *LiveCard
Raw json.RawMessage
}
CardItem is one typed article embed. Raw is populated only when Bilibili returns an unknown or schema-incompatible card variant.
func (*CardItem) UnmarshalJSON ¶
type CardsParams ¶
type CardsParams struct {
// contains filtered or unexported fields
}
func NewCardsParams ¶
func NewCardsParams(cardIDs string) (CardsParams, error)
func (CardsParams) EncodeQuery ¶
func (p CardsParams) EncodeQuery() (url.Values, error)
func (CardsParams) WithWebLocation ¶
func (p CardsParams) WithWebLocation(location string) (CardsParams, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides article-domain operations.
type Collection ¶
type Collection struct {
ID uint64 `json:"id"`
MID ids.MID `json:"mid"`
Name string `json:"name"`
ImageURL string `json:"image_url"`
UpdateTime int64 `json:"update_time"`
CreatedAt int64 `json:"ctime"`
PublishedAt int64 `json:"publish_time"`
Summary string `json:"summary"`
Words int64 `json:"words"`
Read int64 `json:"read"`
ArticleCount int32 `json:"articles_count"`
State int32 `json:"state"`
Reason string `json:"reason"`
ApplyTime string `json:"apply_time"`
CheckTime string `json:"check_time"`
}
type Info ¶
type Info struct {
Like int32 `json:"like"`
Attention bool `json:"attention"`
Favorite bool `json:"favorite"`
Coin int32 `json:"coin"`
Stats Stats `json:"stats"`
Title string `json:"title"`
BannerURL string `json:"banner_url"`
MID ids.MID `json:"mid"`
AuthorName string `json:"author_name"`
IsAuthor bool `json:"is_author"`
ImageURLs []string `json:"image_urls"`
OriginImageURLs []string `json:"origin_image_urls"`
ShowLaterWatch bool `json:"show_later_watch"`
ShowSmallWindow bool `json:"show_small_window"`
InList bool `json:"in_list"`
Previous int64 `json:"pre"`
Next int64 `json:"next"`
Type int32 `json:"type"`
VideoURL string `json:"video_url"`
Location string `json:"location"`
}
type InfoParams ¶
type InfoParams struct {
// contains filtered or unexported fields
}
func NewInfoParams ¶
func NewInfoParams(id ids.CVID) InfoParams
func (InfoParams) EncodeQuery ¶
func (p InfoParams) EncodeQuery() (url.Values, error)
type LiveCard ¶
type LiveCard struct {
AreaName string `json:"area_v2_name"`
Cover string `json:"cover"`
Face string `json:"face"`
LiveStatus int32 `json:"live_status"`
Online int64 `json:"online"`
Pendant string `json:"pendent_ru"`
PendantColor string `json:"pendent_ru_color"`
PendantPicture string `json:"pendent_ru_pic"`
Role int32 `json:"role"`
RoomID ids.RoomID `json:"room_id"`
Title string `json:"title"`
UID ids.MID `json:"uid"`
Name string `json:"uname"`
}
type OfficialVerify ¶
type ShareChannel ¶
type ShareChannel struct {
}
type VideoCard ¶
type VideoCard struct {
AID ids.AID `json:"aid"`
BVID ids.BVID `json:"bvid"`
CID ids.CID `json:"cid"`
Copyright int32 `json:"copyright"`
Picture string `json:"pic"`
CreatedAt int64 `json:"ctime"`
Description string `json:"desc"`
Dimension VideoDimension `json:"dimension"`
Duration int64 `json:"duration"`
Dynamic string `json:"dynamic"`
Owner VideoOwner `json:"owner"`
PublishedAt int64 `json:"pubdate"`
Rights VideoRights `json:"rights"`
ShortLink string `json:"short_link_v2"`
Stat VideoStat `json:"stat"`
State int32 `json:"state"`
TID int32 `json:"tid"`
Title string `json:"title"`
TypeName string `json:"tname"`
Videos int32 `json:"videos"`
VTSwitch bool `json:"vt_switch"`
}
type VideoDimension ¶
type VideoOwner ¶
type VideoRights ¶
type VideoRights struct {
ArcPay int32 `json:"arc_pay"`
Autoplay int32 `json:"autoplay"`
BP int32 `json:"bp"`
Download int32 `json:"download"`
Electric int32 `json:"elec"`
HD5 int32 `json:"hd5"`
IsCooperation int32 `json:"is_cooperation"`
Movie int32 `json:"movie"`
NoBackground int32 `json:"no_background"`
NoReprint int32 `json:"no_reprint"`
Pay int32 `json:"pay"`
PayFreeWatch int32 `json:"pay_free_watch"`
UGCPay int32 `json:"ugc_pay"`
UGCPayPreview int32 `json:"ugc_pay_preview"`
}
type VideoStat ¶
type VideoStat struct {
AID ids.AID `json:"aid"`
Coin int64 `json:"coin"`
Danmaku int64 `json:"danmaku"`
Dislike int64 `json:"dislike"`
Favorite int64 `json:"favorite"`
HisRank int32 `json:"his_rank"`
Like int64 `json:"like"`
NowRank int32 `json:"now_rank"`
Reply int64 `json:"reply"`
View int64 `json:"view"`
VT int32 `json:"vt"`
VV int32 `json:"vv"`
}
type View ¶
type View struct {
ActID int64 `json:"act_id"`
ApplyTime string `json:"apply_time"`
Attributes *int32 `json:"attributes"`
AuthenMark *json.RawMessage `json:"authenMark"`
Author Author `json:"author"`
BannerURL string `json:"banner_url"`
Categories []Category `json:"categories"`
Category Category `json:"category"`
CheckState int32 `json:"check_state"`
CheckTime string `json:"check_time"`
Content string `json:"content"`
ContentPictures *json.RawMessage `json:"content_pic_list"`
CoverAID int64 `json:"cover_avid"`
CreatedAt int64 `json:"ctime"`
Dispute *json.RawMessage `json:"dispute"`
DynamicID string `json:"dyn_id_str"`
Dynamic *string `json:"dynamic"`
ID ids.CVID `json:"id"`
ImageURLs []string `json:"image_urls"`
IsLike bool `json:"is_like"`
Keywords string `json:"keywords"`
List *Collection `json:"list"`
Media Media `json:"media"`
ModifiedAt int64 `json:"mtime"`
Opus *json.RawMessage `json:"opus"`
OriginImageURLs []string `json:"origin_image_urls"`
OriginTemplateID int32 `json:"origin_template_id"`
Original int32 `json:"original"`
PrivatePublish int32 `json:"private_pub"`
PublishTime int64 `json:"publish_time"`
Reprint int32 `json:"reprint"`
State int32 `json:"state"`
Stats Stats `json:"stats"`
Summary string `json:"summary"`
Tags []Tag `json:"tags"`
TemplateID int32 `json:"template_id"`
Title string `json:"title"`
TopVideoInfo *json.RawMessage `json:"top_video_info"`
TotalArticleCount int64 `json:"total_art_num"`
Type int32 `json:"type"`
VersionID int64 `json:"version_id"`
Words int64 `json:"words"`
}
type ViewParams ¶
type ViewParams struct {
// contains filtered or unexported fields
}
func NewViewParams ¶
func NewViewParams(id ids.CVID) ViewParams
func (ViewParams) EncodeQuery ¶
func (p ViewParams) EncodeQuery() (url.Values, error)
func (ViewParams) WithGaiaSource ¶
func (p ViewParams) WithGaiaSource(source string) (ViewParams, error)
Click to show internal directories.
Click to hide internal directories.