youtube

package
v0.0.0-...-04ff805 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 11 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel youtube.Channel

func (*Channel) ChannelId

func (ch *Channel) ChannelId() string

func (*Channel) Title

func (ch *Channel) Title() string

ch.Snippet.Title is account title or showName, not username(username is like https://www.youtube.com/user/mttp88/videos)

type CommentThread

type CommentThread youtube.CommentThread

type Url

type Url struct {
	Type      UrlType
	ChannelId string
	Username  string
	VideoId   string
}

func ParseUrl

func ParseUrl(url string) (*Url, error)

user,channel,video

type UrlType

type UrlType string
var (
	UrlTypeUnknown UrlType = ""
	UrlTypeHome    UrlType = "home"
	UrlTypeUser    UrlType = "user"
	UrlTypeChannel UrlType = "channel"
	UrlTypeVideo   UrlType = "video"
)

type Video

type Video youtube.Video

type Youtube

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

func NewWithKey

func NewWithKey(key, proxy string) (*Youtube, error)

NewYoutubeService create youtube client

func (Youtube) GetAllPlaylists

func (yt Youtube) GetAllPlaylists() ([]*youtube.Playlist, error)

Gets all playlists of current user - maxResult is set to 50 (default is 5) returns array of all playlists (id, name, count)

func (Youtube) GetChannelById

func (yt Youtube) GetChannelById(channelId string) (*Channel, error)

func (Youtube) GetChannelByUsername

func (yt Youtube) GetChannelByUsername(forUsername string) (*Channel, error)

根据用户名查询Channel信息 example: "TIME" The getChannelInfo uses forUsername to get info (id, tittle, totalViews and description)

func (Youtube) GetComments

func (yt Youtube) GetComments(videoID string) ([]*CommentThread, error)

warning: 只是一部分评论

func (Youtube) GetVideo

func (yt Youtube) GetVideo(videoId string) (*Video, error)

func (Youtube) GetVideosByChannelId

func (yt Youtube) GetVideosByChannelId(channelId string, publishAfter *time.Time) ([]string, error)

不可以检索完整的视频信息,要详细的视频信息还是要调用GetVideoInfo接口

Jump to

Keyboard shortcuts

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