Skip to content

Error fetching license exchange data (Status code: 429) #306

Open

Description

@r-olaf

Upgraded from 2.9 to 3.7.1, suddenly started experiencing these errors on every song when trying to pull any song or playlist or album:

192:~ user$ gamdl "https://music.apple.com/pl/album/do-it-again/1650885288?i=1650885292&l=pl"
[INFO     18:44:33] Starting Gamdl 3.7.1
[INFO     18:44:35] [URL   1/1  ] Processing "https://music.apple.com/pl/album/do-it-again/1650885288?i=1650885292&l=pl"
[INFO     18:44:35] [Track   1/1  ] Downloading "Do It Again"
Traceback (most recent call last):
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/api/apple_music.py", line 735, in get_license_exchange
    response.raise_for_status()
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/httpx/_models.py", line 829, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://play.itunes.apple.com/WebObjects/MZPlay.woa/wa/acquireWebPlaybackLicense'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/cli/cli.py", line 271, in main
    await downloader.download(download_item)
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/downloader/downloader.py", line 82, in download
    raise item.media.error
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/interface/interface.py", line 115, in _get_song_media
    async for media in self.song.get_media(media):
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/interface/song.py", line 594, in get_media
    audio_track=await self.base.get_decryption_key(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/interface/base.py", line 180, in get_decryption_key
    license = await self.apple_music_api.get_license_exchange(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/.local/pipx/venvs/gamdl/lib/python3.12/site-packages/gamdl/api/apple_music.py", line 738, in get_license_exchange
    raise GamdlApiResponseError(
gamdl.api.exceptions.GamdlApiResponseError: Error fetching license exchange data (Status code: 429)
[ERROR    18:44:35] [Track   1/1  ] Error downloading "Do It Again"
[INFO     18:44:35] Finished with 1 error(s)
192:~ user$ 

Activity

  1. schiffko commented on Jun 3, 2026

    @schiffko

    yes, same problem here!

  2. amaurieboese commented on Jun 3, 2026

    @amaurieboese

    same here

  3. scarlimange commented on Jun 6, 2026

    @scarlimange

    I think this is a server side rate limit because it only happens at least half way through large downloads and then keeps happening when I try to run a different download from the beginning

  4. wp3gi commented on Jul 9, 2026

    @wp3gi

    Does this ever return back to normal?

  5. scarlimange commented on Jul 9, 2026

    @scarlimange

    Just wait a couple hours and shrink the playlist you're grabbing

  6. twinfami commented on Jul 16, 2026

    @twinfami

    Did just that and it's still throwing up those errors a few hours later. Maybe there needs to be a cooldown added or in this case I have, if the song is already there, to automatically skip downloading and NOT queue for the license. Check the local file name FIRST, then skip if there. So if there were songs it didn't download and later on I try to download them again, it doesn't throw the error up and just grab what was missed the first time.

  7. twinfami commented on Jul 16, 2026

    @twinfami

    Just wait a couple hours and shrink the playlist you're grabbing

    We shouldn't have to shrink our playlists. This program should work better so that it doesn't keep pinging the server when not needed.

  8. wp3gi commented on Jul 21, 2026

    @wp3gi

    Can the 429 error be solved by using another account's cookie.txt? or do you also need a different IP address or device?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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