youtube

package
v0.0.0-...-600b1a9 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLink = errors.New("invalid youtube link")
)

Functions

func GetStreamFile

func GetStreamFile(config configure.Config, videoId string) string

GetStreamFile returns the stream file in a format of m3u8. e.g {videoDir}/{videoId}/{videoId}.m3u8

Types

type Client

type Client struct {
	*youtube.Client
	// contains filtered or unexported fields
}

func NewYoutubeClient

func NewYoutubeClient(config configure.Config) *Client

NewYoutubeClient returns a new youtube client

func (*Client) DownloadVideo

func (c *Client) DownloadVideo(url string) (*VideoYoutube, error)

DownloadVideo downloads the video from youtube url

func (*Client) GetVideoID

func (c *Client) GetVideoID(url string) (id string, err error)

GetVideoID returns the video id from the url

type VideoYoutube

type VideoYoutube struct {
	*os.File
	Video *youtube.Video
}

Jump to

Keyboard shortcuts

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