Malith-Rukshan / Suno-API

SunoAI Unofficial Python API Library and REST API for Suno.ai — Create Music with Generative AI ! ✨
https://pypi.org/project/SunoAI
MIT License
60 stars 18 forks source link

Issue in Renewing Token #10

Open gamedevCloudy opened 1 week ago

gamedevCloudy commented 1 week ago

I think Suno has hardened the security. Thus it is throwing an error that CAPTCHA verification is required. Here's a log:

INFO:SunoAI:Renew Token ♻️
INFO:SunoAI:{'errors': [{'message': 'CAPTCHA verification is required', 'long_message': 'CAPTCHA verification is required', 'code': 'requires_captcha'}], 'clerk_trace_id': 'd183cf9c4d9e760a7a1f166efec7769a'}
INFO:SunoAI:'jwt'

Please let me know if some fix is available. We have an app in production and thus need help to resolve this quickly.

gamedevCloudy commented 1 week ago

If I hardcode the jwt from the web browser. Further error is show while using generate

INFO:SunoAI:Generating Audio...
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): studio-api.suno.ai:443
DEBUG:urllib3.connectionpool:https://studio-api.suno.ai:443 "POST /api/generate/v2/ HTTP/11" 401 None
DEBUG:SunoAI:{"detail": "Unauthorized"}
ERROR:SunoAI:Audio Generate Failed ⁉️
ERROR:app:Error generating song: Error response: {"detail": "Unauthorized"}
ERROR:app:Exception on /api/v1/songs [POST]
Traceback (most recent call last):
  File "/app/api/v1/routes.py", line 53, in post
    songs = generate_song(
  File "/app/services/song_generator.py", line 49, in generate_song
    clips = client.generate(
  File "/.venv/lib/python3.10/site-packages/suno/suno.py", line 146, in generate
    raise Exception(f"Error response: {response.text}")
Exception: Error response: {"detail": "Unauthorized"}
gamedevCloudy commented 1 week ago

I see a request being consistently made in the application (ie when using suno.com)

POST /v1//rgstr?k=client-DaZjubWc7zwnZ5o2EEJhqt4UYRzYRoUuHbTQcIH9Ybq&st=javascript-client-react&sv=3.1.0&t=1732016453483&sid=ef7d2f39-ded9-4c62-8347-626d1289ddbb&ec=1 undefined
Host: s.prod.suno.com
StephanSchuster commented 5 days ago

Damn it! Just noticed the same issue. Also for us this is critical. Would be highly interested in a fix.

StephanSchuster commented 5 days ago

Is there anything I could do or test to try to resolve this. Currently I am clueless how to proceed.

gamedevCloudy commented 4 days ago

Is there anything I could do or test to try to resolve this. Currently I am clueless how to proceed.

We've temporarily moved to Udio API Pro.

I couldn't work something out in time so we moved to this. Their implementation was broken too. But now it takes around 5-10 minutes to get a song. And some requests still fail.

Suno themselves are working on an API so this seems like an effort to cut off projects like this one. They are currently planning to do a beta.

gamedevCloudy commented 4 days ago

Udioapi team said the longer times are due to the new model release. They are working to improve on that.