From 237e0a232aa90fba4eace9b3a4d0dbe4cd9c5ee5 Mon Sep 17 00:00:00 2001 From: Nathan Thomas Date: Mon, 13 Dec 2021 17:28:19 -0800 Subject: [PATCH] More helpful description for WrongLicense error --- streamrip/clients.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/streamrip/clients.py b/streamrip/clients.py index c7750d9..def8c79 100644 --- a/streamrip/clients.py +++ b/streamrip/clients.py @@ -567,7 +567,14 @@ class DeezerClient(Client): } token = track_info["TRACK_TOKEN"] - url = self.client.get_track_url(token, format_str) + try: + url = self.client.get_track_url(token, format_str) + except deezer.WrongLicence: + raise NonStreamable( + "The requested quality is not available with your subscription. " + "Deezer HiFi is required for quality 2. Otherwise, the maximum " + "quality allowed is 1." + ) if url is None: url = self._get_encrypted_file_url(