ydl

package
v0.0.0-...-e0a24ef Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadResult

type DownloadResult struct{}

type Format

type Format struct {
	FormatID string `json:"format_id"`
}

type JSONTime

type JSONTime time.Time

func NewJSONTime

func NewJSONTime(input time.Time) *JSONTime

func (*JSONTime) MarshalJSON

func (f *JSONTime) MarshalJSON() ([]byte, error)

func (*JSONTime) UnmarshalJSON

func (f *JSONTime) UnmarshalJSON(input []byte) error

type Thumbnail

type Thumbnail struct {
	URL    string `json:"url"`
	ID     string `json:"id"`
	Height int    `json:"height"`
	Width  int    `json:"width"`
}

type VideoMetadata

type VideoMetadata struct {
	ID          string      `json:"id"`
	Title       string      `json:"title"`
	Formats     []Format    `json:"formats"`
	Thumbnails  []Thumbnail `json:"thumbnails"`
	Description string      `json:"description"`
	Uploader    string      `json:"uploader"`
	UploaderID  string      `json:"uploader_id"`
	UploaderURL string      `json:"uploader_url"`
	UploadDate  *JSONTime   `json:"upload_date"`
	WebpageURL  string      `json:"webpage_url"`
	Filename    string      `json:"_filename"`
	Duration    int         `json:"duration"`
}

type YoutubeDL

type YoutubeDL interface {
	VideoMetadata(url string) ([]byte, error)
	Download(workDir string, metadata VideoMetadata) (DownloadResult, error)
}

func NewYoutubeDLImpl

func NewYoutubeDLImpl(logger *zap.SugaredLogger, command command.CommandProvider, cookies string) YoutubeDL

type YoutubeDLImpl

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

func (YoutubeDLImpl) Download

func (ydl YoutubeDLImpl) Download(workDir string, metadata VideoMetadata) (DownloadResult, error)

func (YoutubeDLImpl) VideoMetadata

func (ydl YoutubeDLImpl) VideoMetadata(url string) ([]byte, error)

Jump to

Keyboard shortcuts

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