Production-oriented async browser automation framework for Suno song generation workflows.
- Async orchestration with retries
- Persistent Playwright browser session
- CSV prompt ingestion
- Song generation polling
- Audio download and metadata export
- Human-like typing and random delays
- Anti-detection hardening basics
- Dockerized and Ubuntu VPS friendly
.
├── Dockerfile
├── README.md
├── requirements.txt
└── suno_automation
├── config.py
├── main.py
├── core
│ └── browser.py
├── data
│ └── prompts.csv
├── logs
├── models
│ ├── prompt.py
│ └── song.py
├── output
│ ├── audio
│ └── metadata
├── services
│ ├── csv_loader.py
│ ├── metadata_store.py
│ └── suno_client.py
└── utils
└── logger.py
sudo apt update
sudo apt install -y python3 python3-pip
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install chromiumCreate .env in project root:
SUNO_LOGIN_METHOD=google
SUNO_EMAIL=you@example.com
SUNO_PASSWORD=supersecret
SUNO_GOOGLE_EMAIL=you@gmail.com
SUNO_GOOGLE_PASSWORD=app_or_account_password
HEADLESS=false
MAX_RETRIES=3
CONCURRENCY=2
POLL_INTERVAL_SECONDS=8
TIMEOUT_MS=90000
MANUAL_LOGIN_TIMEOUT_SECONDS=180
LOGIN_POLL_BASE_SECONDS=3
LOGIN_POLL_MAX_SECONDS=12python -m suno_automation.maindocker build -t suno-automation .
docker run --rm -it \
-v $(pwd)/suno_profile:/app/suno_profile \
-v $(pwd)/suno_automation/output:/app/suno_automation/output \
--env-file .env \
suno-automationDefault login mode is Google (SUNO_LOGIN_METHOD=google). After opening /sign-in, the client must click Continue with Google first, then complete Google email/password steps in the auth window and return to Suno.
If Google auth UI changes (or prompts 2FA/captcha), automation falls back to manual login wait mode until /create is reached.
Set SUNO_LOGIN_METHOD=email to use the direct email/password flow.
Suno UI can change. Update selectors in suno_automation/services/suno_client.py as needed.
- Suno renders social button labels with split text nodes (e.g.,
Continue with <!-- -->Google), so login uses role-based button matching plus selector fallbacks.
- Login polling now uses backoff and avoids aggressive reloads during Clerk/auth handshake URLs.
- If Google button is not found, the client writes
suno_automation/logs/login_debug.htmlandsuno_automation/logs/login_debug.pngfor selector troubleshooting. - If
Page.gototo Suno times out, the client now uses resilient navigation (domcontentloadedthencommitretry) instead of strictnetworkidle. - If your network is slow, increase
TIMEOUT_MS(for exampleTIMEOUT_MS=180000). - For Google login with 2FA/captcha, increase
MANUAL_LOGIN_TIMEOUT_SECONDS(for example420) and complete verification in the opened browser.
Use only on accounts you own and in compliance with Suno's Terms of Service.