|
| 1 | +let url = $request.url; |
| 2 | +const method = $request.method; |
| 3 | +console.log(`spotifyjson2-2026年02月26日`); |
| 4 | +if (!$response.body) { |
| 5 | + console.log(`$response.body为undefined:${url}`); |
| 6 | + $done({}); |
| 7 | +} |
| 8 | +let body = JSON.parse($response.body); |
| 9 | + |
| 10 | +if (url.includes("/device-capabilities/v1/capabilities")) { |
| 11 | + console.log('capabilities'); |
| 12 | + body.effective_license = 'premium'; |
| 13 | + //body.audio_quality = 'HIFI_24'; |
| 14 | + if (!body.supports_hifi?.fully_supported) { |
| 15 | + body.supports_hifi.fully_supported = true; |
| 16 | + } |
| 17 | + if (!body.supports_hifi?.user_eligible) { |
| 18 | + body.supports_hifi.user_eligible = true; |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +if (url.includes('com:443')) { |
| 23 | + url = url.replace(/com:443/, 'com'); |
| 24 | +} |
| 25 | +body = JSON.stringify(body); |
| 26 | +$done({ |
| 27 | + body, |
| 28 | + url |
| 29 | +}); |
| 30 | + |
| 31 | + |
0 commit comments