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
56 stars 15 forks source link

Invalid leading whitespace, reserved character(s), or return character(s) in header value: #9

Open JannisKirschner opened 2 months ago

JannisKirschner commented 2 months ago

Hey folks, I get the following issue trying to set the cookie:

requests.exceptions.InvalidHeader: Invalid leading whitespace, reserved character(s), or return character(s) in header value: '__client=e[REDACTED]g; \n__client_uat=1[REDACTED]0; _cfuvid=U3[REDACTED]0; \n__stripe_mid=6b[REDACTED]e; __stripe_sid=c[REDACTED]1; \n__cf_bm=a[REDACTED]Q; \nmp_2[REDACTED]c_mixpanel=%7B%22distinct_id%22%3A%20%22a3d[REDACTED]1f36%22%2C%22%24device_id%22%3A%20%22[REDACTED]e32%22%2C%22%24initial_referrer%22%3A%20%22%24direct%22%2C%22%24initial_referring_domain%22%3A%20%22%24direct%22%2C%22__mps%22%3A%20%7B%7D%2C%22__mpso%22%3A%20%7B%7D%2C%22__mpus%22%3A%20%7B%7D%2C%22__mpa%22%3A%20%7B%7D%2C%22__mpu%22%3A%20%7B%7D%2C%22__mpr%22%3A%20%5B%5D%2C%22__mpap%22%3A%20%5B%5D%2C%22%24user_id%22%3A%20%2[REDACTED]6%22%7D\n\n'

Both trying to read it from a file and pasting directly did not work. Can you give me any pointers what might be the cause? 😄

Many thanks in advance!

kuhnchris commented 2 months ago

Did you copy the cookie from the browser? If yes, please make sure to toggle the "Raw" option, as i had similar issues when trying to copy it without switching to raw (some special characters or "..." or something like that)