Skip to content

feat(captcha): add MANUAL_CAPTCHA mode for new Suno UI (v5.5+)#277

Open
courcirc8 wants to merge 2 commits into
gcui-art:mainfrom
courcirc8:feat/manual-captcha-mode
Open

feat(captcha): add MANUAL_CAPTCHA mode for new Suno UI (v5.5+)#277
courcirc8 wants to merge 2 commits into
gcui-art:mainfrom
courcirc8:feat/manual-captcha-mode

Conversation

@courcirc8

Copy link
Copy Markdown

Suno's v5.5 web UI dropped the .custom-textarea selector that the existing automated CAPTCHA flow relies on, causing /api/custom_generate to time out on waiting for locator('.custom-textarea'). This is tracked as issue #263 and has been unresolved for ~5 months.

Add a parallel getCaptchaManual() flow gated by env var MANUAL_CAPTCHA=true:

  • Opens a VISIBLE browser (overrides BROWSER_HEADLESS for the lifetime of the request) on https://suno.com/create
  • Performs NO DOM automation — the user fills the UI and clicks Create themselves in whatever UI version is live
  • Hijacks /api/generate/v2 the same way the existing flow does, extracting the hCaptcha token from the request body
  • No timeout — accommodates however long the human needs

Pros:

  • Survives any future UI redesign (no selectors)
  • No 2Captcha dependency required
  • Works with the user's own Pro/Premier account

Cons:

  • Requires human-in-the-loop (only triggers if Suno demands a captcha; warm sessions skip the captcha and never invoke this path)
  • Not suitable for headless server deployments

Trigger via .env:
MANUAL_CAPTCHA=true

Suno's v5.5 web UI dropped the .custom-textarea selector that the existing
automated CAPTCHA flow relies on, causing /api/custom_generate to time out
on `waiting for locator('.custom-textarea')`. This is tracked as issue gcui-art#263
and has been unresolved for ~5 months.

Add a parallel `getCaptchaManual()` flow gated by env var MANUAL_CAPTCHA=true:

- Opens a VISIBLE browser (overrides BROWSER_HEADLESS for the lifetime of
  the request) on https://suno.com/create
- Performs NO DOM automation — the user fills the UI and clicks Create
  themselves in whatever UI version is live
- Hijacks /api/generate/v2 the same way the existing flow does, extracting
  the hCaptcha token from the request body
- No timeout — accommodates however long the human needs

Pros:
- Survives any future UI redesign (no selectors)
- No 2Captcha dependency required
- Works with the user's own Pro/Premier account

Cons:
- Requires human-in-the-loop (only triggers if Suno demands a captcha;
  warm sessions skip the captcha and never invoke this path)
- Not suitable for headless server deployments

Trigger via .env:
    MANUAL_CAPTCHA=true
@vercel

vercel Bot commented May 17, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Linkly AI LLC's projects Team on Vercel.

A member of the Team first needs to authorize it.

@courcirc8 courcirc8 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual option could be useful

Build on the previous commit with two additions:

1. Tri-state semantics for MANUAL_CAPTCHA: unset/false=auto, true=manual, fallback=try-auto-then-manual. The fallback mode is the smart path for local users — automation when it works, escape hatch when the UI drifts.

2. Polish: split auto flow into private getCaptchaAuto(); log active mode in init(); document in README and .env.example.

Default behavior (unset) is byte-equivalent to upstream. Tested routing on all values.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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