diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..8171b88 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +SUNO_COOKIE='' diff --git a/README.md b/README.md index 5b0acef..908a825 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ About High quality songs generation by https://www.suno.ai/. Reverse engineered - Clone this REPO -> `git clone https://github.com/yihong0618/SunoSongsCreator.git` - XHR find cookie in this url -> https://clerk.suno.ai/v1/client?_clerk_js_version=4.70.5 - Copy the cookie. -- Export SUNO_COOKIE='xxxxx'. +- You can import the cookie using `export SUNO_COOKIE=''` or rename `.env.example` to `.env` and fill in `SUNO_COOKIE`. ## Usage diff --git a/requirements.txt b/requirements.txt index a1a8e72..84313e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ curl_cffi fake-useragent requests -rich \ No newline at end of file +rich +python-dotenv diff --git a/setup.py b/setup.py index 4a60a66..af20412 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ "requests", "fake-useragent", "rich", + "python-dotenv", ], packages=find_packages(), long_description=open("README.md", encoding="utf-8").read(), diff --git a/suno/suno.py b/suno/suno.py index 69cf713..1da04a4 100644 --- a/suno/suno.py +++ b/suno/suno.py @@ -13,6 +13,10 @@ from requests import get as rget from rich import print +from dotenv import load_dotenv, find_dotenv + +_ = load_dotenv(find_dotenv()) + ua = UserAgent(browsers=["edge"]) get_session_url = "https://clerk.suno.ai/v1/client?_clerk_js_version=4.70.5"