-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Some songs seem to return an empty list, resulting in a list index out of range error.
Below code with random song picked from the https://suno.com homepage.
from suno import Suno, ModelVersions
suno_cookie = "<cookie>"
suno_client = Suno(cookie=suno_cookie, model_version=ModelVersions.CHIRP_V3_5)
song = suno_client.get_song('c13604b8-8a1b-4e84-b741-0e9197405a39')
Error traceback:
Traceback (most recent call last):
File "test.py", line 8, in <module>
song = suno_client.get_song('c13604b8-8a1b-4e84-b741-0e9197405a39')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Python\Python311\site-packages\suno\suno.py", line 214, in get_song
return create_clip_from_data(response.json()[0])
~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Doing some further testing with below code shows an empty list is being returned, hence the out of range error.
from suno import Suno, ModelVersions
suno_cookie = "<cookie>"
suno_client = Suno(cookie=suno_cookie, model_version=ModelVersions.CHIRP_V3_5)
response = suno_client.client.get("https://studio-api.suno.ai/api/feed/?ids=c13604b8-8a1b-4e84-b741-0e9197405a39")
print(response.json())
>>>[]
Metadata
Metadata
Assignees
Labels
No labels