youtube

package
v0.0.0-...-3e47104 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToVideoId

func ToVideoId(urlOrId string) (string, error)

func ToVideoIds

func ToVideoIds(urlsOrIds []string) ([]string, error)

Types

type PlaylistDiffResult

type PlaylistDiffResult struct {
	Inserts []PlaylistInsert
	Deletes []PlaylistItemDelete
}

type PlaylistInsert

type PlaylistInsert struct {
	VideoId  string
	Position int64
}

type PlaylistItemDelete

type PlaylistItemDelete struct {
	ItemId string
}

type YouTube

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

func New

func New(ctx context.Context, clientSecret, appCreds string) (*YouTube, error)

func (*YouTube) CreatePlaylist

func (y *YouTube) CreatePlaylist(ctx context.Context, title, desc, visibility string) (*youtube.Playlist, error)

func (*YouTube) DeletePlaylist

func (y *YouTube) DeletePlaylist(ctx context.Context, id string) error

func (*YouTube) DiffPlaylist

func (y *YouTube) DiffPlaylist(wantIds []string, gotItems []*youtube.PlaylistItem) PlaylistDiffResult

func (*YouTube) GetPlaylist

func (y *YouTube) GetPlaylist(ctx context.Context, id string) (*youtube.Playlist, error)

func (*YouTube) GetPlaylistItems

func (y *YouTube) GetPlaylistItems(ctx context.Context, playlistId string) ([]*youtube.PlaylistItem, error)

func (*YouTube) SyncPlaylist

func (y *YouTube) SyncPlaylist(ctx context.Context, playlistId string, wantIds []string) (*PlaylistDiffResult, error)

func (*YouTube) UpdatePlaylist

func (y *YouTube) UpdatePlaylist(ctx context.Context, id, title, desc, visibility string) (*youtube.Playlist, error)

Jump to

Keyboard shortcuts

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