Skip to main content

qobuz-cli

PyPI Version

A fast, concurrent command-line music downloader for Qobuz.

Screenshot_2025-10-31_15-46-06 Screenshot_2025-10-31_15-48-08(1)

qobuz-cli (alias qcli) downloads music from your Qobuz account or library from the command line. It uses asyncio to download several tracks at once and shows progress with a Rich-based interface.

Features

  • Token-based login using your Qobuz auth token.
  • Concurrent downloads with a configurable number of workers.
  • Progress bars and session summaries powered by Rich.
  • Support for albums, tracks, artists, playlists, and label discographies.
  • Digital booklet (PDF) download when an album provides one.
  • Synced lyrics from LRCLIB, embedded in tags or written as .lrc files.
  • Optional ReplayGain tags (track gain and peak) from Qobuz.
  • A local archive that records downloaded tracks so they are not fetched again.
  • Path templating for full control over folder and file names, including conditional logic.
  • A --dry-run mode, plus reading URL lists from files or standard input.

Installation

qobuz-cli is on PyPI:

pip install qobuz-cli

or

uv pip install qobuz-cli

Getting Started

1. Initialize your configuration

You need to authenticate once before downloading. Qobuz has blocked direct email and password logins for third-party applications, so qobuz-cli authenticates with the auth token from your browser session.

How to get your auth token

  1. Open the Qobuz Web Player in your browser and log in.
  2. Press F12 to open the developer tools.
  3. Go to the Application tab (Chrome or Edge) or the Storage tab (Firefox).
  4. In the left sidebar, expand Local Storage and select https://play.qobuz.com.
  5. Find the localuser key.
  6. Expand its JSON value and copy the token string.

Then run:

qcli init <YOUR_AUTH_TOKEN>

This fetches the required API secrets from the Qobuz web player and writes a config.ini file to your system configuration directory.

Advanced: provide the app ID and secret manually

If the automatic secret fetch fails, for example after Qobuz changes their web player, you can supply the app credentials yourself. Both flags are required together:

qcli init <YOUR_AUTH_TOKEN> --app-id <APP_ID> --app-secret <APP_SECRET>

2. Start downloading

Pass any Qobuz URL to the download command:

qcli download https://play.qobuz.com/album/0093624949091

3. Explore the commands

qcli --help
qcli download --help

Usage and Examples

Basic downloads

# Download a single album
qcli download https://play.qobuz.com/album/abc123def456

# Download a single track
qcli download https://play.qobuz.com/track/123456789

# Download two albums with 16 workers at the highest quality,
# embedding art and using the original cover size
qcli download -w 16 -q 4 --embed-art --og-cover \
  https://play.qobuz.com/album/0093624949091 \
  https://play.qobuz.com/album/0093624949107

Bulk downloads

# Download an artist's discography, filtered to remove duplicate albums
qcli download --smart https://play.qobuz.com/artist/456789

# Download a public playlist
qcli download https://play.qobuz.com/playlist/987654321

# Download every release from a record label
qcli download https://play.qobuz.com/label/112233

# Download a discography and record it in the archive
qcli download --archive https://play.qobuz.com/artist/456789

Advanced downloading

# Download only full albums from a discography (skip singles and EPs)
qcli download --smart --albums-only https://play.qobuz.com/artist/456789

# Download a list of URLs from a text file, one URL per line
qcli download urls.txt

# Download URLs piped from another command
echo "https://play.qobuz.com/album/abc123def456" | qcli download --stdin

# Download only the album booklet PDF, skipping audio
qcli download --booklet-only https://play.qobuz.com/album/abc123def456

Customizing your downloads

# Choose a quality (1: MP3 320, 2: CD 16/44.1, 3: Hi-Res 24/96, 4: Hi-Res+ 24/192)
qcli download -q 3 https://play.qobuz.com/album/abc123def456

# Set the output folder and file name structure
qcli download -o "{albumartist}/{album} ({year})/{tracknumber}. {tracktitle}.{ext}" \
  https://play.qobuz.com/album/abc123def456

# List every path placeholder and the conditional syntax
qcli --output-help

Lyrics and ReplayGain

# Fetch synced lyrics from LRCLIB and embed them in tags
qcli download --lyrics https://play.qobuz.com/album/abc123def456

# Write lyrics as both embedded tags and a separate .lrc file
qcli download --lyrics --lyrics-mode both https://play.qobuz.com/album/abc123def456

# Write Qobuz ReplayGain tags to the downloaded files
qcli download --replaygain https://play.qobuz.com/album/abc123def456

File and artwork options

# Embed cover art in each file and skip the separate cover.jpg
qcli download --embed-art --no-cover https://play.qobuz.com/album/abc123def456

# Download cover art at its original resolution instead of 600x600
qcli download --og-cover https://play.qobuz.com/album/abc123def456

Simulate a download

Use --dry-run to see what the app would do without writing files. This is useful for testing output templates or checking what --smart or --albums-only will filter.

qcli download --dry-run https://play.qobuz.com/artist/456789

Commands Reference

  • qcli init <TOKEN>: Set up the configuration with your Qobuz auth token.
    • --force: Overwrite an existing configuration file without asking.
    • --app-id / --app-secret: Provide the API credentials manually instead of fetching them (both required together).
  • qcli download [URLS...]: Download music from Qobuz URLs or from files containing URLs.
    • -q, --quality: Set the audio quality (1 to 4).
    • -w, --workers: Number of simultaneous downloads (default 8).
    • -o, --output: Set the output path template.
    • -s, --smart: Filter discographies to remove duplicate albums.
    • --albums-only: Download only full albums from discographies.
    • --embed-art / --no-cover / --og-cover: Control cover art handling.
    • --lyrics and --lyrics-mode: Fetch synced lyrics (embed, lrc, or both).
    • --replaygain: Write ReplayGain tags.
    • --booklet-only: Download only the album booklet PDF.
    • --no-fallback: Skip a track if the requested quality is unavailable instead of downgrading.
    • --no-m3u: Do not create a .m3u file when downloading a playlist.
    • --archive / --no-archive: Enable or disable the download archive.
    • --dry-run: Simulate the download without writing files.
    • --stdin: Read URLs from standard input.
  • qcli validate: Check that the current configuration is valid and can be loaded.
  • qcli stats: Show archive statistics, such as total tracks and top artists.
  • qcli vacuum: Optimize the archive database file.
  • qcli clear-archive: Delete all records from the download archive.
    • --force: Skip the confirmation prompt.
  • qcli diagnose: Run checks for common configuration and connectivity issues.

Output Path Templating

Use the -o or --output option with placeholders to control file paths.

Example template:

{albumartist}/{album} ({year})/%{?is_multidisc,Disc {media_number}/|}{tracknumber}. {tracktitle}.{ext}

Result for a multi-disc album:

The Beatles/The Beatles (White Album) (1968)/Disc 1/01. Back in the U.S.S.R..flac

Result for a single-disc album:

Pink Floyd/The Dark Side of the Moon (1973)/01. Speak to Me.flac

For the full list of placeholders and the conditional syntax, run:

qcli --output-help

Acknowledgements

This project was built with reference to the following repositories, which were helpful for understanding the Qobuz API:

License

This project is licensed under the GPL-3.0-or-later. See the LICENSE file for details.

Metadata

Release files for qobuz-cli 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qobuz-cli 0.0.5
File Size Uploaded Provenance Actions
qobuz_cli-0.0.5.tar.gz 144.8 kB Without provenance Details for qobuz_cli-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qobuz-cli 0.0.5
File Interpreter ABI Platform Actions
qobuz_cli-0.0.5-py3-none-any.whl Python 3 none any Details for qobuz_cli-0.0.5-py3-none-any.whl

Total release size: 214.9 kB

Release files / qobuz_cli-0.0.5.tar.gz

Download URL qobuz_cli-0.0.5.tar.gz
Size 144.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3cbc984d525514e04695b57802057fc290fa1422cf00f2893bd612be25e72883
BLAKE2b-256 checksum
How to use checksums
3a660d8917777a7a193fced6a0e14a3eb445c47d09b6b1bf234ea8835e43ec64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / qobuz_cli-0.0.5-py3-none-any.whl

Download URL qobuz_cli-0.0.5-py3-none-any.whl
Size 70.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81cb65705d21b9c1a08f7b5ae39fe7fbc9192326320fafcd2271da2ef1584e8f
BLAKE2b-256 checksum
How to use checksums
c8d595539cba28161c62c835833e9610513e0b8086785457a2661e54765da04c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for qobuz-cli 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page