download

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool int32

func (*Bool) Clear

func (b *Bool) Clear()

func (*Bool) Get

func (b *Bool) Get() bool

func (*Bool) Set

func (b *Bool) Set(val bool)

type DownloadInfo

type DownloadInfo struct {
	VideoID string `json:"video_id"`
	Avid    int64  `json:"avid"`
	Cid     int64  `json:"cid"`
	Qn      int64  `json:"qn"`
	Length  int64  `json:"length"` // 视频时长
	Size    int64  `json:"size"`   // 文件大小
	Url     string `json:"url"`
	Format  string `json:"format"`
}

func GetDownloadInfoByAidCid

func GetDownloadInfoByAidCid(videoId string, avid, cid int64) (*DownloadInfo, error)

type UrlProcessor

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

func (*UrlProcessor) CheckArgs

func (p *UrlProcessor) CheckArgs() error

CheckArgs check if video id legal

func (*UrlProcessor) QueryAidCids

func (p *UrlProcessor) QueryAidCids() error

QueryAidCids get every clip's aid, cid

type VideoDownloader

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

func NewVideoDownloader

func NewVideoDownloader(info *DownloadInfo, out *os.File) *VideoDownloader

func (*VideoDownloader) Download

func (d *VideoDownloader) Download() error

func (*VideoDownloader) DownloadFragment

func (d *VideoDownloader) DownloadFragment(frag *VideoFragment) ([]byte, error)

type VideoFragment

type VideoFragment struct {
	Begin int64
	End   int64
}

VideoFragment download video in parallel

type VideoInfo

type VideoInfo struct {
	VideoID  string `json:"video_id"` // video id, av/BV
	Avid     int64  `json:"avid"`
	Cid      int64  `json:"cid"`
	Title    string `json:"title"`
	Page     int64  `json:"page"`      // page no
	Duration int64  `json:"duration"`  // length in seconds
	PartName string `json:"part_name"` // part name
}

func GetVideoInfosById

func GetVideoInfosById(id string) ([]*VideoInfo, error)

GetVideoInfosById get videos id infomation by id

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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