Documentation
¶
Overview ¶
Package qobuz implements a cliamp music provider for Qobuz.
It authenticates via the interactive OAuth browser flow, scrapes the app_id / signing secrets / OAuth private key from the Qobuz web player bundle.js, and resolves signed CDN stream URLs through the legacy track/getFileUrl endpoint. Those URLs are routed through cliamp's buffer-while-playing + ffmpeg pipeline (see IsStreamURL and RegisterBufferedURLMatcher in main.go), the same path used by the Navidrome, Jellyfin, Emby and Plex providers.
Source material consulted for the reverse-engineered API surface:
- Aeneaj/qobuz-dl-go: Go client (primary template for signing, bundle scraping and OAuth).
- DashLt/spoofbuz: secret/seed extraction from bundle.js.
- SofusA/qobine, qobuz-player-controls/examples/qobuz-api.md: a comprehensive reverse-engineered Qobuz API reference used to cross-check signing, the OAuth flow, format IDs and the legacy-vs-segmented (/file/url) streaming distinction.
Index ¶
- func CredsPath() (string, error)
- func DeleteCreds() (bool, error)
- func IsStreamURL(u string) bool
- func SetAuthURLObserver(fn func(string))
- type QobuzProvider
- func (p *QobuzProvider) AlbumList(_ string, offset, size int) ([]provider.AlbumInfo, error)
- func (p *QobuzProvider) AlbumSortTypes() []provider.SortType
- func (p *QobuzProvider) AlbumTracks(albumID string) ([]playlist.Track, error)
- func (p *QobuzProvider) ArtistAlbums(artistID string) ([]provider.AlbumInfo, error)
- func (p *QobuzProvider) Artists() ([]provider.ArtistInfo, error)
- func (p *QobuzProvider) Authenticate() error
- func (p *QobuzProvider) Close()
- func (p *QobuzProvider) DefaultAlbumSort() string
- func (p *QobuzProvider) Name() string
- func (p *QobuzProvider) Playlists() ([]playlist.PlaylistInfo, error)
- func (p *QobuzProvider) Refresh()
- func (p *QobuzProvider) SearchTracks(ctx context.Context, query string, limit int) ([]playlist.Track, error)
- func (p *QobuzProvider) Tracks(playlistID string) ([]playlist.Track, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCreds ¶
DeleteCreds removes the stored Qobuz credentials file. Returns true if a file was removed, false if it did not exist.
func IsStreamURL ¶
IsStreamURL reports whether u is a Qobuz signed stream URL previously resolved by the provider. It is registered with the player's buffered-URL matcher in main.go.
func SetAuthURLObserver ¶
func SetAuthURLObserver(fn func(string))
SetAuthURLObserver registers a callback invoked once with the OAuth URL at the start of an interactive sign-in. Pass nil to remove.
Types ¶
type QobuzProvider ¶
type QobuzProvider struct {
// contains filtered or unexported fields
}
QobuzProvider implements playlist.Provider backed by the Qobuz API. Streaming URLs are resolved per track via track/getFileUrl and routed through the player's buffered pipeline (see stream.go).
func New ¶
func New(quality int) *QobuzProvider
New creates a QobuzProvider. Authentication is deferred until the user first selects the provider. quality is the preferred Qobuz format_id.
func (*QobuzProvider) AlbumList ¶
AlbumList returns the user's favorite albums (Qobuz has no global album catalog to browse). Implements provider.AlbumBrowser.
func (*QobuzProvider) AlbumSortTypes ¶
func (p *QobuzProvider) AlbumSortTypes() []provider.SortType
func (*QobuzProvider) AlbumTracks ¶
func (p *QobuzProvider) AlbumTracks(albumID string) ([]playlist.Track, error)
AlbumTracks returns the tracks of an album. Implements provider.AlbumTrackLoader.
func (*QobuzProvider) ArtistAlbums ¶
func (p *QobuzProvider) ArtistAlbums(artistID string) ([]provider.AlbumInfo, error)
ArtistAlbums returns the albums of an artist. Implements provider.ArtistBrowser.
func (*QobuzProvider) Artists ¶
func (p *QobuzProvider) Artists() ([]provider.ArtistInfo, error)
Artists returns the user's favorite artists. Implements provider.ArtistBrowser.
func (*QobuzProvider) Authenticate ¶
func (p *QobuzProvider) Authenticate() error
Authenticate runs the interactive OAuth sign-in flow (opens a browser, waits for the redirect). Implements playlist.Authenticator.
func (*QobuzProvider) Close ¶
func (p *QobuzProvider) Close()
Close cancels any in-progress sign-in. Implements provider.Closer.
func (*QobuzProvider) DefaultAlbumSort ¶
func (p *QobuzProvider) DefaultAlbumSort() string
func (*QobuzProvider) Name ¶
func (p *QobuzProvider) Name() string
func (*QobuzProvider) Playlists ¶
func (p *QobuzProvider) Playlists() ([]playlist.PlaylistInfo, error)
Playlists returns the user's Qobuz playlists plus synthetic Favorite Tracks and Random Tracks entries.
func (*QobuzProvider) Refresh ¶
func (p *QobuzProvider) Refresh()
Refresh clears cached playlists and tracks so the next call re-fetches and re-resolves streaming URLs (which expire). Implements playlist.Refresher.
func (*QobuzProvider) SearchTracks ¶
func (p *QobuzProvider) SearchTracks(ctx context.Context, query string, limit int) ([]playlist.Track, error)
SearchTracks searches the Qobuz catalog. Implements provider.Searcher.