gcui-art / suno-api

Use API to call the music generation AI of suno.ai, and easily integrate it into agents like GPTs.
https://suno.gcui.ai
GNU Lesser General Public License v3.0
904 stars 204 forks source link

Error: Failed to get session id, you may need to update the SUNO_COOKIE #19

Closed banxian007 closed 3 months ago

banxian007 commented 3 months ago

{ "error": "Internal server error. TypeError [ERR_INVALID_CHAR]: Invalid character in header content [\"Cookie\"]" }

453736ebfe5fda143cdd841d3b54891 af65db25facedcc8f8209632a059cbc image

banxian007 commented 3 months ago

something wrong

hiboydidi commented 3 months ago

me too,why

GitPusher99 commented 3 months ago

Go to https://app.suno.ai/, make sure you are logged in, and perform the operation on the console

function getCookieStringByDomain(domain) {
    const cookies = document.cookie.split(';');
    let cookieString = '';

    cookies.forEach(cookie => {
        const [name, value] = cookie.trim().split('=');
        cookieString += `${name}=${value}; `;
    });

    return cookieString;
}

getCookieStringByDomain('clerk.suno.ai');

You can get the cookie. Give it a try

@banxian007 @hiboydidi

banxian007 commented 3 months ago

Tried all three browsers, Google Chrome, Firefox, and edge.

image image image image

banxian007 commented 3 months ago

@GitPusher99

GitPusher99 commented 3 months ago

Look at the screenshot you sent, posted cookies contain special characters, you check to try

banxian007 commented 3 months ago

Look at the screenshot you sent, posted cookies contain special characters, you check to try

What special characters, I don't quite understand, like this?% I don't know what the problem is.@GitPusher99

GitPusher99 commented 3 months ago
image

@banxian007

Thehappydeveloper commented 2 months ago

Hi, I have the same issue both when I run it with npm and with docker. image

I got the cookie ID with the function given above.

image

I inserted it in the example file like this:

image

I am on a Ubuntu machine.