acgonzales / pydeezer

A package to search and download musics on Deezer.
The Unlicense
53 stars 14 forks source link

Fix keys to access deezer data dict #28

Closed Notmarrco closed 2 years ago

Notmarrco commented 3 years ago

Fix errors when trying to download using the cli.

Error

Traceback (most recent call last):
  File "pydeezer/venv/bin/pydeezer", line 11, in <module>
    load_entry_point('py-deezer', 'console_scripts', 'pydeezer')()
  File "pydeezer/venv/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "pydeezer/venv/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "pydeezer/venv/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "pydeezer/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "pydeezer/venv/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "pydeezer/pydeezer/cli.py", line 178, in download
    answers = prompt(questions)
  File "pydeezer/venv/lib/python3.9/site-packages/PyInquirer/prompt.py", line 34, in prompt
    question['choices'] = choices(answers)
  File "pydeezer/pydeezer/cli.py", line 74, in search_choices
    return [{
  File "pydeezer/pydeezer/cli.py", line 75, in <listcomp>
    "name": artist["name"],
TypeError: string indices must be integers