@akilles/soundcloud-watcher 2.2.5 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/soundcloud_watcher.ts +9 -4
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Monitor your SoundCloud account and track artist releases. Get notified when som
|
|
|
9
9
|
- **New releases** - Get notifications when tracked artists release new music
|
|
10
10
|
- **Smart API usage** - Only fetches what changed, automatically skips dormant artists
|
|
11
11
|
- **Rate limit handling** - Exponential backoff for API reliability
|
|
12
|
+
- **OAuth 2.1** - Uses SoundCloud's latest authentication endpoint
|
|
12
13
|
|
|
13
14
|
## Prerequisites
|
|
14
15
|
|
|
@@ -85,7 +86,7 @@ The plugin responds to commands but doesn't auto-poll. Set up a cron job for aut
|
|
|
85
86
|
openclaw cron add --name "soundcloud-check" \
|
|
86
87
|
--every 6h \
|
|
87
88
|
--isolated \
|
|
88
|
-
--message "Run /soundcloud-cron and forward any updates to me
|
|
89
|
+
--message "Run /soundcloud-cron and forward any updates to me."
|
|
89
90
|
```
|
|
90
91
|
|
|
91
92
|
Uses `/soundcloud-cron` which:
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/soundcloud_watcher.ts
CHANGED
|
@@ -336,14 +336,19 @@ class SoundCloudAPI {
|
|
|
336
336
|
|
|
337
337
|
try {
|
|
338
338
|
this.log("Refreshing token...");
|
|
339
|
+
const basicAuth = Buffer.from(
|
|
340
|
+
`${this.config.clientId}:${this.config.clientSecret}`
|
|
341
|
+
).toString("base64");
|
|
339
342
|
const body = new URLSearchParams({
|
|
340
343
|
grant_type: "client_credentials",
|
|
341
|
-
client_id: this.config.clientId,
|
|
342
|
-
client_secret: this.config.clientSecret,
|
|
343
344
|
});
|
|
344
|
-
const resp = await fetch(
|
|
345
|
+
const resp = await fetch("https://secure.soundcloud.com/oauth/token", {
|
|
345
346
|
method: "POST",
|
|
346
|
-
headers: {
|
|
347
|
+
headers: {
|
|
348
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
349
|
+
"Authorization": `Basic ${basicAuth}`,
|
|
350
|
+
"Accept": "application/json; charset=utf-8",
|
|
351
|
+
},
|
|
347
352
|
body: body.toString(),
|
|
348
353
|
signal: AbortSignal.timeout(API_TIMEOUT_MS),
|
|
349
354
|
});
|