Expand description
§Qobuz API Rust Client
A comprehensive Rust client library for interacting with the Qobuz music streaming API. This library provides functionality for authentication, content retrieval, favorites management, and metadata handling for Qobuz music content.
§Features
- API Access: Full access to Qobuz API endpoints for albums, artists, tracks, playlists, and more
- Authentication: Support for both user-based and token-based authentication
- Content Management: Search, retrieve, and manage Qobuz content including albums, tracks, and playlists
- Metadata Handling: Extract and embed comprehensive metadata in audio files
- Download Support: Download tracks and albums with various quality options
- Format Support: Support for various audio formats including FLAC and MP3 with different quality levels
§Getting Started
To use this library, you’ll need to initialize the QobuzApiService which handles API communication and authentication. The service can automatically fetch application credentials from the Qobuz web player or use custom credentials.
use qobuz_api_rust::QobuzApiService;
#[tokio::main]
async fn main() -> Result<(), qobuz_api_rust::QobuzApiError> {
// Initialize the service with automatic credential fetching
let mut service = QobuzApiService::new().await?;
// Authenticate using environment variables
service.authenticate_with_env().await?;
// Search for content
let search_results = service.search_albums("Miles Davis", Some(10), None, None).await?;
Ok(())
}§Authentication
The library supports multiple authentication methods:
- Token-based authentication using user ID and auth token
- Email/password authentication
- Username/password authentication
Set the appropriate environment variables in your .env file:
- For token-based:
QOBUZ_USER_IDandQOBUZ_USER_AUTH_TOKEN - For email-based:
QOBUZ_EMAILandQOBUZ_PASSWORD - For username-based:
QOBUZ_USERNAMEandQOBUZ_PASSWORD
§Modules
- api: Core API functionality and service implementation
- errors: Custom error types for the library
- metadata: Metadata extraction and embedding utilities
- models: Data models for API responses
- utils: Utility functions for common operations
§License
This library is distributed under the GPL-3.0-or-later license.