youtube

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Video concern_type.Type = "news"
	Live  concern_type.Type = "live"
)
View Source
const Site = "youtube"
View Source
const VideoPath = "https://www.youtube.com/channel/%s/videos?view=57&flow=grid"
View Source
const VideoView = "https://www.youtube.com/watch?v="

Variables

View Source
var (
	VideoStatus_name = map[int32]string{
		0: "Waiting",
		1: "Living",
		2: "Upload",
	}
	VideoStatus_value = map[string]int32{
		"Waiting": 0,
		"Living":  1,
		"Upload":  2,
	}
)

Enum value maps for VideoStatus.

View Source
var (
	VideoType_name = map[int32]string{
		0: "FirstLive",
		1: "Live",
		2: "Video",
	}
	VideoType_value = map[string]int32{
		"FirstLive": 0,
		"Live":      1,
		"Video":     2,
	}
)

Enum value maps for VideoType.

View Source
var File_lsp_youtube_youtube_proto protoreflect.FileDescriptor

Functions

func NewExtraKey

func NewExtraKey() *extraKey

func VideoViewUrl

func VideoViewUrl(videoId string) string

Types

type Concern

type Concern struct {
	*StateManager
}

func NewConcern

func NewConcern(notify chan<- concern.Notify) *Concern

func (*Concern) Add

func (c *Concern) Add(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)

func (*Concern) FindInfo added in v0.0.9

func (c *Concern) FindInfo(channelId string, load bool) (*Info, error)

func (*Concern) FindOrLoad added in v0.0.9

func (c *Concern) FindOrLoad(channelId string) (*Info, error)

func (*Concern) Get added in v1.0.0

func (c *Concern) Get(id interface{}) (concern.IdentityInfo, error)

func (*Concern) GetStateManager added in v1.0.0

func (c *Concern) GetStateManager() concern.IStateManager

func (Concern) InfoKey

func (e Concern) InfoKey(keys ...interface{}) string

func (*Concern) ParseId added in v1.0.0

func (c *Concern) ParseId(s string) (interface{}, error)

func (*Concern) Remove added in v1.0.0

func (c *Concern) Remove(ctx mmsg.IMsgCtx, groupCode int64, _id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)

func (*Concern) Site added in v1.0.0

func (c *Concern) Site() string

func (*Concern) Start

func (c *Concern) Start() error

func (*Concern) Stop added in v0.0.19

func (c *Concern) Stop()

func (*Concern) Types added in v1.0.0

func (c *Concern) Types() []concern_type.Type

func (Concern) UserInfoKey

func (e Concern) UserInfoKey(keys ...interface{}) string

func (Concern) VideoKey

func (e Concern) VideoKey(keys ...interface{}) string

type ConcernNotify

type ConcernNotify struct {
	*VideoInfo
	GroupCode int64 `json:"group_code"`
}

func NewConcernNotify

func NewConcernNotify(groupCode int64, info *VideoInfo) *ConcernNotify

func (*ConcernNotify) GetGroupCode added in v0.0.10

func (notify *ConcernNotify) GetGroupCode() int64

func (*ConcernNotify) Logger added in v0.0.17

func (notify *ConcernNotify) Logger() *logrus.Entry

func (*ConcernNotify) ToMessage added in v0.0.10

func (notify *ConcernNotify) ToMessage() (m *mmsg.MSG)

type GroupConcernConfig added in v0.0.13

type GroupConcernConfig struct {
	concern.IConfig
}

func NewGroupConcernConfig added in v0.0.13

func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig

func (*GroupConcernConfig) ShouldSendHook added in v0.0.13

func (g *GroupConcernConfig) ShouldSendHook(notify concern.Notify) *concern.HookResult

type Info

type Info struct {
	VideoInfo []*VideoInfo `json:"video_info"`
	UserInfo
}

func NewInfo

func NewInfo(vinfo []*VideoInfo) *Info

func (*Info) ToString

func (i *Info) ToString() string

type KeySet

type KeySet struct {
}

func NewKeySet

func NewKeySet() *KeySet

func (*KeySet) FreshKey

func (k *KeySet) FreshKey(keys ...interface{}) string

func (*KeySet) GroupAtAllMarkKey added in v0.0.10

func (k *KeySet) GroupAtAllMarkKey(keys ...interface{}) string

func (*KeySet) GroupConcernConfigKey added in v0.0.10

func (k *KeySet) GroupConcernConfigKey(keys ...interface{}) string

func (*KeySet) GroupConcernStateKey

func (k *KeySet) GroupConcernStateKey(keys ...interface{}) string

func (*KeySet) ParseGroupConcernStateKey

func (k *KeySet) ParseGroupConcernStateKey(key string) (int64, interface{}, error)

type Searcher

type Searcher struct {
	Sub []*gabs.Container
	// contains filtered or unexported fields
}

type StateManager

type StateManager struct {
	*concern.StateManager
	// contains filtered or unexported fields
}

func NewStateManager

func NewStateManager(notify chan<- concern.Notify) *StateManager

func (*StateManager) AddInfo

func (s *StateManager) AddInfo(info *Info) error

func (*StateManager) AddVideo

func (s *StateManager) AddVideo(v *VideoInfo) error

func (*StateManager) GetGroupConcernConfig added in v1.0.0

func (s *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)

func (*StateManager) GetInfo

func (s *StateManager) GetInfo(channelId string) (*Info, error)

func (*StateManager) GetVideo

func (s *StateManager) GetVideo(channelId string, videoId string) (*VideoInfo, error)

func (StateManager) InfoKey

func (e StateManager) InfoKey(keys ...interface{}) string

func (StateManager) UserInfoKey

func (e StateManager) UserInfoKey(keys ...interface{}) string

func (StateManager) VideoKey

func (e StateManager) VideoKey(keys ...interface{}) string

type UserInfo

type UserInfo struct {
	ChannelId   string `json:"channel_id"`
	ChannelName string `json:"channel_name"`
}

func NewUserInfo added in v0.0.7

func NewUserInfo(channelId, channelName string) *UserInfo

func (*UserInfo) GetChannelName added in v0.0.13

func (ui *UserInfo) GetChannelName() string

type VideoInfo

type VideoInfo struct {
	UserInfo
	Cover          string      `json:"cover"`
	VideoId        string      `json:"video_id"`
	VideoTitle     string      `json:"video_title"`
	VideoType      VideoType   `json:"video_type"`
	VideoStatus    VideoStatus `json:"video_status"`
	VideoTimestamp int64       `json:"video_timestamp"`
	// contains filtered or unexported fields
}

VideoInfo may be a video or a live, depend on the VideoType

func XFetchInfo

func XFetchInfo(channelID string) ([]*VideoInfo, error)

XFetchInfo very sb

func (*VideoInfo) GetMSG added in v1.0.1

func (v *VideoInfo) GetMSG() *mmsg.MSG

func (*VideoInfo) GetUid added in v1.0.0

func (v *VideoInfo) GetUid() interface{}

func (*VideoInfo) IsLive

func (v *VideoInfo) IsLive() bool

func (*VideoInfo) IsLiving

func (v *VideoInfo) IsLiving() bool

func (*VideoInfo) IsVideo

func (v *VideoInfo) IsVideo() bool

func (*VideoInfo) IsWaiting

func (v *VideoInfo) IsWaiting() bool

func (*VideoInfo) LiveStatusChanged added in v0.0.13

func (v *VideoInfo) LiveStatusChanged() bool

func (*VideoInfo) Living added in v1.0.0

func (v *VideoInfo) Living() bool

func (*VideoInfo) Logger added in v0.0.20

func (v *VideoInfo) Logger() *logrus.Entry

func (*VideoInfo) Site added in v1.0.0

func (v *VideoInfo) Site() string

func (*VideoInfo) TitleChanged added in v1.0.0

func (v *VideoInfo) TitleChanged() bool

func (*VideoInfo) Type

func (v *VideoInfo) Type() concern_type.Type

type VideoStatus

type VideoStatus int32
const (
	VideoStatus_Waiting VideoStatus = 0
	VideoStatus_Living  VideoStatus = 1
	VideoStatus_Upload  VideoStatus = 2
)

func (VideoStatus) Descriptor added in v1.1.1

func (VideoStatus) Enum added in v1.1.1

func (x VideoStatus) Enum() *VideoStatus

func (VideoStatus) EnumDescriptor deprecated

func (VideoStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use VideoStatus.Descriptor instead.

func (VideoStatus) Number added in v1.1.1

func (x VideoStatus) Number() protoreflect.EnumNumber

func (VideoStatus) String

func (x VideoStatus) String() string

func (VideoStatus) Type added in v1.1.1

type VideoType

type VideoType int32
const (
	VideoType_FirstLive VideoType = 0
	VideoType_Live      VideoType = 1
	VideoType_Video     VideoType = 2
)

func (VideoType) Descriptor added in v1.1.1

func (VideoType) Descriptor() protoreflect.EnumDescriptor

func (VideoType) Enum added in v1.1.1

func (x VideoType) Enum() *VideoType

func (VideoType) EnumDescriptor deprecated

func (VideoType) EnumDescriptor() ([]byte, []int)

Deprecated: Use VideoType.Descriptor instead.

func (VideoType) Number added in v1.1.1

func (x VideoType) Number() protoreflect.EnumNumber

func (VideoType) String

func (x VideoType) String() string

func (VideoType) Type added in v1.1.1

Jump to

Keyboard shortcuts

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