ytube

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Name string `fig:"name" yaml:"name"`
	ID   string `fig:"id" yaml:"id"`
}

type Service

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

func NewService

func NewService(ctx context.Context, cfg config.YouTube) (Service, error)

func (Service) LastVideos

func (s Service) LastVideos(ctx context.Context, channelID string, maxResults int) ([]Video, error)

type Video

type Video struct {
	VideoID     string  `json:"id"`
	Title       string  `json:"title"`
	Thumbnail   string  `json:"thumbnail"`
	PublishedAt string  `json:"publishedAt"`
	Description string  `json:"description"`
	Channel     Channel `json:"channel"`
}

func FromSearchResult

func FromSearchResult(raw *youtube.SearchResult) (Video, error)

func (Video) ID

func (v Video) ID() string

func (Video) URL

func (v Video) URL() string

func (Video) UnescapeTitle

func (v Video) UnescapeTitle() string

Jump to

Keyboard shortcuts

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