Better output

Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
nathom 2021-07-09 14:19:25 -07:00
parent 5cd3913976
commit 2b68b96204
2 changed files with 6 additions and 4 deletions

View file

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