livestream

package
v0.0.0-...-d357feb Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMessageCount = 2000

Variables

This section is empty.

Functions

func GetLiveInfo

func GetLiveInfo(ys *youtube.Service, vid string) (videoInfo *youtube.Video, err error)

GetLiveInfo return video info.

func GetLiveStreamID

func GetLiveStreamID(ys *youtube.Service, channnelID string) (string, error)

GetLiveStreamID return active live ID in specified channnel.

func GetSuperChatRawMessages

func GetSuperChatRawMessages(ys *youtube.Service, cid, next string) (messages []*youtube.LiveChatMessage, nextToken string, intervalMillis int64, err error)

GetSuperChatRawMessages return live chat messages

Types

type ChatMessage

type ChatMessage struct {
	VideoInfo struct {
		ChannelID          string `json:"cid,omitempty"`
		ChannelTitle       string `json:"ctitle,omitempty"`
		VideoID            string `json:"vid,omitempty"`
		VideoTitle         string `json:"vtitle,omitempty"`
		ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
		ActualStartTime    string `json:"actualStartTime,omitempty"`
	} `json:"videoInfo,omitempty"`
	Message struct {
		MessageID          string `json:"messageID,omitempty"`
		MessageType        string `json:"type,omitempty"`
		AuthorName         string `json:"authorName,omitempty"`
		IsModerator        bool   `json:"isModerator,omitempty"`
		IsMember           bool   `json:"isMember,omitempty"`
		IsOwner            bool   `json:"isOwner,omitempty"`
		AccessibilityLabel string `json:"accessibilityLabel,omitempty"`
		AuthorChannelID    string `json:"authorChannelID,omitempty"`
		UserComment        string `json:"userComment,omitempty"`
		PublishedAt        string `json:"publishedAt,omitempty"`

		AmountDisplayString string  `json:"amountDisplayString,omitempty"`
		CurrencyRateToJPY   float64 `json:"currencyRateToJPY,omitempty"`
		AmountJPY           uint    `json:"amountJPY,omitempty"`
		Currency            string  `json:"currency,omitempty"`

		RawMessage *youtube.LiveChatMessage `json:"rawMessage,omitempty"`
	} `json:"message,omitempty"`
}

ChatMessage : output json.

func GetLiveChatMessagesFromProxy

func GetLiveChatMessagesFromProxy(chatJSON string) ([]*ChatMessage, bool, error)

GetLiveChatMessagesFromProxy scrape live chat

func GetLiveChatMessagesFromProxy2

func GetLiveChatMessagesFromProxy2(chatJSON string) ([]*ChatMessage, bool, error)

GetLiveChatMessagesFromProxy2 scrape live chat

func GetReplayChatMessagesFromProxy

func GetReplayChatMessagesFromProxy(chatJSON string) ([]*ChatMessage, bool, error)

GetReplayChatMessagesFromProxy scrape live chat

func GetReplayChatMessagesFromProxy2

func GetReplayChatMessagesFromProxy2(chatJSON string) ([]*ChatMessage, bool, error)

GetReplayChatMessagesFromProxy2 scrape replay live chat

func (*ChatMessage) ConvertToJPY

func (m *ChatMessage) ConvertToJPY() error

ConvertToJPY convert to JPY

type Contents

type Contents struct {
	TwoColumnWatchNextResults *TwoColumnWatchNextResults `json:"twoColumnWatchNextResults,omitempty"`
}

Contents is json struct

type Continuation

type Continuation struct {
	ReloadContinuationData *ReloadContinuationData `json:"reloadContinuationData,omitempty"`
}

Continuation is json struct

type ConversationBar

type ConversationBar struct {
	LiveChatRenderer *LiveChatRenderer `json:"liveChatRenderer,omitempty"`
}

ConversationBar is json struct

type LiveChatInfo

type LiveChatInfo struct {
	Contents *Contents `json:"contents,omitempty"`
}

LiveChatInfo is json struct

type LiveChatRenderer

type LiveChatRenderer struct {
	Continuations []*Continuation `json:"continuations,omitempty"`
}

LiveChatRenderer is json struct

type ReloadContinuationData

type ReloadContinuationData struct {
	Continuation string `json:"continuation,omitempty"`
}

ReloadContinuationData is json struct

type TwoColumnWatchNextResults

type TwoColumnWatchNextResults struct {
	ConversationBar *ConversationBar `json:"conversationBar,omitempty"`
}

TwoColumnWatchNextResults is json struct

type UpcomingLiveInfo

type UpcomingLiveInfo struct {
	StartTime time.Time
	VideoID   string
}

UpcomingLiveInfo struct

func GetUpcommingLiveID

func GetUpcommingLiveID(u *url.URL) (upcomingInfo []*UpcomingLiveInfo, err error)

GetUpcommingLiveID return channel id.

func GetUpcommingLiveIDFromChannelPage

func GetUpcommingLiveIDFromChannelPage(channel string) (upcomingInfo []*UpcomingLiveInfo, err error)

GetUpcommingLiveIDFromChannelPage return channel id.

Jump to

Keyboard shortcuts

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