Skip to content

feat: add Suno adapter#1

Open
icebear0828 wants to merge 2 commits intomainfrom
feat/suno-adapter
Open

feat: add Suno adapter#1
icebear0828 wants to merge 2 commits intomainfrom
feat/suno-adapter

Conversation

@icebear0828
Copy link
Copy Markdown
Owner

Summary

  • New webctl suno adapter with 4 commands: login, generate, download, poll
  • Pure HTTP via undici + Chrome TLS fingerprint — no browser required after login
  • File-based input (--prompt-file, --tags-file) avoids shell escaping issues with lyrics/Chinese text
  • WAV URLs fetched automatically after generation completes

Auth Flow

  • Clerk JWT (Bearer) + Browser-Token (base64 timestamp) + Device-Id per request
  • Token refresh: POST auth.suno.com/v1/client/sessions/{id}/touch using stored Clerk cookies
  • One-time browser login via webctl suno login to extract all cookies incl. auth.suno.com httponly ones

Generate Flow

  1. POST /api/c/check — captcha gate (clean IP: required: false, no token needed)
  2. POST /api/generate/v2-web/ — submits batch, returns 2 clip IDs
  3. POST /api/feed/v3 — polls until status: complete
  4. POST /api/gen/{id}/convert_wav/ + GET /api/gen/{id}/wav_file/ — WAV URL
  5. POST /api/billing/clips/{id}/download/ — billing tracking

Test Plan

  • E2E: generated 《分手后的第一场雪》 via HTTP — 2 clips returned with WAV URLs
  • suno poll with existing clip ID returns correct metadata
  • suno download --format wav returns CDN WAV URL
  • suno download (default) returns WAV URL
  • suno login — requires browser, tested manually via spy session import

- HTTP client using Clerk JWT + Browser-Token (timestamp-based) + Device-Id
- Token refresh via POST auth.suno.com/v1/client/sessions/{id}/touch
- Generate flow: c/check → generate/v2-web → feed/v3 polling → WAV conversion
- File-based input (--prompt-file, --tags-file) to avoid shell escaping issues
- WAV URLs returned automatically after generate completes
- Session stored at ~/.config/webctl/sessions/suno/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant