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

Extend, Cover, Negative Tags and Upload (with progress) #184

Open
jochemstoel opened this issue Nov 5, 2024 · 11 comments
Open

Extend, Cover, Negative Tags and Upload (with progress) #184

jochemstoel opened this issue Nov 5, 2024 · 11 comments

Comments

@jochemstoel
Copy link

Hi, thanks for creating this repo. I need additional methods for: cover and upload, and parameter: negative_tags.

I have already done some research.

Implementing negative tags (exclude style) is easy, just add a property negative_tags to your HTTP request payload. This will work.
Extend is easy too, all you need to do is provide the ID of the song you want to extend.
Update: you have already implemented extend function, it will work the same with uploads (provide audio ID) but no uploads are supported yet.

I have been investigating the suno.com website but I haven't found the right way yet to "cover" an audio. This is a new feature on their platform. I assume it also required a track id.

The new "cover" method on Suno uses a much improved model compared to the regular generation model.
Source: Suno employee on Discord + own experience.

Lastly, trying to update your repository, I haven't been able to upload my audio files to Suno yet. I have found so far that when you upload a file on the suno website, it sends a request to /audio with a payload of:

{
    "extension": "wav" // or mp3
}

This will respond with:

{
    "id": "11b10f4c-6bf9-499b-8d49-f7bc4661bfcb",
    "url": "https://suno-uploads.s3.amazonaws.com/",
    "fields": {
        "Content-Type": "audio/wav",
        "key": "raw_uploads/11b10f4c-6bf9-499b-8d49-f7bc4661bfcb.wav",
        "AWSAccessKeyId": "...",
        "policy": "...",
        "signature": "..."
    },
    "is_file_uploaded": false
}

Then you need to request https://suno-uploads.s3.amazonaws.com/raw_uploads%2F11b10f4c-6bf9-499b-8d49-f7bc4661bfcb.wav (response.url + fields.key) and provide the file as payload.

Then a response comes from /upload-finish from Suno, followed by responses with progress indicators of the audio processing. For example:

{
    "id": "11b10f4c-6bf9-499b-8d49-f7bc4661bfcb",
    "status": "processing",
    "title": ""
}

But I get stuck on the uploading file to amazon. Authentication errors etcetera. Can you implement these features? I hope some of my findings are useful.

Update: there exists now the option to save the profile of a voice as a "persona". This is a very easy to implement endpoint too.

@uisato
Copy link

uisato commented Nov 10, 2024

Hey, are the cookies working for you, Joch? Can't seem to make it work, having the "Internal server error. Error: Failed to get session id, you may need to update the SUNO_COOKIE".

@jochemstoel
Copy link
Author

@uisato It works fine for me. I think what you are doing wrong is you're using the value stored in your document.cookie. The best way is to grab it in the way demonstrated in the network tab. If you do not get any results in sources when you type "clerk" into search or look for it, refresh the page with the devtools already open.

My issue however was about adding features, if you have cookie problems then ask your question where it is relevant please.

@uisato
Copy link

uisato commented Nov 10, 2024 via email

@uisato
Copy link

uisato commented Nov 10, 2024 via email

@jochemstoel
Copy link
Author

@ajayarora1235 As far as I know, this package suno-api does not work anymore and is not going to be fixed either. Suno is also actively trying to stop third party wrapper APIs. If you want an API for Suno, best thing you can probably do is use something like puppeteer or some other headless browser to create your own API like I did. Either by reverse engineering the HTTP traffic being done in the page, or automating user interaction.

@gohoski
Copy link
Contributor

gohoski commented Feb 10, 2025

@jochemstoel It works. I have implemented browser automation. Please check it again and re-open this issue, as this is still not implemented.

@jochemstoel
Copy link
Author

@gohoski My sincere apologies. I used to check this repository often and the last times I checked it didn't work anymore and everybody was explaining it was for the reasons I mentioned. I have reopened the issue.

(Also, I am looking for someone who can do the same thing for Udio. Is that you?)

@jochemstoel jochemstoel reopened this Feb 10, 2025
@uisato
Copy link

uisato commented Feb 10, 2025 via email

@jochemstoel
Copy link
Author

@uisato With udio? I have made some progress using puppeteer. I am not nearly finished implementing all the settings and parameters for song generation, or any of the remix/extend features but it successfully generates a track based on a prompt, starts a start at least.

@uisato
Copy link

uisato commented Feb 15, 2025 via email

@jochemstoel
Copy link
Author

@uisato Sorry I don't use Instagram. Discord perhaps? jochemstoel (351027727584985088)
You can also try adding Skype "jochem.stoel", find me on Viber or email me at jochemstoel@gmail.com

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

3 participants