yt

package
v0.0.0-...-50e0f8f Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVideoIDFromURL

func GetVideoIDFromURL(input string) string

func NormaliseURL

func NormaliseURL(raw string) string

Types

type Client

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

func New

func New(ctx context.Context, key string) (*Client, error)

func (*Client) GetVideoByID

func (c *Client) GetVideoByID(ctx context.Context, id string) (*Video, error)

func (*Client) GetVideoByURL

func (c *Client) GetVideoByURL(ctx context.Context, rawURL string) (*Video, error)

func (*Client) GetVideosByIDs

func (c *Client) GetVideosByIDs(ctx context.Context, ids ...string) ([]Video, error)

func (*Client) SearchVideo

func (c *Client) SearchVideo(ctx context.Context, search string, limit int64) ([]Video, error)

type Video

type Video struct {
	ID           string `json:"id"`
	ETag         string `json:"etag"`
	Title        string `json:"title"`
	ChannelID    string `json:"channel_id"`
	ChannelTitle string `json:"channel_title"`
	DurationRaw  string `json:"duration"`
}

func (*Video) AsMessageEmbed

func (v *Video) AsMessageEmbed() *discordgo.MessageEmbed

func (*Video) ChannelURL

func (v *Video) ChannelURL() string

func (*Video) Duration

func (v *Video) Duration() *util.ISODuration

func (*Video) ToMap

func (v *Video) ToMap() map[string]string

func (*Video) VideoURL

func (v *Video) VideoURL() string

Jump to

Keyboard shortcuts

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