bilibili

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

This file defines the Bilibili client struct. This struct is a facade of all necessary Bilibili HTTP API wrappers.

Get live room basic status. This is used to check initially if it is streaming or not.

Index

Constants

View Source
const InitReadBytes = 4096 // 4KiB

Variables

This section is empty.

Functions

This section is empty.

Types

type Bilibili

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

func NewBilibili

func NewBilibili(logger logging.Logger) *Bilibili

func NewBilibiliWithContext

func NewBilibiliWithContext(ctx context.Context, netTypes []types.IpNetType, logger logging.Logger) *Bilibili

func NewBilibiliWithNetType

func NewBilibiliWithNetType(netTypes []types.IpNetType, logger logging.Logger) *Bilibili

func (*Bilibili) CopyLiveStream

func (b *Bilibili) CopyLiveStream(
	ctx context.Context,
	roomId types.RoomId,
	stream types.StreamingUrlInfo,
	fileCreator func() (*os.File, error),
	bufSize int64,
) (err error)

CopyLiveStream read data from a livestream video stream, copy them to a writer.

func (*Bilibili) DialWebSocket added in v0.5.0

func (b *Bilibili) DialWebSocket(ctx context.Context, url string) (*websocket.Conn, error)

func (*Bilibili) Do

func (b *Bilibili) Do(req *http.Request) (resp *http.Response, err error)

func (*Bilibili) GetBUVID added in v0.5.0

func (b *Bilibili) GetBUVID() (string, error)

GetBUVID initializes cookie `buvid3`. If success, returns its value.

func (*Bilibili) GetDanmakuServerInfo

func (b *Bilibili) GetDanmakuServerInfo(roomId types.RoomId) (resp types.DanmakuServerInfoResponse, err error)

func (*Bilibili) GetLiveBUVID added in v0.5.0

func (b *Bilibili) GetLiveBUVID(roomId types.RoomId) (resp types.WebBannerResponse, err error)

GetLiveBUVID initializes cookie `LIVE_BUVID`. This should be called before GetDanmakuServerInfo.

func (*Bilibili) GetRoomPlayInfo

func (b *Bilibili) GetRoomPlayInfo(roomId types.RoomId) (resp types.RoomPlayInfoResponse, err error)

func (*Bilibili) GetRoomProfile

func (b *Bilibili) GetRoomProfile(roomId types.RoomId) (resp types.RoomProfileResponse, err error)

func (*Bilibili) GetStreamingInfo

func (b *Bilibili) GetStreamingInfo(roomId types.RoomId) (resp types.RoomUrlInfoResponse, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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