More helpful description for WrongLicense error

This commit is contained in:
Nathan Thomas 2021-12-13 17:28:19 -08:00
parent 6719676b6e
commit 237e0a232a
1 changed files with 8 additions and 1 deletions

View File

@ -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(