1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Endpoints and tunables for the Suno and Clerk APIs.
//!
//! These mirror the values the Suno web client uses. The API is undocumented,
//! so they may need updating if Suno changes its endpoints.
pub const SUNO_API_BASE_URL: &str = "https://studio-api-prod.suno.com";
pub const CLERK_BASE_URL: &str = "https://auth.suno.com";
pub const CLERK_JS_VERSION: &str = "5.117.0";
pub const CDN_BASE_URL: &str = "https://cdn1.suno.ai";
/// Canonical public web URL base for a song page (`<base>/<clip id>`). Used in
/// the plain-text details sidecar so a human can open the song in a browser.
pub const SUNO_SONG_BASE_URL: &str = "https://suno.com/song";
/// Refresh a JWT this many seconds before it expires.
pub const JWT_REFRESH_BUFFER: i64 = 60;
/// Hard cap on feed pages so a runaway `has_more` cannot loop forever.
pub const MAX_PAGES: u32 = 100;
/// Clips requested per feed page. A larger page means fewer requests to walk a
/// big library, so the rate limiter is tripped less often.
pub const FEED_PAGE_SIZE: u32 = 50;
/// Wait this long between successive feed pages to pace a full-library walk
/// under Suno's rate limiter, rather than only reacting to a 429.
pub const FEED_PAGE_DELAY: Duration = from_millis;
/// Retry a rate-limited or transient API request this many times before failing.
pub const API_MAX_RETRIES: u32 = 3;
/// The library feed endpoint: a cursor-paginated `POST` taking
/// `{limit, cursor, filters}` and returning `{clips, has_more, next_cursor}`.
/// The `filters` carry `trashed: "False"` so the listing excludes trashed clips
/// exactly as the old v2 feed did; the `--liked` scope adds `liked: "True"`.
pub const FEED_V3_PATH: &str = "/api/feed/v3";
/// The dedicated parent-lookup endpoint: one hop up a clip's lineage.
pub const CLIP_PARENT_PATH: &str = "/api/clips/parent";
/// The caller's own playlists, paged. Trashed and share-list playlists are
/// excluded by query so the listing is the account's authoritative own set.
pub const PLAYLIST_ME_PATH: &str = "/api/playlist/me";
/// One playlist's detail, including its ordered `playlist_clips`. The id and a
/// trailing slash are appended: `/api/playlist/{id}/`.
pub const PLAYLIST_PATH: &str = "/api/playlist/";