diff --git a/streamrip/clients.py b/streamrip/clients.py index ccfd043..406d6ae 100644 --- a/streamrip/clients.py +++ b/streamrip/clients.py @@ -122,7 +122,7 @@ class QobuzClient(Client): return if (kwargs.get("app_id") or kwargs.get("secrets")) in (None, [], ""): - click.secho("Fetching tokens, this may take a few seconds.") + click.secho("Fetching tokens — this may take a few seconds.", fg='magenta') logger.info("Fetching tokens from Qobuz") spoofer = Spoofer() kwargs["app_id"] = spoofer.get_app_id() diff --git a/streamrip/media.py b/streamrip/media.py index 90d9404..366b4da 100644 --- a/streamrip/media.py +++ b/streamrip/media.py @@ -265,9 +265,11 @@ class Track(Media): if self.client.source in ("qobuz", "tidal", "deezer"): assert isinstance(dl_info, dict) logger.debug("Downloadable URL found: %s", dl_info.get("url")) - tqdm_download( - dl_info["url"], self.path, desc=self._progress_desc - ) # downloads file + try: + download_url = dl_info["url"] + except KeyError as e: + click.secho(f"Panic: {e} dl_info = {dl_info}", fg="red") + tqdm_download(download_url, self.path, desc=self._progress_desc) elif self.client.source == "soundcloud": assert isinstance(dl_info, dict) # for typing