browniebroke/deezer-python

How a get more than 400 song from a playlist?

eribito opened this issue · 2 comments

I tried to get the songs from a big playlist but
only 400 songs are returned. Is there any way to get all the songs from a large playlist?
rsz_12019-11-26-105046_1920x1080_scrot
The playlist link is deezer.com/playlist/5308276702

Can you please avoid posting screenshot? It's not possible to copy/paste from an image. Making a code snippet is a lot more useful.

I can't remember if we have a proper pagination in the client or if it's a limitation of the Deezer API itself.

class Playlist(Resource):
"""To access a playlist."""

You can try to do playlist.iter_relation('tracks') maybe?

Sorry about the image. I tried how you said and it worked well. Thanks for you help.

import deezer

client = deezer.Client()
playlist = client.get_playlist(5308276702)
j = 0
for i in playlist.iter_relation('tracks'):
     j+=1
print(j)