fav

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: 9 Imported by: 0

Documentation

Overview

Package fav contains parameters and stable response models for Bilibili favorite-folder read endpoints.

Index

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 favorites-domain operations.

func NewClient

func NewClient(client *core.Client) Client

NewClient binds the fav module to a shared client.

func (Client) CollectedList

func (f Client) CollectedList(ctx context.Context, params CollectedListParams) (CollectedList, error)

func (Client) CreatedList

func (f Client) CreatedList(ctx context.Context, params CreatedListParams) (CreatedList, error)

func (Client) FolderInfo

func (f Client) FolderInfo(ctx context.Context, params FolderInfoParams) (FolderInfo, error)

func (Client) ListDetail

func (f Client) ListDetail(ctx context.Context, params ListDetailParams) (ListDetail, error)

func (Client) ResourceIDs

func (f Client) ResourceIDs(ctx context.Context, params ResourceIDsParams) ([]ResourceID, error)

func (Client) ResourceInfos

func (f Client) ResourceInfos(ctx context.Context, params ResourceInfosParams) ([]ResourceInfo, error)

type CollectedFolder

type CollectedFolder struct {
	ID         uint64         `json:"id"`
	FID        uint64         `json:"fid"`
	MID        uint64         `json:"mid"`
	Attribute  uint32         `json:"attr"`
	Title      string         `json:"title"`
	Cover      string         `json:"cover"`
	Upper      CollectedUpper `json:"upper"`
	CoverType  uint8          `json:"cover_type"`
	Intro      string         `json:"intro"`
	CreatedAt  uint64         `json:"ctime"`
	ModifiedAt uint64         `json:"mtime"`
	State      uint8          `json:"state"`
	FavState   uint8          `json:"fav_state"`
	MediaCount uint32         `json:"media_count"`
}

type CollectedList

type CollectedList struct {
	Count uint32            `json:"count"`
	List  []CollectedFolder `json:"list"`
}

type CollectedListParams

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

func NewCollectedListParams

func NewCollectedListParams(upMID ids.MID) CollectedListParams

func (CollectedListParams) EncodeQuery

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

func (CollectedListParams) WithPage

func (CollectedListParams) WithPageSize

func (p CollectedListParams) WithPageSize(pageSize uint32) (CollectedListParams, error)

type CollectedUpper

type CollectedUpper struct {
	MID  uint64 `json:"mid"`
	Name string `json:"name"`
	Face string `json:"face"`
}

type CountInfo

type CountInfo struct {
	Collect  uint64  `json:"collect"`
	Play     uint64  `json:"play"`
	ThumbUp  *uint64 `json:"thumb_up"`
	Share    *uint64 `json:"share"`
	Danmaku  *uint64 `json:"danmaku"`
	ViewText *string `json:"view_text_1"`
}

type CreatedFolder

type CreatedFolder struct {
	ID         uint64 `json:"id"`
	FID        uint64 `json:"fid"`
	MID        uint64 `json:"mid"`
	Attribute  uint32 `json:"attr"`
	Title      string `json:"title"`
	FavState   uint8  `json:"fav_state"`
	MediaCount uint32 `json:"media_count"`
}

type CreatedList

type CreatedList struct {
	Count uint32          `json:"count"`
	List  []CreatedFolder `json:"list"`
}

type CreatedListParams

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

func NewCreatedListParams

func NewCreatedListParams(upMID ids.MID) CreatedListParams

func (CreatedListParams) EncodeQuery

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

func (CreatedListParams) WithResourceID

func (p CreatedListParams) WithResourceID(resourceID uint64) (CreatedListParams, error)

func (CreatedListParams) WithType

func (p CreatedListParams) WithType(typeID uint8) CreatedListParams

func (CreatedListParams) WithWebLocation

func (p CreatedListParams) WithWebLocation(webLocation string) (CreatedListParams, error)

type FolderInfo

type FolderInfo struct {
	ID         uint64      `json:"id"`
	FID        uint64      `json:"fid"`
	MID        uint64      `json:"mid"`
	Attribute  uint32      `json:"attr"`
	Title      string      `json:"title"`
	Cover      string      `json:"cover"`
	Upper      FolderUpper `json:"upper"`
	CoverType  uint8       `json:"cover_type"`
	CountInfo  CountInfo   `json:"cnt_info"`
	Type       uint32      `json:"type"`
	Intro      string      `json:"intro"`
	CreatedAt  uint64      `json:"ctime"`
	ModifiedAt uint64      `json:"mtime"`
	State      uint8       `json:"state"`
	FavState   uint8       `json:"fav_state"`
	LikeState  uint8       `json:"like_state"`
	MediaCount uint32      `json:"media_count"`
}

type FolderInfoParams

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

func NewFolderInfoParams

func NewFolderInfoParams(mediaID ids.MediaID) FolderInfoParams

func (FolderInfoParams) EncodeQuery

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

type FolderUpper

type FolderUpper struct {
	MID       uint64 `json:"mid"`
	Name      string `json:"name"`
	Face      string `json:"face"`
	Followed  bool   `json:"followed"`
	VIPType   uint8  `json:"vip_type"`
	VIPStatus uint8  `json:"vip_statue"`
}

type ListDetail

type ListDetail struct {
	Info    FolderInfo     `json:"info"`
	Medias  []ResourceInfo `json:"medias"`
	HasMore bool           `json:"has_more"`
	TTL     uint64         `json:"ttl"`
}

type ListDetailParams

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

func NewListDetailParams

func NewListDetailParams(mediaID ids.MediaID) ListDetailParams

func (ListDetailParams) EncodeQuery

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

func (ListDetailParams) WithContentType

func (p ListDetailParams) WithContentType(typeID uint8) ListDetailParams

func (ListDetailParams) WithKeyword

func (p ListDetailParams) WithKeyword(keyword string) (ListDetailParams, error)

func (ListDetailParams) WithOrder

func (p ListDetailParams) WithOrder(order string) (ListDetailParams, error)

func (ListDetailParams) WithPage

func (p ListDetailParams) WithPage(page uint32) (ListDetailParams, error)

func (ListDetailParams) WithPageSize

func (p ListDetailParams) WithPageSize(pageSize uint32) (ListDetailParams, error)

func (ListDetailParams) WithTID

func (p ListDetailParams) WithTID(tid uint32) ListDetailParams

type ResourceID

type ResourceID struct {
	ID         uint64  `json:"id"`
	Type       uint8   `json:"type"`
	BVID       *string `json:"bvid"`
	BVIDLegacy *string `json:"bv_id"`
}

type ResourceIDsParams

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

func NewResourceIDsParams

func NewResourceIDsParams(mediaID ids.MediaID) ResourceIDsParams

func (ResourceIDsParams) EncodeQuery

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

type ResourceInfo

type ResourceInfo struct {
	ID          uint64          `json:"id"`
	Type        uint8           `json:"type"`
	Title       string          `json:"title"`
	Cover       string          `json:"cover"`
	Intro       string          `json:"intro"`
	Page        *uint32         `json:"page"`
	Duration    uint32          `json:"duration"`
	Upper       ResourceUpper   `json:"upper"`
	Attribute   uint8           `json:"attr"`
	CountInfo   CountInfo       `json:"cnt_info"`
	Link        string          `json:"link"`
	CreatedAt   uint64          `json:"ctime"`
	PublishedAt uint64          `json:"pubtime"`
	FavoritedAt uint64          `json:"fav_time"`
	BVID        *string         `json:"bvid"`
	BVIDLegacy  *string         `json:"bv_id"`
	Season      json.RawMessage `json:"season"`
}

type ResourceInfosParams

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

func NewResourceInfosParams

func NewResourceInfosParams(resources string) (ResourceInfosParams, error)

func (ResourceInfosParams) EncodeQuery

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

type ResourceUpper

type ResourceUpper struct {
	MID  uint64 `json:"mid"`
	Name string `json:"name"`
	Face string `json:"face"`
}

Jump to

Keyboard shortcuts

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