feat: local audio API — uploaded-audio covers, download/export routes, cookie sanitize - #2
Open
francialisomlimoeiro wants to merge 1 commit into
Open
Conversation
…d/export routes, cookie sanitize - SunoApi: native upload chain (createAudioUpload S3 POST-policy, postUploadFile multipart, finishAudioUpload, getAudioUpload poll, initializeUploadClip) and cover payload (task='cover', cover_clip_id, cover_start_s/end_s) in generateSongs/custom_generate - api/uploads/audio: multipart proxy running the full native upload chain, returns clip_id usable as cover source - api/custom_generate: accept upload_id/cover_clip_id/task - api/download: quota-aware download/export router (normal download, Studio per-clip download, sample-pack stems export with polling) - SunoApi: toBrowserCookies() sanitizes SUNO_COOKIE dumps for Playwright addCookies (drops Set-Cookie attribute junk, percent-encodes illegal value chars like ';' inside OneTrust OptanonConsent, defaults domain=.suno.com, keeps the live session token over the stale env one) - scripts/selftest_browser_cookies.mts: offline self-test for the sanitizer (no generation involved)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1 (local audio upload API).
What's included
Local audio upload + cover generation
POST /api/uploads/audio— multipart upload running Suno's native upload chain (S3 POST-policy -> presigned PUT -> initialize-clip -> upload-finish -> poll), returns aclip_idPOST /api/custom_generatenow acceptstask: 'cover'+cover_clip_id(+ optionalcover_start_s/cover_end_s), so an uploaded local file can be used as a cover sourceupload_idpassthrough for generating from an existing uploadDownload / export routes
GET /api/download?id=<clip_id>— quota-aware router: prefers Suno Studio per-clip download and sample-pack (stems) exports, which don't count against the monthly download quota on Premier plans;path=forces a specific path,job=polls a running sample-pack exportCookie sanitization
toBrowserCookies()fixesSUNO_COOKIEdumps for PlaywrightaddCookies: drops Set-Cookie attribute junk, percent-encodes illegal value chars (e.g.;inside OneTrustOptanonConsent), defaultsdomain=.suno.com, keeps the live session token over a stale env value — fixes CDP "Invalid cookie fields" crashes in the browser captcha fallbackscripts/selftest_browser_cookies.mts: offline self-test for the sanitizer (no generation involved)No breaking changes to existing routes.