Merge pull request #80 from swumagic/main

Update SunoApi.ts 4.72.2 fix 4.72.4
This commit is contained in:
blueeon 2024-05-20 14:06:14 +08:00 committed by GitHub
commit 6cf7f42461
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,7 +63,7 @@ class SunoApi {
*/
private async getAuthToken() {
// URL to get session ID
const getSessionUrl = `${SunoApi.CLERK_BASE_URL}/v1/client?_clerk_js_version=4.72.1`;
const getSessionUrl = `${SunoApi.CLERK_BASE_URL}/v1/client?_clerk_js_version=4.72.4`;
// Get session ID
const sessionResponse = await this.client.get(getSessionUrl);
if (!sessionResponse?.data?.response?.['last_active_session_id']) {
@ -82,7 +82,7 @@ class SunoApi {
throw new Error("Session ID is not set. Cannot renew token.");
}
// URL to renew session token
const renewUrl = `${SunoApi.CLERK_BASE_URL}/v1/client/sessions/${this.sid}/tokens?_clerk_js_version=4.72.0-snapshot.vc141245`;
const renewUrl = `${SunoApi.CLERK_BASE_URL}/v1/client/sessions/${this.sid}/tokens?_clerk_js_version==4.72.4`;
// Renew session token
const renewResponse = await this.client.post(renewUrl);
logger.info("KeepAlive...\n");