youtube

package
v0.0.0-...-daa8be9 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVidNotFound     = errors.New("No video was found.")
	ErrChannelNotFound = errors.New("No channel was found.")
)
View Source
var Advanced = advanced{}
View Source
var AdvancedSearch = advancedSearch{}
View Source
var AdvancedSearchChannel = advancedSearchChannel{}
View Source
var AdvancedSearchVideo = advancedSearchVideo{}
View Source
var Normal = normal{}

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ID    string
	Title string
}

func SearchChannel

func SearchChannel(query string) (Channel, error, error)

SearchChannel will automatically create a client and return the most relevant channel. Returns ErrChannelNotFound if no channel was found.

func (Channel) URL

func (ch Channel) URL() string

type Client

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

func New

func New() (*Client, error)

New returns a new youtube client using the key set in core.YouTubeKey.

func (*Client) SearchChannels

func (c *Client) SearchChannels(query string, maxResults int64) ([]Channel, error)

SearchChannels returns a list of channels, of maxResults length, matching the query and ranked by relevance.

func (*Client) SearchVideos

func (c *Client) SearchVideos(query string, maxResults int64) ([]Video, error)

SearchVideos returns a list of videos, of maxResults length, matching the query and ranked by relevance. Will only return videos, not livestreams or premiers.

type Video

type Video struct {
	ID    string
	Title string
}

func SearchVideo

func SearchVideo(query string) (Video, error, error)

SearchVideo will automatically create a client and return the most relevant completed video (not livestreams or premiers). Returns ErrVidNotFound if no video was found.

func (Video) URL

func (v Video) URL() string

Jump to

Keyboard shortcuts

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