Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for some songs returns empty list json response #8

Open
BenjinZA opened this issue Aug 9, 2024 · 0 comments
Open

Searching for some songs returns empty list json response #8

BenjinZA opened this issue Aug 9, 2024 · 0 comments

Comments

@BenjinZA
Copy link

BenjinZA commented Aug 9, 2024

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())

>>>[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant