youtube

package
v0.0.0-...-aeae457 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsYoutube

func IsYoutube(yu string) bool

Types

type Counter

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

A Counter is a thread-safe counter implementation

func (*Counter) Incr

func (c *Counter) Incr(val int64)

Incr method increments the counter by some value

func (*Counter) Reset

func (c *Counter) Reset()

Reset -

type FilterOption

type FilterOption struct {
	Quality      string
	VideoFormat  string
	AudioFormat  string
	FirstURLOnly bool
	WithURL      bool
}

FilterOption -

type FilterResponse

type FilterResponse struct {
	Video []youtube.Format
	Audio []youtube.Format
}

type RateCounter

type RateCounter struct {
	Reader   *Counter
	Ticker   *time.Ticker
	Callback func(int64, int64)
}

RateCounter -

func NewRateCounter

func NewRateCounter(cb func(int64, int64)) *RateCounter

NewRateCounter -

func (*RateCounter) Destroy

func (cc *RateCounter) Destroy() *RateCounter

Destroy -

func (*RateCounter) Run

func (cc *RateCounter) Run() *RateCounter

Run -

type Reader

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

Reader counts the bytes read through it.

func NewReader

func NewReader(r io.Reader, c *RateCounter) *Reader

NewReader makes a new Reader that counts the bytes read through it.

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

type Youtube

type Youtube struct {
	CallBackProgress func(total, current, size int64)
	PrintProgress    bool
	// contains filtered or unexported fields
}

Youtube -

func NewYoutube

func NewYoutube(url string, logger *logging.Logger) *Youtube

NewYoutube -

func (*Youtube) Download

func (cc *Youtube) Download(id []int) (v, a []string, ext string, err error)

Download -

func (*Youtube) Filter

func (cc *Youtube) Filter(ctx context.Context, options FilterOption, src *youtube.Video) (formats FilterResponse)

func (*Youtube) GetTitle

func (cc *Youtube) GetTitle() string

func (*Youtube) List

func (cc *Youtube) List(ctx context.Context) (video *youtube.Video, err error)

List -

Jump to

Keyboard shortcuts

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