Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 204b7e1

Browse files
test
1 parent e2c6f34 commit 204b7e1

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎js/spotify-json2.js‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+

‎module/spotify-test.module‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!name=SpotifyTest
2+
3+
[Header Rewrite]
4+
# if-none-match返回304状态码
5+
http-request ^https:\/\/(spclient\.wg\.spotify\.com|.*-spclient\.spotify\.com(:443)?)\/user-customization-service\/v1\/customize$ header-del if-none-match
6+
7+
[MITM]
8+
hostname = %APPEND% spclient.wg.spotify.com, *spclient.spotify.com
9+
10+
[Script]
11+
spotify-json = type=http-request,pattern=^https:\/\/(spclient\.wg\.spotify\.com|.*-spclient\.spotify\.com(:443)?)\/(artistview\/v1\/artist|album-entity-view\/v2\/album)\/,requires-body=0,script-path=https://raw.githubusercontent.com/app2smile/rules/master/js/spotify-json.js
12+
spotify-json2 = type=http-request,pattern=^https:\/\/(spclient\.wg\.spotify\.com|.*-spclient\.spotify\.com(:443)?)\/device-capabilities\/v1\/capabilities,requires-body=0,script-path=https://raw.githubusercontent.com/app2smile/rules/master/js/spotify-json2.js
13+
spotify-proto = type=http-response,pattern=^https:\/\/(spclient\.wg\.spotify\.com|.*-spclient\.spotify\.com(:443)?)\/(bootstrap\/v1\/bootstrap|user-customization-service\/v1\/customize),ドルrequires-body=1,binary-body-mode=1,max-size=0,script-path=https://raw.githubusercontent.com/app2smile/rules/master/js/spotify-proto.js,script-update-interval=0

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /