vitiko98 / qobuz-dl

A complete Lossless and Hi-Res music downloader for Qobuz
GNU General Public License v3.0
1.45k stars 192 forks source link

Downloading Spotify Playlist Gives 400 Client Error: Bad Request #286

Open adamfisher opened 2 months ago

adamfisher commented 2 months ago

I get an error when trying to download a Spotify playlist (it's public). It errors out saying the request was invalid.

PS C:\> qobuz-dl dl https://open.spotify.com/playlist/7nr40V8A1xIuszQ9OT3XhX -q 27 --embed-art -ff "{artist} - {tracktitle}"
Logging...
Logged: OK
Membership: Studio
Set max quality: 27 - 24 bit, >96kHz

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python312\Scripts\qobuz-dl.exe\__main__.py", line 7, in <module>
  File "C:\Python312\Lib\site-packages\qobuz_dl\cli.py", line 176, in main
    _handle_commands(qobuz, arguments)
  File "C:\Python312\Lib\site-packages\qobuz_dl\cli.py", line 83, in _handle_commands
    qobuz.download_list_of_urls(arguments.SOURCE)
  File "C:\Python312\Lib\site-packages\qobuz_dl\core.py", line 180, in download_list_of_urls
    self.handle_url(url)
  File "C:\Python312\Lib\site-packages\qobuz_dl\core.py", line 136, in handle_url
    content = [item for item in type_dict["func"](item_id)]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\qobuz_dl\qopy.py", line 139, in multi_meta
    j = self.api_call(epoint, id=id, offset=offset, type=type)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\qobuz_dl\qopy.py", line 120, in api_call
    r.raise_for_status()
  File "C:\Python312\Lib\site-packages\requests\models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.qobuz.com/api.json/0.2/playlist/get?extra=tracks&playlist_id=7nr40V8A1xIuszQ9OT3XhX&limit=500&offset=0

Plugging that invalid request URL into a browser gives:

{
"code": 400,
"message": "Invalid or missing app_id parameter (Root=1-66d5f706-7ecd848f1ebd53f7769d0663)",
"status": "error"
}
ELKUBODELAVEGA commented 2 months ago

I join in the request, same thing

marekromk commented 5 days ago

Directly downloading a Spotify playlist is not supported. Downloading a spotify playlist through last.fm is supported though