Update SunoApi.ts

4.72.2 up4.72.4
This commit is contained in:
swumagic 2024-05-19 00:30:43 +08:00 committed by GitHub
parent 74e7ebb5e3
commit d2acd138e4
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");