bilibili

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 14 Imported by: 0

README

Bilibili API

This is a golang library for bilibili

Test

Caveats

This IS NOT an official project, and has no copyright!

LICENSE

The project is licensed under the MIT LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvToBv

func AvToBv(av string) (string, error)

AvToBv transfrom AV to BV

func BvToAv

func BvToAv(bv string) (string, error)

BvToAv transform BV to AV

func DanmakuXML

func DanmakuXML(id int64) ([]byte, error)

DnamakuXML returns the danmaku's XML file

func VideoAllDanmakuList

func VideoAllDanmakuList(vid string) (map[int][]Danmaku, error)

VideoAllDanmakuList returns all danmaku lists for vid

If current vid has a series of videos, it will iterate and return all danmaku list in a map

Types

type Danmaku

type Danmaku struct {
	StartTime float32 `json:"startTime"`
	Mode      DmkMode `json:"mode"`
	FontSize  int     `json:"fontSize"`
	Color     string  `json:"color"`
	Timestamp int64   `json:"timestamp"`
	Pool      DmkPool `json:"pool"`
	Sender    string  `json:"sender"`
	RowID     int64   `json:"rowId"`
	Body      string  `json:"body"`
}

Danmaku ...

func DanmakuList

func DanmakuList(id int64) ([]Danmaku, error)

func VideoDanmakuList

func VideoDanmakuList(vid string, page int) ([]Danmaku, error)

VideoDanmakuList returns a list of danmaku for current video ID

WARNING:

if current video ID has multiple videos, it will return
the first one if the parameter page is invalid

type DanmakuInfo

type DanmakuInfo struct {
	Page int    `json:"page"`
	Name string `json:"pagename"`
	ID   int64  `json:"cid"`
}

func VideoDanmakuInfos

func VideoDanmakuInfos(vid string) (infos []DanmakuInfo, err error)

GetDanmakus returns the danmaku's ID of video vid is case sensitive!!!

type DmkMode

type DmkMode int

DmkMode the danmaku mode

const (
	DmkScrollMode DmkMode = iota + 1
	DmkScrollMode2
	DmkScrollMode3
	DmkBottomMode
	DmkTopMode
	DmkReverseMode
	DmkLocateMode
	DmkAdvancedMode
)

DmkModes

type DmkPool

type DmkPool int

DmkPool the danmaku pool

const (
	DmkNormalPool DmkPool = iota
	DmkSubtitlePool
	DmkSpecalPool
)

Danmaku pools

type Stat

type Stat struct {
	Aid        int64  `json:"aid"`
	BV         string `json:"bvid"`
	View       int64  `json:"view"`
	Danmaku    int64  `json:"danmaku"`
	Reply      int64  `json:"reply"`
	Favorite   int64  `json:"favorite"`
	Coin       int64  `json:"coin"`
	Share      int64  `json:"share"`
	Like       int64  `json:"like"`
	NowRank    int    `json:"now_rank"`
	HisRank    int    `json:"his_rank"`
	NoReprint  int    `json:"no_reprint"`
	Copyright  int    `json:"copyright"`
	Argue      string `json:"argue_msg"`
	Evaluation string `json:"evaluation"`
}

Stat for bilibili video

func VideoStat

func VideoStat(vid string) (*Stat, error)

VideoStat returns video's statistics

Jump to

Keyboard shortcuts

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