clients

package
v0.0.0-...-f23b7a0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YoutubeVideoType   = "youtube#video"
	YoutubeChannelType = "youtube#channel"
)

Variables

Functions

This section is empty.

Types

type TagMap

type TagMap map[string][]string

type VideoInfo

type VideoInfo struct {
	VideoID      string
	ThumbnailURL string
	Title        string
	Tags         []string
}

func (*VideoInfo) ToEntity

func (v *VideoInfo) ToEntity() *musics.Music

type VideoInfos

type VideoInfos []VideoInfo

func (*VideoInfos) ToEntity

func (vs *VideoInfos) ToEntity() musics.Musics

type YoutubeClient

type YoutubeClient interface {
	GetMusicDetail(videoID string) (*VideoInfo, error)
	GetMusics(videoIDs []string) (VideoInfos, error)
	SearchPlaylist(q string, order string, pageToken string) (*v3.SearchListResponse, error)
	ParseVideoIds(items []*v3.SearchResult) []string
	ParseVideoTags(ids []string) (TagMap, error)
}

func NewYoutubeClient

func NewYoutubeClient(config *configs.Config) (YoutubeClient, error)

Jump to

Keyboard shortcuts

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