Documentation
¶
Overview ¶
Package cheese contains validated parameters and stable response models for Bilibili PUGV/course endpoints.
Index ¶
- Constants
- type Brief
- type BriefImage
- type Client
- func (c Client) EpisodeDetail(ctx context.Context, episodeID ids.EpisodeID) (Course, error)
- func (c Client) EpisodeList(ctx context.Context, params EpisodeListParams) (EpisodeList, error)
- func (c Client) PlayURL(ctx context.Context, params PlayURLParams) (PlayURL, error)
- func (c Client) SeasonDetail(ctx context.Context, seasonID ids.SeasonID) (Course, error)
- type Course
- type CourseStat
- type Episode
- type EpisodeList
- type EpisodeListParams
- type EpisodePage
- type FormatFlags
- type FragmentInfo
- type FragmentVideo
- type PlayURL
- type PlayURLParams
- type Progress
- type Uploader
- type UserStatus
- type VideoInfo
- type VideoQuality
- type Volume
Constants ¶
View Source
const ( Quality480P = bangumi.Quality480P Quality4K = bangumi.Quality4K FormatDASH = bangumi.FormatDASH Format4K = bangumi.Format4K )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Brief ¶
type Brief struct {
Content string `json:"content"`
Images []BriefImage `json:"img"`
Title string `json:"title"`
Type int32 `json:"type"`
}
type BriefImage ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides public PUGV/course operations.
func (Client) EpisodeDetail ¶
EpisodeDetail gets the containing course-season detail by episode ID.
func (Client) EpisodeList ¶
func (c Client) EpisodeList(ctx context.Context, params EpisodeListParams) (EpisodeList, error)
EpisodeList gets one page of episodes in a course season.
type Course ¶
type Course struct {
Brief Brief `json:"brief"`
Cover string `json:"cover"`
EpisodePage EpisodePage `json:"episode_page"`
EpisodeSort int32 `json:"episode_sort"`
Episodes []Episode `json:"episodes"`
ReleaseBottomInfo string `json:"release_bottom_info"`
ReleaseInfo string `json:"release_info"`
ReleaseInfo2 string `json:"release_info2"`
ReleaseStatus string `json:"release_status"`
SeasonID uint64 `json:"season_id"`
ShortLink string `json:"short_link"`
Stat CourseStat `json:"stat"`
Status int32 `json:"status"`
Subtitle string `json:"subtitle"`
Title string `json:"title"`
Uploader Uploader `json:"up_info"`
UserStatus UserStatus `json:"user_status"`
Coupon json.RawMessage `json:"coupon"`
FAQ json.RawMessage `json:"faq"`
Payment json.RawMessage `json:"payment"`
PurchaseNote json.RawMessage `json:"purchase_note"`
PurchaseProtocol json.RawMessage `json:"purchase_protocol"`
}
type CourseStat ¶
type Episode ¶
type Episode struct {
AID uint64 `json:"aid"`
CID uint64 `json:"cid"`
Cover string `json:"cover"`
Duration uint64 `json:"duration"`
From string `json:"from"`
ID uint64 `json:"id"`
Index uint32 `json:"index"`
Page uint32 `json:"page"`
Play uint64 `json:"play"`
Playable bool `json:"playable"`
ReleaseDate uint64 `json:"release_date"`
Status int32 `json:"status"`
Subtitle string `json:"subtitle"`
Title string `json:"title"`
Watched bool `json:"watched"`
WatchedHistory uint64 `json:"watchedHistory"`
}
type EpisodeList ¶
type EpisodeList struct {
Items []Episode `json:"items"`
Page EpisodePage `json:"page"`
}
type EpisodeListParams ¶
type EpisodeListParams struct {
// contains filtered or unexported fields
}
func NewEpisodeListParams ¶
func NewEpisodeListParams(seasonID ids.SeasonID) EpisodeListParams
func (EpisodeListParams) EncodeQuery ¶
func (p EpisodeListParams) EncodeQuery() (url.Values, error)
func (EpisodeListParams) WithPage ¶
func (p EpisodeListParams) WithPage(page uint32) (EpisodeListParams, error)
func (EpisodeListParams) WithPageSize ¶
func (p EpisodeListParams) WithPageSize(size uint32) (EpisodeListParams, error)
type EpisodePage ¶
type FormatFlags ¶
type FormatFlags = bangumi.FormatFlags
type FragmentInfo ¶
type FragmentVideo ¶
type FragmentVideo struct {
Info FragmentInfo `json:"fragment_info"`
PlayableStatus bool `json:"playable_status"`
VideoInfo VideoInfo `json:"video_info"`
}
type PlayURL ¶
type PlayURL struct {
From string `json:"from"`
Result string `json:"result"`
Message string `json:"message"`
Quality uint64 `json:"quality"`
Format string `json:"format"`
TimeLength uint64 `json:"timelength"`
AcceptFormat string `json:"accept_format"`
AcceptDescriptions []string `json:"accept_description"`
AcceptQualities []uint64 `json:"accept_quality"`
VideoCodecID uint8 `json:"video_codecid"`
SeekParameter string `json:"seek_param"`
SeekType string `json:"seek_type"`
DURLs []video.DURL `json:"durls"`
DASH *video.DASH `json:"dash"`
SupportFormats []video.SupportFormat `json:"support_formats"`
Code int32 `json:"code"`
FormatFlags uint64 `json:"fnval"`
FormatVersion uint64 `json:"fnver"`
VideoProject bool `json:"video_project"`
Type string `json:"type"`
HasPaid bool `json:"has_paid"`
IsPreview *uint32 `json:"is_preview"`
NoRecode int32 `json:"no_rexcode"`
Status int32 `json:"status"`
Fragments []FragmentVideo `json:"fragment_videos"`
Volume *Volume `json:"volume"`
}
type PlayURLParams ¶
type PlayURLParams struct {
// contains filtered or unexported fields
}
func NewPlayURLParams ¶
func (PlayURLParams) EncodeQuery ¶
func (p PlayURLParams) EncodeQuery() (url.Values, error)
func (PlayURLParams) WithFormatFlags ¶
func (p PlayURLParams) WithFormatFlags(flags FormatFlags) PlayURLParams
func (PlayURLParams) WithQuality ¶
func (p PlayURLParams) WithQuality(quality VideoQuality) PlayURLParams
type UserStatus ¶
type VideoInfo ¶
type VideoInfo struct {
NoRecode int64 `json:"no_rexcode"`
FormatFlags int64 `json:"fnval"`
VideoProject bool `json:"video_project"`
ExpireTime int64 `json:"expire_time"`
FormatVersion int64 `json:"fnver"`
Type string `json:"type"`
URL string `json:"url"`
Quality int64 `json:"quality"`
TimeLength int64 `json:"timelength"`
DASH video.DASH `json:"dash"`
VideoCodecID int64 `json:"video_codecid"`
CID int64 `json:"cid"`
FileInfo json.RawMessage `json:"file_info"`
}
type VideoQuality ¶
type VideoQuality = bangumi.VideoQuality
type Volume ¶
type Volume struct {
MeasuredI float64 `json:"measured_i"`
TargetI float64 `json:"target_i"`
TargetOffset float64 `json:"target_offset"`
MeasuredLRA float64 `json:"measured_lra"`
TargetTP float64 `json:"target_tp"`
MeasuredTP float64 `json:"measured_tp"`
MeasuredThreshold float64 `json:"measured_threshold"`
MultiSceneArgs json.RawMessage `json:"multi_scene_args"`
}
Click to show internal directories.
Click to hide internal directories.