Skip to content

Commit cb42a80

Browse files
committed
fixes captcha
1 parent 48d667b commit cb42a80

File tree

7 files changed

+5124
-13718
lines changed

7 files changed

+5124
-13718
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ We have deployed an example bound to a free Suno account, so it has daily usage
3939
- Perfectly implements the creation API from suno.ai.
4040
- Automatically keep the account active.
4141
- Solve CAPTCHAs automatically using [2Captcha](https://2captcha.com) and [Playwright](https://playwright.dev) with [rebrowser-patches](https://github.com/rebrowser/rebrowser-patches).
42-
- Compatible with the format of OpenAIs `/v1/chat/completions` API.
42+
- Compatible with the format of OpenAI's `/v1/chat/completions` API.
4343
- Supports Custom Mode.
4444
- One-click deployment to [Vercel](#deploy-to-vercel) & [Docker](#docker).
4545
- In addition to the standard API, it also adapts to the API Schema of Agent platforms like GPTs and Coze, so you can use it as a tool/plugin/Action for LLMs and integrate it into any AI Agent.
@@ -99,7 +99,7 @@ docker compose build && docker compose up
9999

100100
- If deployed to Vercel, please add the environment variables in the Vercel dashboard.
101101

102-
- If youre running this locally, be sure to add the following to your `.env` file:
102+
- If you're running this locally, be sure to add the following to your `.env` file:
103103
#### Environment variables
104104
- `SUNO_COOKIE` — the `Cookie` header you obtained in the first step.
105105
- `TWOCAPTCHA_KEY` — your 2Captcha API key from the second step.
@@ -116,9 +116,20 @@ BROWSER_LOCALE=en
116116
BROWSER_HEADLESS=true
117117
```
118118

119+
### 4.1 Install Browser Dependencies
120+
121+
Since this project uses browser automation for CAPTCHA solving, you need to install the required browser:
122+
123+
```bash
124+
# Install the required browser binary
125+
npx rebrowser-playwright-core install chromium
126+
```
127+
128+
This will download and install the Chromium browser that's compatible with the automation system.
129+
119130
### 5. Run suno-api
120131

121-
- If youve deployed to Vercel:
132+
- If you've deployed to Vercel:
122133
- Please click on Deploy in the Vercel dashboard and wait for the deployment to be successful.
123134
- Visit the `https://<vercel-assigned-domain>/api/get_limit` API for testing.
124135
- If running locally:
@@ -148,10 +159,10 @@ Suno API currently mainly implements the following APIs:
148159

149160
```bash
150161
- `/api/generate`: Generate music
151-
- `/v1/chat/completions`: Generate music - Call the generate API in a format that works with OpenAIs API.
162+
- `/v1/chat/completions`: Generate music - Call the generate API in a format that works with OpenAI's API.
152163
- `/api/custom_generate`: Generate music (Custom Mode, support setting lyrics, music style, title, etc.)
153164
- `/api/generate_lyrics`: Generate lyrics based on prompt
154-
- `/api/get`: Get music information based on the id. Use “,” to separate multiple ids.
165+
- `/api/get`: Get music information based on the id. Use "," to separate multiple ids.
155166
If no IDs are provided, all music will be returned.
156167
- `/api/get_limit`: Get quota Info
157168
- `/api/extend_audio`: Extend audio length

next.config.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ const nextConfig = {
88
return config;
99
},
1010
experimental: {
11-
serverMinification: false, // the server minification unfortunately breaks the selector class names
12-
},
13-
};
11+
serverComponentsExternalPackages: [
12+
'playwright-core',
13+
'@sparticuz/chromium'
14+
],
15+
serverMinification: false // the server minification unfortunately breaks the selector class names
16+
}
17+
};
1418

1519
export default nextConfig;

0 commit comments

Comments
 (0)