core

package
v0.0.0-...-df054f5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BASE_URL string = "https://api.bilibili.com/"
	BVID     string
	CLIENT   *http.Client = &http.Client{}
)
View Source
var (
	// 一般80以上的都要大会员,无法获取
	VIDEO_QUALITY map[int]string = map[int]string{
		6:   "240P 极速",
		16:  "360P 流畅",
		32:  "480P 清晰",
		64:  "720P 高清",
		74:  "720P 60帧",
		80:  "1080P 高清",
		112: "1080P 高码率",
		116: "1080P 60帧",
		120: "4k 超清",
		125: "HDR 真彩",
		127: "超高清 8K",
	}

	AUDIO_QUALITY map[int]string = map[int]string{
		30216: "64  kbps",
		30232: "128 kbps",
		30280: "320 kbps",
	}
)

Functions

func Run

func Run() error

Types

type Audio

type Audio struct {
	Id      int    `json:"id"`
	BaseUrl string `json:"baseUrl"`
}

type Dash

type Dash struct {
	Duration int     `json:"duration"`
	Videos   []Video `json:"video"`
	Audios   []Audio `json:"audio"`
}

func (*Dash) GetAudioQualitys

func (d *Dash) GetAudioQualitys() []string

获取所有音频质量的文字描述

func (*Dash) GetVideoQualitys

func (d *Dash) GetVideoQualitys() []string

获取所有视频质量文字描述

type ResultInfo

type ResultInfo[D VideoUrl | VideoInfo] struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    D      `json:"data"`
}

type Video

type Video struct {
	Id        int    `json:"id"`
	BaseUrl   string `json:"baseUrl"`
	BandWidth int    `json:"bandwidth"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
}

type VideoInfo

type VideoInfo struct {
	Bvid  string `json:"bvid"`
	Aid   int    `json:"aid"`
	Cid   int    `json:"cid"`
	Title string `json:"title"`
}

type VideoUrl

type VideoUrl struct {
	Dash Dash `json:"dash"`
}

Jump to

Keyboard shortcuts

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