spotifyexport icon indicating copy to clipboard operation
spotifyexport copied to clipboard

use cursor instead of offset based pagination

Open karlicoss opened this issue 4 years ago • 0 comments

https://github.com/plamere/spotipy/issues/652#issuecomment-901364283

Didn't know it supported cursor pagination, should use this for 'as_list' method

    page = api_method(limit=50)

    res: List[Json] = page['items']
    while page['next']:
        page = spotipy.next(page)
        res.extend(page['items'])
    return res

karlicoss avatar Dec 21 '21 21:12 karlicoss