downloader

package
v0.0.0-...-1661e94 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeFilename

func SanitizeFilename(fileName string) string

Types

type Downloader

type Downloader struct {
	youtube.Client
	OutputDir string // optional directory to store the files
}

Downloader offers high level functions to download videos into files

func GetDownloader

func GetDownloader(outputDir string) *Downloader

func (*Downloader) Download

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

Download : Starting download video by arguments.

func (*Downloader) DownloadAudio

func (dl *Downloader) DownloadAudio(ctx context.Context, outputPath string, v *youtube.Video, mimetype, language string) error

func (*Downloader) DownloadComposite

func (dl *Downloader) DownloadComposite(ctx context.Context, outputFile string, v *youtube.Video, quality string, mimetype, language string) error

DownloadComposite : Downloads audio and video streams separately and merges them via ffmpeg.

func (*Downloader) GetVideoWithFormat

func (dl *Downloader) GetVideoWithFormat(videoID string, outputDir string) (*youtube.Video, *youtube.Format, error)

Jump to

Keyboard shortcuts

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