From 2026693108949b780da7315aad0be039be84b99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Janis=20Robert=20K=C3=B6nig?= Date: Thu, 13 Nov 2025 19:33:16 +0100 Subject: [PATCH] Add lossless support Hooking up the changes from https://github.com/kokarare1212/librespot-python/pull/316 --- README.md | 4 ++-- zotify/app.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 443991e..c6caa84 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Set arguments in the commandline like this: `-ie False` or `--codec mp3`. Wrap c | Encoding Options | Command Line Config Flag | Description | Default Value | |------------------------------|-------------------------------------|------------------------------------------------------------------------------------------|---------------| | `DOWNLOAD_FORMAT` | `--codec`, `--download-format` | Audio codec of downloads, copy avoids remuxing (aac, fdk_aac, mp3, ogg, opus, vorbis) | copy | -| `DOWNLOAD_QUALITY` | `-q`, `--download-quality` | Audio quality of downloads, auto selects highest available (normal, high, very_high*) | auto | +| `DOWNLOAD_QUALITY` | `-q`, `--download-quality` | Audio quality of downloads, auto selects highest available (normal, high, very_high*, lossless*) | auto | | `TRANSCODE_BITRATE` | `-b`, `--bitrate` | Overwrite the bitrate for FFMPEG encoding (not recommended) | | | Archive Options | Command Line Config Flag | Description | Default Value | @@ -194,7 +194,7 @@ Set arguments in the commandline like this: `-ie False` or `--codec mp3`. Wrap c | `PRINT_API_ERRORS` | `--print-api-errors` | Show API errors | True | | `FFMPEG_LOG_LEVEL` | `--ffmpeg-log-level` | FFMPEG's logged level of detail when completing a transcoded download | error | -\* very_high (320k) is limited to Premium accounts only +\* very_high (320k) and lossless is limited to Premium accounts only diff --git a/zotify/app.py b/zotify/app.py index 9a68467..4e72e3a 100644 --- a/zotify/app.py +++ b/zotify/app.py @@ -230,10 +230,11 @@ def client(args: Namespace) -> None: Printer.splash() quality_options = { - 'auto': AudioQuality.VERY_HIGH if Zotify.check_premium() else AudioQuality.HIGH, - 'normal': AudioQuality.NORMAL, - 'high': AudioQuality.HIGH, - 'very_high': AudioQuality.VERY_HIGH + "auto": AudioQuality.VERY_HIGH if Zotify.check_premium() else AudioQuality.HIGH, + "normal": AudioQuality.NORMAL, + "high": AudioQuality.HIGH, + "very_high": AudioQuality.VERY_HIGH, + "lossless": AudioQuality.LOSSLESS, } Zotify.DOWNLOAD_QUALITY = quality_options.get(Zotify.CONFIG.get_download_quality(), quality_options["auto"])