Documentation
¶
Overview ¶
Package spotify provides Spotify Web API integration for podcast metadata retrieval.
Requirements: - Spotify Developer Account: Required to obtain Client ID and Client Secret - Client Credentials: Stored in .env file via fabric --setup
The implementation uses OAuth2 Client Credentials flow for authentication. Note: The Spotify Web API does NOT provide access to podcast transcripts. For transcript functionality, users should use fabric's --transcribe-file feature with audio obtained from other sources.
Index ¶
- type EpisodeMetadata
- type SearchResult
- type ShowMetadata
- type Spotify
- func (s *Spotify) FormatMetadataAsText(metadata any) string
- func (s *Spotify) GetEpisodeMetadata(episodeId string) (*EpisodeMetadata, error)
- func (s *Spotify) GetShowEpisodes(showId string, limit int) ([]EpisodeMetadata, error)
- func (s *Spotify) GetShowMetadata(showId string) (*ShowMetadata, error)
- func (s *Spotify) GetShowOrEpisodeId(urlStr string) (showId string, episodeId string, err error)
- func (s *Spotify) GrabMetadataForURL(urlStr string) (any, error)
- func (s *Spotify) SearchShows(query string, limit int) (*SearchResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpisodeMetadata ¶
type EpisodeMetadata struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ReleaseDate string `json:"release_date"`
DurationMs int `json:"duration_ms"`
DurationMinutes int `json:"duration_minutes"`
Language string `json:"language"`
Explicit bool `json:"explicit"`
ExternalURL string `json:"external_url"`
AudioPreviewURL string `json:"audio_preview_url,omitempty"`
ImageURL string `json:"image_url,omitempty"`
ShowId string `json:"show_id"`
ShowName string `json:"show_name"`
}
EpisodeMetadata represents metadata for a Spotify episode.
type SearchResult ¶
type SearchResult struct {
Shows []ShowMetadata `json:"shows"`
}
SearchResult represents a search result item.
type ShowMetadata ¶
type ShowMetadata struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Publisher string `json:"publisher"`
TotalEpisodes int `json:"total_episodes"`
Languages []string `json:"languages"`
MediaType string `json:"media_type"`
ExternalURL string `json:"external_url"`
ImageURL string `json:"image_url,omitempty"`
}
ShowMetadata represents metadata for a Spotify show (podcast).
type Spotify ¶
type Spotify struct {
*plugins.PluginBase
ClientId *plugins.SetupQuestion
ClientSecret *plugins.SetupQuestion
// contains filtered or unexported fields
}
Spotify represents a Spotify API client.
func (*Spotify) FormatMetadataAsText ¶
FormatMetadataAsText formats metadata as human-readable text suitable for LLM processing.
func (*Spotify) GetEpisodeMetadata ¶
func (s *Spotify) GetEpisodeMetadata(episodeId string) (*EpisodeMetadata, error)
GetEpisodeMetadata retrieves metadata for a Spotify episode.
func (*Spotify) GetShowEpisodes ¶
func (s *Spotify) GetShowEpisodes(showId string, limit int) ([]EpisodeMetadata, error)
GetShowEpisodes retrieves episodes for a given show.
func (*Spotify) GetShowMetadata ¶
func (s *Spotify) GetShowMetadata(showId string) (*ShowMetadata, error)
GetShowMetadata retrieves metadata for a Spotify show (podcast).
func (*Spotify) GetShowOrEpisodeId ¶
GetShowOrEpisodeId extracts show or episode ID from a Spotify URL.
func (*Spotify) GrabMetadataForURL ¶
GrabMetadataForURL retrieves metadata for a Spotify URL (show or episode).
func (*Spotify) SearchShows ¶
func (s *Spotify) SearchShows(query string, limit int) (*SearchResult, error)
SearchShows searches for podcasts/shows matching the query.