youtube

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateTagsUndefined       = youtube.TemplateTagsUndefined
	TemplateTagsIgnore          = youtube.TemplateTagsIgnore
	TemplateTagsUseAsPrimary    = youtube.TemplateTagsUseAsPrimary
	TemplateTagsUseAsAdditional = youtube.TemplateTagsUseAsAdditional
)
View Source
const ID = youtube.ID
View Source
const (
	LimitTagsLength = 500
)

Variables

This section is empty.

Functions

func CalculateTagsLength

func CalculateTagsLength(tags []string) int

func InitConfig

func InitConfig(cfg streamctl.Config)

func TruncateTags

func TruncateTags(tags []string) []string

Types

type ChatListener

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

func NewChatListener

func NewChatListener(
	ctx context.Context,
	videoID string,
) (*ChatListener, error)

func (*ChatListener) Close

func (h *ChatListener) Close() error

func (*ChatListener) MessagesChan

func (h *ChatListener) MessagesChan() <-chan streamcontrol.ChatMessage

type Config

type Config = youtube.Config

type FlagBroadcastTemplateIDs

type FlagBroadcastTemplateIDs []string

type LiveBroadcast

type LiveBroadcast = youtube.LiveBroadcast

type OAuthHandler

type OAuthHandler = youtube.OAuthHandler

type PlatformSpecificConfig

type PlatformSpecificConfig = youtube.PlatformSpecificConfig

type StreamProfile

type StreamProfile = youtube.StreamProfile

type StreamStatusCustomData

type StreamStatusCustomData = youtube.StreamStatusCustomData

type TemplateTags

type TemplateTags = youtube.TemplateTags

type YouTube

type YouTube struct {
	Config         Config
	YouTubeService *youtube.Service
	CancelFunc     context.CancelFunc
	SaveConfigFunc func(Config) error
	// contains filtered or unexported fields
}

func New

func New(
	ctx context.Context,
	cfg Config,
	saveCfgFn func(Config) error,
) (*YouTube, error)

func (*YouTube) ApplyProfile

func (yt *YouTube) ApplyProfile(
	ctx context.Context,
	profile StreamProfile,
	customArgs ...any,
) error

func (*YouTube) BanUser

func (yt *YouTube) BanUser(
	ctx context.Context,
	userID streamcontrol.ChatUserID,
	reason string,
	deadline time.Time,
) error

func (*YouTube) Close

func (yt *YouTube) Close() error

func (*YouTube) DeleteActiveBroadcasts

func (yt *YouTube) DeleteActiveBroadcasts(
	ctx context.Context,
) error

func (*YouTube) EndStream

func (yt *YouTube) EndStream(
	ctx context.Context,
) error

func (*YouTube) Flush

func (yt *YouTube) Flush(
	ctx context.Context,
) error

func (*YouTube) GetChatMessagesChan

func (yt *YouTube) GetChatMessagesChan(
	ctx context.Context,
) (<-chan streamcontrol.ChatMessage, error)

func (*YouTube) GetStreamStatus

func (yt *YouTube) GetStreamStatus(
	ctx context.Context,
) (_ret *streamcontrol.StreamStatus, _err error)

func (*YouTube) InsertAdsCuePoint

func (yt *YouTube) InsertAdsCuePoint(
	ctx context.Context,
	ts time.Time,
	duration time.Duration,
) error

func (*YouTube) IsCapable

func (yt *YouTube) IsCapable(
	ctx context.Context,
	cap streamcontrol.Capability,
) bool

func (*YouTube) IterateActiveBroadcasts

func (yt *YouTube) IterateActiveBroadcasts(
	ctx context.Context,
	callback func(broadcast *youtube.LiveBroadcast) error,
	parts ...string,
) error

func (*YouTube) IterateUpcomingBroadcasts

func (yt *YouTube) IterateUpcomingBroadcasts(
	ctx context.Context,
	callback func(broadcast *youtube.LiveBroadcast) error,
	parts ...string,
) error

func (*YouTube) ListBroadcasts

func (yt *YouTube) ListBroadcasts(
	ctx context.Context,
) ([]*youtube.LiveBroadcast, error)

func (*YouTube) ListStreams

func (yt *YouTube) ListStreams(
	ctx context.Context,
) ([]*youtube.LiveStream, error)

func (*YouTube) Ping

func (yt *YouTube) Ping(ctx context.Context) (_err error)

func (*YouTube) RemoveChatMessage

func (yt *YouTube) RemoveChatMessage(
	ctx context.Context,
	messageID streamcontrol.ChatMessageID,
) error

func (*YouTube) SendChatMessage

func (yt *YouTube) SendChatMessage(
	ctx context.Context,
	message string,
) error

func (*YouTube) SetDescription

func (yt *YouTube) SetDescription(
	ctx context.Context,
	description string,
) error

func (*YouTube) SetTitle

func (yt *YouTube) SetTitle(
	ctx context.Context,
	title string,
) error

func (*YouTube) StartStream

func (yt *YouTube) StartStream(
	ctx context.Context,
	title string,
	description string,
	profile StreamProfile,
	customArgs ...any,
) (_err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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