vapi

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrIncorrectVideoID return when youtube API return empty video details
	ErrIncorrectVideoID = errors.New("Couldn't find Youtube video by specified video ID")

	// ErrAPIKeyIsEmpty return when os.Getenv() return empty Youtube API key
	ErrAPIKeyIsEmpty = errors.New("Youtube API key was not specified")
)

Functions

This section is empty.

Types

type PlaylistItems

type PlaylistItems struct {
	NextPageToken string `json:"nextPageToken"`
	Items         []items
}

type Video

type Video struct {
	Duration      int
	Title         string
	LiveBroadcast bool
}

type Youtube

type Youtube struct {
	APIKEY string
}

func NewYoutubeClient

func NewYoutubeClient(apiKey string) *Youtube

NewYoutubeClient create and return new instanse of YoutubeClient

func (Youtube) GetPlaylistDetails

func (youtube Youtube) GetPlaylistDetails(id string) ([]*PlaylistItems, error)

GetPlaylistDetails extract all video from playlist and return This func is not complete and is not working Since we use free Google account, API quotas is to small, so handling multiple playlists may run out of limits quotas

func (Youtube) GetVideoDetails

func (youtube Youtube) GetVideoDetails(id string) (int, string, bool, error)

GetVideoDetails gettting and return video duration and title

Jump to

Keyboard shortcuts

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