Skip to content

ayodlo/suno-bot

Repository files navigation

Suno Automation Tool

A Python CLI for automating audio processing workflows on Suno using Playwright browser automation.


Requirements

  • Python 3.12+
  • Windows / macOS / Linux

Setup

1 — Clone / download the project

git clone <your-repo-url>
cd suno_tool

2 — Create and activate a virtual environment

python -m venv .venv

# Windows
.venv\Scripts\activate

# macOS / Linux
source .venv/bin/activate

3 — Install Python dependencies

pip install -r requirements.txt

4 — Install Playwright browsers

playwright install chromium

5 — Configure the tool

Copy and edit the default config (or edit config.yaml directly):

# config.yaml
paths:
  input_dir: "./input"      # put your .wav / .mp3 files here
  output_dir: "./output"    # generated files are saved here

browser:
  headless: false           # set true to run without a visible window

First Run — Log In

Before processing any files, you need to log in to Suno once so the session can be persisted:

python cli.py bootstrap-login

A browser window will open. Log in to Suno manually, then press ENTER in the terminal.
Your session is saved to ./browser_profile and reused on subsequent runs.


Usage

Process all audio files

python cli.py process

Process a single file

python cli.py process --only my_beat.wav

Preview without making changes

python cli.py process --dry-run

Preview a single file without changes

python cli.py process --only my_beat.wav --dry-run

Reset state and reprocess

# Reset one file
python cli.py process --only my_beat.wav --reset

# Reset everything
python cli.py process --reset

Check processing status

python cli.py status

Enable verbose / debug logging

python cli.py process --verbose

Project Structure

suno_tool/
├── cli.py            # CLI entry point (Click commands)
├── config.py         # YAML config loader → typed dataclasses
├── config.yaml       # Default configuration
├── scanner.py        # Finds .wav / .mp3 files in input_dir
├── state.py          # JSON-backed processing state tracker
├── suno_client.py    # Playwright browser automation (stubs)
├── pipeline.py       # Orchestrates scan → process → download
├── downloads.py      # Saves generated audio to output_dir
├── utils.py          # Logging setup and small helpers
├── requirements.txt
└── README.md

Input / Output

Location Purpose
./input/ Drop your .wav or .mp3 files here
./output/ Generated files are downloaded here
./state.json Tracks which files have been processed
./browser_profile/ Persisted Playwright browser session
./logs/suno_tool.log Rotating log file

The scanner reads only the root of input_dir — subdirectories are intentionally ignored.


Extending the Tool

The Suno workflow stubs live in suno_client.py. Each method has a # TODO block showing where to add Playwright selectors and interactions. The pipeline in pipeline.py calls these methods in order:

  1. navigate_to_create()
  2. upload_audio(path)
  3. set_song_metadata(...)
  4. submit_generation()
  5. wait_for_completion()
  6. get_download_url()

Implement each step individually and test with --dry-run and --verbose to iterate quickly.

About

Visadapt Scraper

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors