-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrefresh.yaml
More file actions
56 lines (49 loc) · 1.65 KB
/
Copy pathrefresh.yaml
File metadata and controls
56 lines (49 loc) · 1.65 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
site: suno
name: refresh
description: 验证 Suno 登录状态并查看剩余积分
domain: suno.com
strategy: cookie
browser: true
columns: [status, token_type, expires, credits_left]
pipeline:
- navigate: https://suno.com/create
- wait: 5
- evaluate: |
(async () => {
try {
let token = null;
if (window.Clerk && window.Clerk.session) {
token = await window.Clerk.session.getToken();
}
if (!token) {
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);
if (key && key.includes('clerk-db-session')) {
const sessionData = JSON.parse(localStorage.getItem(key));
token = sessionData?.token;
break;
}
}
}
if (!token) {
return [{ status: 'Failed: Token not found. Please log in manually in Chrome.', token_type: 'none' }];
}
const response = await fetch('https://studio-api.prod.suno.com/api/get_limit/', {
headers: { 'Authorization': `Bearer ${token}` }
});
const credits = response.ok ? (await response.json()).credits_left : 'unknown';
return [{
status: 'Success',
token_type: 'JWT (Clerk)',
expires: 'Current Session',
credits_left: credits
}];
} catch (e) {
return [{ status: `Error: ${e.message}`, token_type: 'error' }];
}
})()
- map:
status: ${{ item.status }}
type: ${{ item.token_type }}
expires: ${{ item.expires }}
credits: ${{ item.credits_left }}