Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.64k stars 108 forks source link

Spotify Rate Limit #411

Closed KellyFromSales closed 2 weeks ago

KellyFromSales commented 2 weeks ago

Describe the bug

I'm trying to import my extended listening history going back to 2010. I was able to import around 65k without issue, but now it always fails

image

looking through my docker logs, after the 10th retry an error is displayed and it looks like i'm hitting a rate limit.

I've tried making a file only a few entries, the 12 in the example above, but it made no difference. I've tried leaving it overnight with no difference. I've also tried importing a file i know worked previously, but I'm encountering the same issue.

Looking at the docs, it looks like they work on a rolling 30 second api rate limit, so i'm confused what's going on.

Expected behavior

Running an import finishes successfully

Additional context

response: {
    status: 429,
    statusText: 'Too Many Requests',
    headers: Object [AxiosHeaders] {
      'cache-control': 'private, max-age=0',
      'retry-after': '7293',
      'access-control-allow-origin': '*',
      'access-control-allow-headers': 'Accept, App-Platform, Authorization, Content-Type, Origin, Retry-After, Spotify-App-Version, X-Cloud-Trace-Context, client-token, content-access-token',
      'access-control-allow-methods': 'GET, POST, OPTIONS, PUT, DELETE, PATCH',
      'access-control-allow-credentials': 'true',
      'access-control-max-age': '604800',
      'strict-transport-security': 'max-age=31536000',
      'x-content-type-options': 'nosniff',
      date: 'Wed, 19 Jun 2024 12:30:22 GMT',
      server: 'envoy',
      via: 'HTTP/2 edgeproxy, 1.1 google',
      'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
      'transfer-encoding': 'chunked'
    },
    config: {
      transitional: [Object],
      adapter: [Array],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [Object [AxiosHeaders]],
      baseURL: 'https://api.spotify.com/v1',
      method: 'get',
      url: 'https://api.spotify.com/v1/tracks?ids=0mmVS3xvOVcTP4blGNb9sE,6L55D19gnwlodoMRH60VJL',
      data: undefined
    },

not sure what other logs might be useful, happy to provide

KellyFromSales commented 2 weeks ago

seems to be working now, must have just had to wait!