youtube

package
v0.0.0-...-eb4b608 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoVideoFound = errors.New("no video found")

Functions

This section is empty.

Types

type ContentDetails

type ContentDetails struct {
	Duration          string `json:"duration"`
	RegionRestriction struct {
		Allowed []string `json:"allowed"`
		Blocked []string `json:"blocked"`
	} `json:"regionRestriction"`
}

func (*ContentDetails) ParseDuration

func (c *ContentDetails) ParseDuration() (*duration.Duration, error)

type Plugin

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

func New

func New(credentialService model.CredentialService) *Plugin

func (*Plugin) Commands

func (p *Plugin) Commands() []telebot.Command

func (*Plugin) Handlers

func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler

func (*Plugin) Name

func (p *Plugin) Name() string
func (p *Plugin) OnYouTubeLink(c plugin.GobotContext) error

type Response

type Response struct {
	Items []Video `json:"items"`
}

type SearchResponse

type SearchResponse struct {
	Items []struct {
		ID struct {
			VideoID string `json:"videoId"`
		} `json:"id"`
	} `json:"items"`
}

type Video

type Video struct {
	ID      string `json:"id"`
	Snippet struct {
		PublishedAt  time.Time `json:"publishedAt"`
		ChannelID    string    `json:"channelId"`
		Title        string    `json:"title"`
		ChannelTitle string    `json:"channelTitle"`
	} `json:"snippet"`
	ContentDetails ContentDetails `json:"contentDetails"`
	Statistics     struct {
		ViewCount    uint64 `json:"viewCount,string"`
		LikeCount    uint64 `json:"likeCount,string"`
		CommentCount uint64 `json:"commentCount,string"`
	} `json:"statistics"`
	LiveStreamingDetails struct {
		ActualStartTime    time.Time `json:"actualStartTime"`
		ActualEndTime      time.Time `json:"actualEndTime"`
		ConcurrentViewers  uint64    `json:"concurrentViewers,string"`
		ScheduledStartTime time.Time `json:"scheduledStartTime"`
		ScheduledEndTime   time.Time `json:"scheduledEndTime"`
	} `json:"liveStreamingDetails"`
}

func (*Video) BlockedInGermany

func (v *Video) BlockedInGermany() bool

func (*Video) IsLive

func (v *Video) IsLive() bool

func (*Video) IsLiveNow

func (v *Video) IsLiveNow() bool

func (*Video) IsPremiere

func (v *Video) IsPremiere() bool

func (*Video) IsScheduledLive

func (v *Video) IsScheduledLive() bool

func (*Video) WasLive

func (v *Video) WasLive() bool

Jump to

Keyboard shortcuts

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