From d004699e210c5d4191a1fc8bceb817fb7623acbe Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 11 Mar 2024 13:35:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=9F=E6=88=90=E8=BE=83=E9=95=BF?= =?UTF-8?q?=E6=97=B6suno=20token=E8=BF=87=E6=9C=9F=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/SunoClient.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/SunoClient.js b/client/SunoClient.js index 4e99e13..fc87109 100644 --- a/client/SunoClient.js +++ b/client/SunoClient.js @@ -65,6 +65,10 @@ export class SunoClient { Authorization: `Bearer ${sess}` } }) + if (queryRes.status === 401) { + sess = await this.getToken() + continue + } if (queryRes.status !== 200) { logger.error(await queryRes.text()) console.error('Failed to query song')