Kindly help with this input argument for the ‘get_paginated_album_tracks’ function in the main.py file. It seems I didn’t get the argument to pass for the ‘album_id’. Kindly check this attached image for more information.
Hello @Giwabest,
It seems there is a bug in your code you used album_ids
instead of album_id
. Please remove the code since it is against the Code of Conduct, thanks:
base_url=URL_ALBUM_TRACKS,
access_token=token.get("access_token"),
album_id=album_id, <--use album_id instead
Ohh, sorry about that. I have also tried it with ‘album_id’, but it’s giving me error when I ran the main.py code again. You can view this image.
Hello @Giwabest,
I could reproduce the issue could you check in endpoint.py
file lines 107-109. Could you try this code instead. Hope it helps:
# Extend the album_data list with the value from "items" in response_json.
album_data.extend(response_json.get("items", []))
# Update request_url with the "next" value from response_json.
request_url = response_json.get("next")
Thanks a lot, it works. But one more thing, can you help me understand this?
Hello @Giwabest,
Sure, the instructions actually explains in the comments what to do (extend the list and use “next”) instead of you using album_data["album_data"]
. You just have to debug it a little and you get the correct output. Hope it helps