browniebroke/deezer-python

Deezer API doesn't return all items in large collections

hithomasmorelli opened this issue · 2 comments

It does, however, provide a next API url to get more items, which will then provide another next url, and so on until all the tracks have been fetched.

Unsure if this also applies to other methods but will test.

I'll introduce a PR to fix this (by following the next URLs when they're present)

Example response (for a playlist):

{
    'data': [<tracks>],
    'checksum': '<checksum>',
    'total': <total>,
    'next': 'https://api.deezer.com/playlist/<playlist>/tracks?access_token=<token>&index=<index>'
}

Methods found that problem applies to:

  • tracks
  • fans (but the Deezer API limits this to 100 anyway at time of writing)
  • albums (for user\<user>\albums and artist\<artist>\albums
  • artists (for user\<user>\artists)
  • playlists (for user\<user>\playlists)

Changed the issue from being about "tracks" to "items" once I discovered that it applied to more than just playlists

Closing as missed iter_* functions, pagination could potentially be improved, but that's a different issue

See more details in #137 for a longer term solution.