Skip to content

404 - resource not found error #185

Open
@llorban

Description

@llorban

Downloaded several tracks and albums nicely, but started generating a 404 resource not found error after a few trials. The cookies were re-exported but no luck:

macos ~ % gamdl "https://music.apple.com/us..."
[INFO     19:54:16] Starting Gamdl
[WARNING  19:54:17] mp4decrypt not found at "mp4decrypt", music videos will not be downloaded
[INFO     19:54:17] (URL 1/1) Checking "https://music.apple.com/us/..."
[ERROR    19:54:17] (URL 1/1) Failed to check "https://music.apple.com/us..."
Traceback (most recent call last):
  File "/macos/lib/python3.13/site-packages/gamdl/apple_music_api.py", line 76, in _check_amp_api_response
    response.raise_for_status()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/macos/lib/python3.13/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://amp-api.music.apple.com/v1/catalog/CA...

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "macos/lib/python3.13/site-packages/gamdl/cli.py", line 475, in main
    download_queue = downloader.get_download_queue(url_info)
  File "macos/lib/python3.13/site-packages/gamdl/downloader.py", line 140, in get_download_queue
    return self._get_download_queue(url_info.type, url_info.id)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "macos/lib/python3.13/site-packages/gamdl/downloader.py", line 150, in _get_download_queue
    download_queue.tracks_metadata = [self.apple_music_api.get_song(id)]
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "macos/lib/python3.13/site-packages/gamdl/apple_music_api.py", line 124, in get_song
    self._check_amp_api_response(response)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "macos/lib/python3.13/site-packages/gamdl/apple_music_api.py", line 84, in _check_amp_api_response
    raise_response_exception(response)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "macos/lib/python3.13/site-packages/gamdl/utils.py", line 10, in raise_response_exception
    raise Exception(
        f"Request failed with status code {response.status_code}: {response.text}"
    )
Exception: Request failed with status code 404: {"errors":[{"id":"FET4LE42CD3ULCDDRO4ISLPNJI","title":"Resource Not Found","detail":"Resource with requested id was not found","status":"404","code":"40400"}]}
[INFO     19:54:17] Done (1 error(s))
macos ~ % 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions