youtube

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LiveChatMessage2Messages

func LiveChatMessage2Messages(in []*youtube.LiveChatMessage) []string

Types

type ChatConnection

type ChatConnection struct {
	PerPage              int
	Yt                   *Youtube
	Info                 *youtube.LiveBroadcast
	PenultimatePageToken string
	PenultimateMesages   []string
	NextPageToken        string
}

func (*ChatConnection) Spin

func (cc *ChatConnection) Spin(ctx context.Context) []string

TODO do not retrieve penultimate page if we have messages from it

type Youtube

type Youtube struct {
	Client   *http.Client
	Service  *youtube.Service
	CodeChan chan string
}

func New

func New(ctx context.Context) (*Youtube, error)

func (*Youtube) GetChatConnection

func (y *Youtube) GetChatConnection(ctx context.Context, perpage int) *ChatConnection

func (*Youtube) GetCodeChan

func (y *Youtube) GetCodeChan() chan string

func (*Youtube) GetStreamInfo

func (y *Youtube) GetStreamInfo(ctx context.Context) (*youtube.LiveBroadcast, error)

func (*Youtube) InitStage1

func (y *Youtube) InitStage1(ctx context.Context) error

func (*Youtube) Ready

func (y *Youtube) Ready() bool

Jump to

Keyboard shortcuts

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