Documentation
¶
Index ¶
- Constants
- func FallbackCredentials() (clientID, clientSecret string)
- type Providers
- type Session
- type YouTubeAllProvider
- func (p *YouTubeAllProvider) Authenticate() error
- func (p *YouTubeAllProvider) Close()
- func (p *YouTubeAllProvider) Name() string
- func (p *YouTubeAllProvider) Playlists() ([]playlist.PlaylistInfo, error)
- func (p *YouTubeAllProvider) Refresh()
- func (p *YouTubeAllProvider) Tracks(id string) ([]playlist.Track, error)
- type YouTubeMusicProvider
- func (p *YouTubeMusicProvider) Authenticate() error
- func (p *YouTubeMusicProvider) Close()
- func (p *YouTubeMusicProvider) Name() string
- func (p *YouTubeMusicProvider) Playlists() ([]playlist.PlaylistInfo, error)
- func (p *YouTubeMusicProvider) Refresh()
- func (p *YouTubeMusicProvider) Tracks(id string) ([]playlist.Track, error)
- type YouTubeProvider
Constants ¶
const CallbackPort = 19873
CallbackPort is the fixed port for the OAuth2 callback server. Must match the redirect URI registered in the Google Cloud console.
Variables ¶
This section is empty.
Functions ¶
func FallbackCredentials ¶
func FallbackCredentials() (clientID, clientSecret string)
FallbackCredentials returns a random credential pair from the built-in pool, or empty strings if the pool is empty.
Types ¶
type Providers ¶
type Providers struct {
Music *YouTubeMusicProvider
Video *YouTubeProvider
All *YouTubeAllProvider
}
Providers holds the YouTube Music, YouTube, and YouTube All providers, sharing a single OAuth session.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session manages a YouTube Data API v3 service for YouTube Music integration.
func NewSession ¶
NewSession creates a YouTube API session, using stored credentials if available, otherwise starting an interactive OAuth2 flow.
func NewSessionSilent ¶
NewSessionSilent is like NewSession but only uses stored credentials. Returns an error if interactive auth is required.
type YouTubeAllProvider ¶
type YouTubeAllProvider struct {
// contains filtered or unexported fields
}
YouTubeAllProvider shows all playlists regardless of classification.
func (*YouTubeAllProvider) Authenticate ¶
func (p *YouTubeAllProvider) Authenticate() error
func (*YouTubeAllProvider) Close ¶
func (p *YouTubeAllProvider) Close()
func (*YouTubeAllProvider) Name ¶
func (p *YouTubeAllProvider) Name() string
func (*YouTubeAllProvider) Playlists ¶
func (p *YouTubeAllProvider) Playlists() ([]playlist.PlaylistInfo, error)
func (*YouTubeAllProvider) Refresh ¶
func (p *YouTubeAllProvider) Refresh()
type YouTubeMusicProvider ¶
type YouTubeMusicProvider struct {
// contains filtered or unexported fields
}
YouTubeMusicProvider shows playlists classified as music content.
func (*YouTubeMusicProvider) Authenticate ¶
func (p *YouTubeMusicProvider) Authenticate() error
func (*YouTubeMusicProvider) Close ¶
func (p *YouTubeMusicProvider) Close()
func (*YouTubeMusicProvider) Name ¶
func (p *YouTubeMusicProvider) Name() string
func (*YouTubeMusicProvider) Playlists ¶
func (p *YouTubeMusicProvider) Playlists() ([]playlist.PlaylistInfo, error)
func (*YouTubeMusicProvider) Refresh ¶
func (p *YouTubeMusicProvider) Refresh()
type YouTubeProvider ¶
type YouTubeProvider struct {
// contains filtered or unexported fields
}
YouTubeProvider shows playlists classified as non-music (video) content.
func (*YouTubeProvider) Authenticate ¶
func (p *YouTubeProvider) Authenticate() error
func (*YouTubeProvider) Close ¶
func (p *YouTubeProvider) Close()
func (*YouTubeProvider) Name ¶
func (p *YouTubeProvider) Name() string
func (*YouTubeProvider) Playlists ¶
func (p *YouTubeProvider) Playlists() ([]playlist.PlaylistInfo, error)
func (*YouTubeProvider) Refresh ¶
func (p *YouTubeProvider) Refresh()