Skip to content

Commit

Permalink
Merge pull request #9 from wengchaoxi/support-auto-env
Browse files Browse the repository at this point in the history
feat: support auto import of cookie from `.env`
  • Loading branch information
yihong0618 authored Mar 27, 2024
2 parents 6d22917 + abe4581 commit cbfb64f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUNO_COOKIE='<your-suno-cookie>'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<your-suno-cookie>'` or rename `.env.example` to `.env` and fill in `SUNO_COOKIE`.

## Usage

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
curl_cffi
fake-useragent
requests
rich
rich
python-dotenv
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"requests",
"fake-useragent",
"rich",
"python-dotenv",
],
packages=find_packages(),
long_description=open("README.md", encoding="utf-8").read(),
Expand Down
4 changes: 4 additions & 0 deletions suno/suno.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cbfb64f

Please sign in to comment.