youtube

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSongNotFound = errors.New("song not found")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Download  bool   `json:"download"`
	OutputDir string `json:"output"`
}

type Downloader

type Downloader struct {
	downloader.Downloader
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(client youtube.Client, outputDir string, cache filesCache) *Downloader

func (*Downloader) Download

func (dl *Downloader) Download(ctx context.Context, v *youtube.Video, format *youtube.Format, outputFile string) error

type YouTube

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

func NewYouTubeClient

func NewYouTubeClient(ytdl *ytdl.Client, yt *youtube.Service, loader *Downloader, config Config) *YouTube

func (*YouTube) EnsureStreamInfo

func (y *YouTube) EnsureStreamInfo(ctx context.Context, song *pkg.Song) (*pkg.Song, error)

func (*YouTube) FindSong

func (y *YouTube) FindSong(ctx context.Context, query string) (*pkg.Song, error)

Jump to

Keyboard shortcuts

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